This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 73da693d2b7798cc5e539faadc117f2250398c09 Author: Mark Thomas <ma...@apache.org> AuthorDate: Tue Sep 15 14:44:40 2020 +0100 Deprecate JDBCRealm --- java/org/apache/catalina/mbeans/MBeanFactory.java | 7 +++++-- java/org/apache/catalina/mbeans/mbeans-descriptors.xml | 2 +- java/org/apache/catalina/realm/DataSourceRealm.java | 2 +- java/org/apache/catalina/realm/JDBCRealm.java | 4 ++++ webapps/docs/changelog.xml | 3 +++ webapps/docs/config/realm.xml | 3 +++ webapps/docs/realm-howto.xml | 3 +++ 7 files changed, 20 insertions(+), 4 deletions(-) diff --git a/java/org/apache/catalina/mbeans/MBeanFactory.java b/java/org/apache/catalina/mbeans/MBeanFactory.java index 6e411d0..ee45cd0 100644 --- a/java/org/apache/catalina/mbeans/MBeanFactory.java +++ b/java/org/apache/catalina/mbeans/MBeanFactory.java @@ -37,7 +37,6 @@ import org.apache.catalina.core.StandardHost; import org.apache.catalina.core.StandardService; import org.apache.catalina.loader.WebappLoader; import org.apache.catalina.realm.DataSourceRealm; -import org.apache.catalina.realm.JDBCRealm; import org.apache.catalina.realm.JNDIRealm; import org.apache.catalina.realm.MemoryRealm; import org.apache.catalina.realm.UserDatabaseRealm; @@ -325,13 +324,17 @@ public class MBeanFactory { * @return the object name of the created realm * * @exception Exception if an MBean cannot be created or registered + * + * @deprecated This method will be removed in Tomcat 10. Use a + * DataSourceRealm instead. */ + @Deprecated public String createJDBCRealm(String parent, String driverName, String connectionName, String connectionPassword, String connectionURL) throws Exception { // Create a new JDBCRealm instance - JDBCRealm realm = new JDBCRealm(); + org.apache.catalina.realm.JDBCRealm realm = new org.apache.catalina.realm.JDBCRealm(); realm.setDriverName(driverName); realm.setConnectionName(connectionName); realm.setConnectionPassword(connectionPassword); diff --git a/java/org/apache/catalina/mbeans/mbeans-descriptors.xml b/java/org/apache/catalina/mbeans/mbeans-descriptors.xml index 8af469b..913830f 100644 --- a/java/org/apache/catalina/mbeans/mbeans-descriptors.xml +++ b/java/org/apache/catalina/mbeans/mbeans-descriptors.xml @@ -106,7 +106,7 @@ </operation> <operation name="createJDBCRealm" - description="Create a new JDBC Realm" + description="Create a new JDBC Realm (deprecated - will be removed in Tomcat 10)" impact="ACTION" returnType="java.lang.String"> <parameter name="parent" diff --git a/java/org/apache/catalina/realm/DataSourceRealm.java b/java/org/apache/catalina/realm/DataSourceRealm.java index 24174ec..aa35cfe 100644 --- a/java/org/apache/catalina/realm/DataSourceRealm.java +++ b/java/org/apache/catalina/realm/DataSourceRealm.java @@ -33,7 +33,7 @@ import org.apache.naming.ContextBindings; /** * * Implementation of <b>Realm</b> that works with any JDBC JNDI DataSource. -* See the JDBCRealm.howto for more details on how to set up the database and +* See the Realm How-To for more details on how to set up the database and * for configuration options. * * @author Glenn L. Nielsen diff --git a/java/org/apache/catalina/realm/JDBCRealm.java b/java/org/apache/catalina/realm/JDBCRealm.java index 9f6c663..d32fcb1 100644 --- a/java/org/apache/catalina/realm/JDBCRealm.java +++ b/java/org/apache/catalina/realm/JDBCRealm.java @@ -47,7 +47,11 @@ import org.apache.tomcat.util.ExceptionUtils; * @author Craig R. McClanahan * @author Carson McDonald * @author Ignacio Ortega +* +* @deprecated Will be removed in Tomcat 10 onwards. Use the DataSourceRealm +* instead. */ +@Deprecated public class JDBCRealm extends RealmBase { diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index f6a9a95..2524fb3 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -51,6 +51,9 @@ Fix race condition when saving and recycling session in <code>PersistentValve</code>. (kfujino) </fix> + <update> + Deprecate the JDBCRealm. (markt) + </update> </changelog> </subsection> <subsection name="Coyote"> diff --git a/webapps/docs/config/realm.xml b/webapps/docs/config/realm.xml index 2b674c4..8cf4381 100644 --- a/webapps/docs/config/realm.xml +++ b/webapps/docs/config/realm.xml @@ -1024,6 +1024,9 @@ <subsection name="JDBC Database Realm - org.apache.catalina.realm.JDBCRealm"> + <p><strong>The JDBC Database Realm has been deprecated and will be removed + in Tomcat 10 onwards. Use the DataSourceRealm instead.</strong></p> + <p>The <strong>JDBC Database Realm</strong> connects Tomcat to a relational database, accessed through an appropriate JDBC driver, to perform lookups of usernames, passwords, and their associated diff --git a/webapps/docs/realm-howto.xml b/webapps/docs/realm-howto.xml index c70fc92..adad6aa 100644 --- a/webapps/docs/realm-howto.xml +++ b/webapps/docs/realm-howto.xml @@ -1115,6 +1115,9 @@ functionality to a UserDatabase Realm.</p> <h5>Introduction</h5> +<p><strong>The JDBC Database Realm has been deprecated and will be removed +in Tomcat 10 onwards. Use the DataSourceRealm instead.</strong></p> + <p><strong>JDBCRealm</strong> is an implementation of the Tomcat <code>Realm</code> interface that looks up users in a relational database accessed via a JDBC driver. There is substantial configuration flexibility --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org