Skip to content

Commit

Permalink
Remove deprecated RealmBase.getName() and associated code.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1771269 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Nov 25, 2016
1 parent 9d71248 commit c5fc59a
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 144 deletions.
13 changes: 0 additions & 13 deletions java/org/apache/catalina/realm/CombinedRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ public class CombinedRealm extends RealmBase {
*/
protected final List<Realm> realms = new LinkedList<>();

/**
* Descriptive information about this Realm implementation.
* @deprecated This will be removed in Tomcat 9 onwards.
*/
@Deprecated
protected static final String name = "CombinedRealm";

/**
* Add a realm to the list of realms that will be used to authenticate
* users.
Expand Down Expand Up @@ -393,12 +386,6 @@ public Principal authenticate(GSSContext gssContext, boolean storeCreds) {
return null;
}

@Override
@Deprecated
protected String getName() {
return name;
}

@Override
protected String getPassword(String username) {
// This method should never be called
Expand Down
14 changes: 0 additions & 14 deletions java/org/apache/catalina/realm/DataSourceRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@ public class DataSourceRealm extends RealmBase {
protected boolean localDataSource = false;


/**
* Descriptive information about this Realm implementation.
* @deprecated This will be removed in Tomcat 9 onwards.
*/
@Deprecated
protected static final String name = "DataSourceRealm";


/**
* The column in the user role table that names a role
*/
Expand Down Expand Up @@ -402,12 +394,6 @@ protected Connection open() {
return null;
}

@Override
@Deprecated
protected String getName() {
return name;
}

/**
* @return the password associated with the given principal's user name.
*/
Expand Down
15 changes: 0 additions & 15 deletions java/org/apache/catalina/realm/JAASRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,6 @@ public class JAASRealm extends RealmBase {
protected String appName = null;


/**
* Descriptive information about this <code>Realm</code> implementation.
* @deprecated This will be removed in Tomcat 9 onwards.
*/
@Deprecated
protected static final String name = "JAASRealm";


/**
* The list of role class names, split out for easy processing.
*/
Expand Down Expand Up @@ -471,13 +463,6 @@ protected Principal authenticate(String username,
}


@Override
@Deprecated
protected String getName() {
return name;
}


/**
* @return the password associated with the given principal's user name. This
* always returns null as the JAASRealm has no way of obtaining this
Expand Down
15 changes: 0 additions & 15 deletions java/org/apache/catalina/realm/JDBCRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ public class JDBCRealm
protected String driverName = null;


/**
* Descriptive information about this Realm implementation.
* @deprecated This will be removed in Tomcat 9 onwards.
*/
@Deprecated
protected static final String name = "JDBCRealm";


/**
* The PreparedStatement to use for authenticating users.
*/
Expand Down Expand Up @@ -502,13 +494,6 @@ protected PreparedStatement credentials(Connection dbConnection,
}


@Override
@Deprecated
protected String getName() {
return name;
}


/**
* Get the password for the specified user.
* @param username The user name
Expand Down
15 changes: 0 additions & 15 deletions java/org/apache/catalina/realm/JNDIRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,6 @@ public class JNDIRealm extends RealmBase {
public static final String DEREF_ALIASES = "java.naming.ldap.derefAliases";


/**
* Descriptive information about this Realm implementation.
* @deprecated This will be removed in Tomcat 9 onwards.
*/
@Deprecated
protected static final String name = "JNDIRealm";


/**
* The protocol that will be used in the communication with the
* directory server.
Expand Down Expand Up @@ -2169,13 +2161,6 @@ protected void close(DirContext context) {
}


@Override
@Deprecated
protected String getName() {
return name;
}


/**
* Get the password for the specified user.
* @param username The user name
Expand Down
11 changes: 0 additions & 11 deletions java/org/apache/catalina/realm/LockOutRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ public class LockOutRealm extends CombinedRealm {

private static final Log log = LogFactory.getLog(LockOutRealm.class);

/**
* Descriptive information about this Realm implementation.
*/
protected static final String name = "LockOutRealm";

/**
* The number of times in a row a user has to fail authentication to be
* locked out. Defaults to 5.
Expand Down Expand Up @@ -334,12 +329,6 @@ public int getLockOutTime() {
}


@Override
protected String getName() {
return name;
}


/**
* Set the period for which an account will be locked.
* @param lockOutTime the lockOutTime to set
Expand Down
15 changes: 0 additions & 15 deletions java/org/apache/catalina/realm/MemoryRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ public class MemoryRealm extends RealmBase {
private static Digester digester = null;


/**
* Descriptive information about this Realm implementation.
* @deprecated This will be removed in Tomcat 9 onwards.
*/
@Deprecated
protected static final String name = "MemoryRealm";


/**
* The pathname (absolute or relative to Catalina's current working
* directory) of the XML file containing our database information.
Expand Down Expand Up @@ -208,13 +200,6 @@ protected synchronized Digester getDigester() {
}


@Override
@Deprecated
protected String getName() {
return name;
}


/**
* @return the password associated with the given principal's user name.
*/
Expand Down
8 changes: 0 additions & 8 deletions java/org/apache/catalina/realm/NullRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@
*/
public class NullRealm extends RealmBase {

private static final String NAME = "NullRealm";

@Override
@Deprecated
protected String getName() {
return NAME;
}

@Override
protected String getPassword(String username) {
// Always return null
Expand Down
11 changes: 0 additions & 11 deletions java/org/apache/catalina/realm/RealmBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1163,17 +1163,6 @@ private Charset getDigestCharset() throws UnsupportedEncodingException {
}


/**
* @return a short name for this Realm implementation, for use in
* log messages.
*
* @deprecated This will be removed in Tomcat 9 onwards. Use
* {@link Class#getSimpleName()} instead.
*/
@Deprecated
protected abstract String getName();


/**
* Get the password for the specified user.
* @param username The user name
Expand Down
17 changes: 1 addition & 16 deletions java/org/apache/catalina/realm/UserDatabaseRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ public class UserDatabaseRealm
protected UserDatabase database = null;


/**
* Descriptive information about this Realm implementation.
* @deprecated This will be removed in Tomcat 9 onwards.
*/
@Deprecated
protected static final String name = "UserDatabaseRealm";


/**
* The global JNDI name of the <code>UserDatabase</code> resource
* we will be utilizing.
Expand Down Expand Up @@ -154,15 +146,8 @@ public boolean hasRole(Wrapper wrapper, Principal principal, String role) {
return false;
}

// ------------------------------------------------------ Protected Methods


@Override
@Deprecated
protected String getName() {
return name;
}

// ------------------------------------------------------ Protected Methods

/**
* Return the password associated with the given principal's user name.
Expand Down
5 changes: 0 additions & 5 deletions java/org/apache/catalina/startup/Tomcat.java
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,6 @@ protected Realm createDefaultRealm() {


private class SimpleRealm extends RealmBase {
@Override
@Deprecated
protected String getName() {
return "Simple";
}

@Override
protected String getPassword(String username) {
Expand Down
6 changes: 0 additions & 6 deletions test/org/apache/catalina/startup/TesterMapRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ public void addUserRole(String username, String role) {
userRoles.add(role);
}

@Override
@Deprecated
protected String getName() {
return "MapRealm";
}

@Override
protected String getPassword(String username) {
return users.get(username);
Expand Down
5 changes: 5 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@
Refactor Catalina interfaces to make wider use of the
<code>Contained</code> interface and reduce duplication. (markt)
</scode>
<scode>
Remove the <code>getName()</code> method from <code>RealmBase</code>
along with the various constants used by the sub-classes to store the
return value. (markt)
</scode>
</changelog>
</subsection>
<subsection name="Coyote">
Expand Down

0 comments on commit c5fc59a

Please sign in to comment.