This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 15bbc3d545f4052b082ea726ec66bc7a20dd0460 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 c1580a5..1dce4b0 100644 --- a/java/org/apache/catalina/mbeans/MBeanFactory.java +++ b/java/org/apache/catalina/mbeans/MBeanFactory.java @@ -39,7 +39,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; @@ -392,13 +391,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 6c59c00..168d45e 100644 --- a/java/org/apache/catalina/mbeans/mbeans-descriptors.xml +++ b/java/org/apache/catalina/mbeans/mbeans-descriptors.xml @@ -115,7 +115,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 97ddf07..9020597 100644 --- a/java/org/apache/catalina/realm/DataSourceRealm.java +++ b/java/org/apache/catalina/realm/DataSourceRealm.java @@ -35,7 +35,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 9679de2..76d0751 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 eb0ee90..b675d3b 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -80,6 +80,9 @@ the requested resource. Based on a pull request by Sergey Ponomarev. (markt) </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 b536e13..66a3b6e 100644 --- a/webapps/docs/config/realm.xml +++ b/webapps/docs/config/realm.xml @@ -1046,6 +1046,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 d52a003..29e637d 100644 --- a/webapps/docs/realm-howto.xml +++ b/webapps/docs/realm-howto.xml @@ -1110,6 +1110,9 @@ functionality to a UserDatabase Realm.</p> <h3>Introduction</h3> +<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