This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 8110b3d5fc Remove unnecessary Javadoc
8110b3d5fc is described below
commit 8110b3d5fc791fb5bb2cd2c6991132998039b326
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Mar 9 14:37:46 2023 +0000
Remove unnecessary Javadoc
---
java/org/apache/catalina/Realm.java | 49 +++++----
java/org/apache/catalina/realm/CombinedRealm.java | 63 ++----------
.../org/apache/catalina/realm/DataSourceRealm.java | 19 +---
.../catalina/realm/JAASMemoryLoginModule.java | 42 +-------
java/org/apache/catalina/realm/JAASRealm.java | 36 -------
java/org/apache/catalina/realm/JNDIRealm.java | 10 +-
java/org/apache/catalina/realm/LockOutRealm.java | 39 +------
java/org/apache/catalina/realm/MemoryRealm.java | 25 -----
java/org/apache/catalina/realm/RealmBase.java | 112 ++-------------------
.../apache/catalina/realm/UserDatabaseRealm.java | 15 +--
10 files changed, 57 insertions(+), 353 deletions(-)
diff --git a/java/org/apache/catalina/Realm.java
b/java/org/apache/catalina/Realm.java
index 769db66e85..09a7f8925d 100644
--- a/java/org/apache/catalina/Realm.java
+++ b/java/org/apache/catalina/Realm.java
@@ -65,8 +65,8 @@ public interface Realm extends Contained {
* Try to authenticate with the specified username.
*
* @param username Username of the Principal to look up
- * @return the associated principal, or <code>null</code> if none is
- * associated.
+ *
+ * @return the associated principal, or {@code null} if none is associated.
*/
Principal authenticate(String username);
@@ -78,7 +78,8 @@ public interface Realm extends Contained {
* @param username Username of the Principal to look up
* @param credentials Password or other credentials to use in
* authenticating this username
- * @return the associated principal, or <code>null</code> if there is none
+ *
+ * @return the associated principal, or {@code null} if there is none
*/
Principal authenticate(String username, String credentials);
@@ -94,12 +95,13 @@ public interface Realm extends Contained {
* for this request
* @param nc the nonce counter
* @param cnonce the client chosen nonce
- * @param qop the "quality of protection" (<code>nc</code> and
<code>cnonce</code>
- * will only be used, if <code>qop</code> is not <code>null</code>).
+ * @param qop the "quality of protection" ({@code nc} and {@code cnonce}
+ * will only be used, if {@code qop} is not {@code null}).
* @param realm Realm name
* @param md5a2 Second MD5 digest used to calculate the digest :
* MD5(Method + ":" + uri)
- * @return the associated principal, or <code>null</code> if there is none.
+ *
+ * @return the associated principal, or {@code null} if there is none.
*/
Principal authenticate(String username, String digest,
String nonce, String nc, String cnonce,
@@ -108,18 +110,18 @@ public interface Realm extends Contained {
/**
- * Try to authenticate using a {@link GSSContext}
+ * Try to authenticate using a {@link GSSContext}.
*
* @param gssContext The gssContext processed by the {@link Authenticator}.
* @param storeCreds Should the realm attempt to store the delegated
* credentials in the returned Principal?
- * @return the associated principal, or <code>null</code> if there is none
+ * @return the associated principal, or {@code null} if there is none
*/
Principal authenticate(GSSContext gssContext, boolean storeCreds);
/**
- * Try to authenticate using a {@link GSSName}
+ * Try to authenticate using a {@link GSSName}.
*
* @param gssName The {@link GSSName} of the principal to look up
* @param gssCredential The {@link GSSCredential} of the principal, may be
@@ -130,11 +132,12 @@ public interface Realm extends Contained {
/**
- * Try to authenticate using {@link X509Certificate}s
+ * Try to authenticate using a chain of {@link X509Certificate}s.
*
* @param certs Array of client certificates, with the first one in
* the array being the certificate of the client itself.
- * @return the associated principal, or <code>null</code> if there is none
+ *
+ * @return the associated principal, or {@code null} if there is none
*/
Principal authenticate(X509Certificate certs[]);
@@ -152,9 +155,10 @@ public interface Realm extends Contained {
* this request.
*
* @param request Request we are processing
- * @param context {@link Context} for this request
- * @return the configured {@link SecurityConstraint}, of <code>null</code>
- * if there is none
+ * @param context Context the Request is mapped to
+ *
+ * @return the configured {@link SecurityConstraint}, or {@code null} if
+ * there is none
*/
SecurityConstraint [] findSecurityConstraints(Request request,
Context context);
@@ -167,8 +171,9 @@ public interface Realm extends Contained {
* @param response Response we are creating
* @param constraint Security constraint we are enforcing
* @param context The Context to which client of this class is attached.
- * @return <code>true</code> if this constraint is satisfied and processing
- * should continue, or <code>false</code> otherwise
+ *
+ * @return {@code true} if this constraint is satisfied and processing
+ * should continue, or {@code false} otherwise
*
* @exception IOException if an input/output error occurs
*/
@@ -186,9 +191,10 @@ public interface Realm extends Contained {
* @param wrapper wrapper context for evaluating role
* @param principal Principal for whom the role is to be checked
* @param role Security role to be checked
- * @return <code>true</code> if the specified Principal has the specified
+ *
+ * @return {@code true} if the specified Principal has the specified
* security role, within the context of this Realm; otherwise
return
- * <code>false</code>.
+ * {@code false}.
*/
boolean hasRole(Wrapper wrapper, Principal principal, String role);
@@ -200,8 +206,9 @@ public interface Realm extends Contained {
* @param request Request we are processing
* @param response Response we are creating
* @param constraint Security constraint being checked
- * @return <code>true</code> if this constraint
- * was not violated and processing should continue, or
<code>false</code>
+ *
+ * @return {@code true} if this constraint
+ * was not violated and processing should continue, or {@code
false}
* if we have created a response already.
*
* @exception IOException if an input/output error occurs
@@ -222,7 +229,7 @@ public interface Realm extends Contained {
/**
* Return the availability of the realm for authentication.
- * @return <code>true</code> if the realm is able to perform authentication
+ * @return {@code true} if the realm is able to perform authentication
*/
default boolean isAvailable() {
return true;
diff --git a/java/org/apache/catalina/realm/CombinedRealm.java
b/java/org/apache/catalina/realm/CombinedRealm.java
index 807e5c7f34..0b942a78e7 100644
--- a/java/org/apache/catalina/realm/CombinedRealm.java
+++ b/java/org/apache/catalina/realm/CombinedRealm.java
@@ -78,6 +78,7 @@ public class CombinedRealm extends RealmBase {
return result;
}
+
/**
* @return the list of Realms contained by this Realm.
*/
@@ -85,16 +86,7 @@ public class CombinedRealm extends RealmBase {
return realms.toArray(new Realm[0]);
}
- /**
- * Return the Principal associated with the specified username, which
matches the digest calculated using the given
- * parameters using the method described in RFC 2069; otherwise return
<code>null</code>.
- *
- * @param username Username of the Principal to look up
- * @param clientDigest Digest which has been submitted by the client
- * @param nonce Unique (or supposedly unique) token which has been
used for this request
- * @param realmName Realm name
- * @param md5a2 Second MD5 digest used to calculate the digest :
MD5(Method + ":" + uri)
- */
+
@Override
public Principal authenticate(String username, String clientDigest, String
nonce, String nc, String cnonce,
String qop, String realmName, String md5a2) {
@@ -122,11 +114,6 @@ public class CombinedRealm extends RealmBase {
}
- /**
- * Return the Principal associated with the specified user name otherwise
return <code>null</code>.
- *
- * @param username User name of the Principal to look up
- */
@Override
public Principal authenticate(String username) {
Principal authenticatedUser = null;
@@ -153,13 +140,6 @@ public class CombinedRealm extends RealmBase {
}
- /**
- * Return the Principal associated with the specified username and
credentials, if there is one; otherwise return
- * <code>null</code>.
- *
- * @param username Username of the Principal to look up
- * @param credentials Password or other credentials to use in
authenticating this username
- */
@Override
public Principal authenticate(String username, String credentials) {
Principal authenticatedUser = null;
@@ -186,11 +166,6 @@ public class CombinedRealm extends RealmBase {
}
- /**
- * Set the Container with which this Realm has been associated.
- *
- * @param container The associated Container
- */
@Override
public void setContainer(Container container) {
for (Realm realm : realms) {
@@ -206,13 +181,6 @@ public class CombinedRealm extends RealmBase {
}
- /**
- * Prepare for the beginning of active use of the public methods of this
component and implement the requirements of
- * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
- *
- * @exception LifecycleException if this component detects a fatal error
that prevents this component from being
- * used
- */
@Override
protected void startInternal() throws LifecycleException {
// Start 'sub-realms' then this one
@@ -240,12 +208,6 @@ public class CombinedRealm extends RealmBase {
}
- /**
- * Gracefully terminate the active use of the public methods of this
component and implement the requirements of
- * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
- *
- * @exception LifecycleException if this component detects a fatal error
that needs to be reported
- */
@Override
protected void stopInternal() throws LifecycleException {
// Stop this realm, then the sub-realms (reverse order to start)
@@ -271,6 +233,7 @@ public class CombinedRealm extends RealmBase {
super.destroyInternal();
}
+
/**
* Delegate the backgroundProcess call to all sub-realms.
*/
@@ -283,13 +246,7 @@ public class CombinedRealm extends RealmBase {
}
}
- /**
- * Return the Principal associated with the specified chain of X509 client
certificates. If there is none, return
- * <code>null</code>.
- *
- * @param certs Array of client certificates, with the first one in the
array being the certificate of the client
- * itself.
- */
+
@Override
public Principal authenticate(X509Certificate[] certs) {
Principal authenticatedUser = null;
@@ -319,9 +276,7 @@ public class CombinedRealm extends RealmBase {
return authenticatedUser;
}
- /**
- * {@inheritDoc}
- */
+
@Override
public Principal authenticate(GSSContext gssContext, boolean storeCred) {
if (gssContext.isEstablished()) {
@@ -359,9 +314,7 @@ public class CombinedRealm extends RealmBase {
return null;
}
- /**
- * {@inheritDoc}
- */
+
@Override
public Principal authenticate(GSSName gssName, GSSCredential
gssCredential) {
Principal authenticatedUser = null;
@@ -387,9 +340,7 @@ public class CombinedRealm extends RealmBase {
return authenticatedUser;
}
- /**
- * {@inheritDoc}
- */
+
@Override
public boolean hasRole(Wrapper wrapper, Principal principal, String role) {
for (Realm realm : realms) {
diff --git a/java/org/apache/catalina/realm/DataSourceRealm.java
b/java/org/apache/catalina/realm/DataSourceRealm.java
index e3713a4ef8..14b690ceee 100644
--- a/java/org/apache/catalina/realm/DataSourceRealm.java
+++ b/java/org/apache/catalina/realm/DataSourceRealm.java
@@ -224,15 +224,11 @@ public class DataSourceRealm extends RealmBase {
// --------------------------------------------------------- Public Methods
/**
- * Return the Principal associated with the specified username and
credentials, if there is one; otherwise return
- * <code>null</code>. If there are any errors with the JDBC connection,
executing the query or anything we return
- * null (don't authenticate). This event is also logged, and the
connection will be closed so that a subsequent
+ * {@inheritDoc}
+ * <p>
+ * If there are any errors with the JDBC connection, executing the query
or anything this method returns
+ * null (doesn't authenticate). This event is also logged, and the
connection will be closed so that a subsequent
* request will automatically re-open it.
- *
- * @param username Username of the Principal to look up
- * @param credentials Password or other credentials to use in
authenticating this username
- *
- * @return the associated principal, or <code>null</code> if there is none.
*/
@Override
public Principal authenticate(String username, String credentials) {
@@ -529,13 +525,6 @@ public class DataSourceRealm extends RealmBase {
// ------------------------------------------------------ Lifecycle Methods
- /**
- * Prepare for the beginning of active use of the public methods of this
component and implement the requirements of
- * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
- *
- * @exception LifecycleException if this component detects a fatal error
that prevents this component from being
- * used
- */
@Override
protected void startInternal() throws LifecycleException {
diff --git a/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
b/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
index cf9cbab116..1958e90a02 100644
--- a/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
+++ b/java/org/apache/catalina/realm/JAASMemoryLoginModule.java
@@ -127,15 +127,7 @@ public class JAASMemoryLoginModule extends MemoryRealm
implements LoginModule {
}
}
- /**
- * Phase 2 of authenticating a <code>Subject</code> when Phase 1 fails.
This method is called if the
- * <code>LoginContext</code> failed somewhere in the overall
authentication chain.
- *
- * @return <code>true</code> if this method succeeded, or
<code>false</code> if this <code>LoginModule</code> should
- * be ignored
- *
- * @exception LoginException if the abort fails
- */
+
@Override
public boolean abort() throws LoginException {
@@ -158,15 +150,6 @@ public class JAASMemoryLoginModule extends MemoryRealm
implements LoginModule {
}
- /**
- * Phase 2 of authenticating a <code>Subject</code> when Phase 1 was
successful. This method is called if the
- * <code>LoginContext</code> succeeded in the overall authentication chain.
- *
- * @return <code>true</code> if the authentication succeeded, or
<code>false</code> if this <code>LoginModule</code>
- * should be ignored
- *
- * @exception LoginException if the commit fails
- */
@Override
public boolean commit() throws LoginException {
if (log.isDebugEnabled()) {
@@ -197,14 +180,6 @@ public class JAASMemoryLoginModule extends MemoryRealm
implements LoginModule {
}
- /**
- * Initialize this <code>LoginModule</code> with the specified
configuration information.
- *
- * @param subject The <code>Subject</code> to be authenticated
- * @param callbackHandler A <code>CallbackHandler</code> for communicating
with the end user as necessary
- * @param sharedState State information shared with other
<code>LoginModule</code> instances
- * @param options Configuration information for this specific
<code>LoginModule</code> instance
- */
@Override
public void initialize(Subject subject, CallbackHandler callbackHandler,
Map<String, ?> sharedState,
Map<String, ?> options) {
@@ -258,14 +233,6 @@ public class JAASMemoryLoginModule extends MemoryRealm
implements LoginModule {
}
- /**
- * Phase 1 of authenticating a <code>Subject</code>.
- *
- * @return <code>true</code> if the authentication succeeded, or
<code>false</code> if this <code>LoginModule</code>
- * should be ignored
- *
- * @exception LoginException if the authentication fails
- */
@Override
public boolean login() throws LoginException {
// Set up our CallbackHandler requests
@@ -334,13 +301,6 @@ public class JAASMemoryLoginModule extends MemoryRealm
implements LoginModule {
}
- /**
- * Log out this user.
- *
- * @return <code>true</code> in all cases because the
<code>LoginModule</code> should not be ignored
- *
- * @exception LoginException if logging out failed
- */
@Override
public boolean logout() throws LoginException {
subject.getPrincipals().remove(principal);
diff --git a/java/org/apache/catalina/realm/JAASRealm.java
b/java/org/apache/catalina/realm/JAASRealm.java
index ae19308a18..5158628251 100644
--- a/java/org/apache/catalina/realm/JAASRealm.java
+++ b/java/org/apache/catalina/realm/JAASRealm.java
@@ -308,36 +308,12 @@ public class JAASRealm extends RealmBase {
// --------------------------------------------------------- Public Methods
- /**
- * Return the <code>Principal</code> associated with the specified
username and credentials, if there is one;
- * otherwise return <code>null</code>.
- *
- * @param username Username of the <code>Principal</code> to look up
- * @param credentials Password or other credentials to use in
authenticating this username
- *
- * @return the associated principal, or <code>null</code> if there is none.
- */
@Override
public Principal authenticate(String username, String credentials) {
return authenticate(username, new JAASCallbackHandler(this, username,
credentials));
}
- /**
- * Return the <code>Principal</code> associated with the specified
username and digest, if there is one; otherwise
- * return <code>null</code>.
- *
- * @param username Username of the <code>Principal</code> to look up
- * @param clientDigest Digest to use in authenticating this username
- * @param nonce Server generated nonce
- * @param nc Nonce count
- * @param cnonce Client generated nonce
- * @param qop Quality of protection applied to the message
- * @param realmName Realm name
- * @param md5a2 Second MD5 digest used to calculate the digest
MD5(Method + ":" + uri)
- *
- * @return the associated principal, or <code>null</code> if there is none.
- */
@Override
public Principal authenticate(String username, String clientDigest, String
nonce, String nc, String cnonce,
String qop, String realmName, String md5a2) {
@@ -346,12 +322,8 @@ public class JAASRealm extends RealmBase {
}
- // -------------------------------------------------------- Package Methods
-
-
// ------------------------------------------------------ Protected Methods
-
/**
* Perform the actual JAAS authentication.
*
@@ -594,14 +566,6 @@ public class JAASRealm extends RealmBase {
// ------------------------------------------------------ Lifecycle Methods
-
- /**
- * Prepare for the beginning of active use of the public methods of this
component and implement the requirements of
- * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
- *
- * @exception LifecycleException if this component detects a fatal error
that prevents this component from being
- * used
- */
@Override
protected void startInternal() throws LifecycleException {
diff --git a/java/org/apache/catalina/realm/JNDIRealm.java
b/java/org/apache/catalina/realm/JNDIRealm.java
index 2f75f11619..b002854a02 100644
--- a/java/org/apache/catalina/realm/JNDIRealm.java
+++ b/java/org/apache/catalina/realm/JNDIRealm.java
@@ -1120,15 +1120,11 @@ public class JNDIRealm extends RealmBase {
// ---------------------------------------------------------- Realm Methods
/**
- * Return the Principal associated with the specified username and
credentials, if there is one; otherwise return
- * <code>null</code>. If there are any errors with the JDBC connection,
executing the query or anything we return
+ * {@inheritDoc}
+ * <p>
+ * If there are any errors with the JNDI connection, executing the query
or anything we return
* null (don't authenticate). This event is also logged, and the
connection will be closed so that a subsequent
* request will automatically re-open it.
- *
- * @param username Username of the Principal to look up
- * @param credentials Password or other credentials to use in
authenticating this username
- *
- * @return the associated principal, or <code>null</code> if there is none.
*/
@Override
public Principal authenticate(String username, String credentials) {
diff --git a/java/org/apache/catalina/realm/LockOutRealm.java
b/java/org/apache/catalina/realm/LockOutRealm.java
index fc79bee747..88cc18df36 100644
--- a/java/org/apache/catalina/realm/LockOutRealm.java
+++ b/java/org/apache/catalina/realm/LockOutRealm.java
@@ -72,13 +72,6 @@ public class LockOutRealm extends CombinedRealm {
protected Map<String, LockRecord> failedUsers = null;
- /**
- * Prepare for the beginning of active use of the public methods of this
component and implement the requirements of
- * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
- *
- * @exception LifecycleException if this component detects a fatal error
that prevents this component from being
- * used
- */
@Override
protected synchronized void startInternal() throws LifecycleException {
/*
@@ -109,16 +102,6 @@ public class LockOutRealm extends CombinedRealm {
}
- /**
- * Return the Principal associated with the specified username, which
matches the digest calculated using the given
- * parameters using the method described in RFC 2069; otherwise return
<code>null</code>.
- *
- * @param username Username of the Principal to look up
- * @param clientDigest Digest which has been submitted by the client
- * @param nonce Unique (or supposedly unique) token which has been
used for this request
- * @param realmName Realm name
- * @param md5a2 Second MD5 digest used to calculate the digest :
MD5(Method + ":" + uri)
- */
@Override
public Principal authenticate(String username, String clientDigest, String
nonce, String nc, String cnonce,
String qop, String realmName, String md5a2) {
@@ -129,13 +112,6 @@ public class LockOutRealm extends CombinedRealm {
}
- /**
- * Return the Principal associated with the specified username and
credentials, if there is one; otherwise return
- * <code>null</code>.
- *
- * @param username Username of the Principal to look up
- * @param credentials Password or other credentials to use in
authenticating this username
- */
@Override
public Principal authenticate(String username, String credentials) {
Principal authenticatedUser = super.authenticate(username,
credentials);
@@ -143,13 +119,6 @@ public class LockOutRealm extends CombinedRealm {
}
- /**
- * Return the Principal associated with the specified chain of X509 client
certificates. If there is none, return
- * <code>null</code>.
- *
- * @param certs Array of client certificates, with the first one in the
array being the certificate of the client
- * itself.
- */
@Override
public Principal authenticate(X509Certificate[] certs) {
String username = null;
@@ -162,9 +131,6 @@ public class LockOutRealm extends CombinedRealm {
}
- /**
- * {@inheritDoc}
- */
@Override
public Principal authenticate(GSSContext gssContext, boolean storeCreds) {
if (gssContext.isEstablished()) {
@@ -188,9 +154,7 @@ public class LockOutRealm extends CombinedRealm {
return null;
}
- /**
- * {@inheritDoc}
- */
+
@Override
public Principal authenticate(GSSName gssName, GSSCredential
gssCredential) {
String username = gssName.toString();
@@ -235,6 +199,7 @@ public class LockOutRealm extends CombinedRealm {
registerAuthSuccess(username);
}
+
/*
* Checks to see if the current user is locked. If this is associated with
a login attempt, then the last access
* time will be recorded and any attempt to authenticated a locked user
will log a warning.
diff --git a/java/org/apache/catalina/realm/MemoryRealm.java
b/java/org/apache/catalina/realm/MemoryRealm.java
index 4e90ee3a53..e918a89eb7 100644
--- a/java/org/apache/catalina/realm/MemoryRealm.java
+++ b/java/org/apache/catalina/realm/MemoryRealm.java
@@ -101,16 +101,6 @@ public class MemoryRealm extends RealmBase {
// --------------------------------------------------------- Public Methods
-
- /**
- * Return the Principal associated with the specified username and
credentials, if there is one; otherwise return
- * <code>null</code>.
- *
- * @param username Username of the Principal to look up
- * @param credentials Password or other credentials to use in
authenticating this username
- *
- * @return the associated principal, or <code>null</code> if there is none.
- */
@Override
public Principal authenticate(String username, String credentials) {
@@ -213,35 +203,20 @@ public class MemoryRealm extends RealmBase {
}
- /**
- * @return the password associated with the given principal's user name.
- */
@Override
protected String getPassword(String username) {
return credentials.get(username);
}
- /**
- * @return the Principal associated with the given user name.
- */
@Override
protected Principal getPrincipal(String username) {
-
return principals.get(username);
-
}
// ------------------------------------------------------ Lifecycle Methods
- /**
- * Prepare for the beginning of active use of the public methods of this
component and implement the requirements of
- * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
- *
- * @exception LifecycleException if this component detects a fatal error
that prevents this component from being
- * used
- */
@Override
protected void startInternal() throws LifecycleException {
String pathName = getPathname();
diff --git a/java/org/apache/catalina/realm/RealmBase.java
b/java/org/apache/catalina/realm/RealmBase.java
index c55a64bc7c..221da3f718 100644
--- a/java/org/apache/catalina/realm/RealmBase.java
+++ b/java/org/apache/catalina/realm/RealmBase.java
@@ -177,20 +177,12 @@ public abstract class RealmBase extends
LifecycleMBeanBase implements Realm {
}
- /**
- * Return the Container with which this Realm has been associated.
- */
@Override
public Container getContainer() {
return container;
}
- /**
- * Set the Container with which this Realm has been associated.
- *
- * @param container The associated Container
- */
@Override
public void setContainer(Container container) {
@@ -274,25 +266,12 @@ public abstract class RealmBase extends
LifecycleMBeanBase implements Realm {
// --------------------------------------------------------- Public Methods
-
- /**
- * Add a property change listener to this component.
- *
- * @param listener The listener to add
- */
@Override
public void addPropertyChangeListener(PropertyChangeListener listener) {
-
support.addPropertyChangeListener(listener);
-
}
- /**
- * Return the Principal associated with the specified username, if there
is one; otherwise return <code>null</code>.
- *
- * @param username Username of the Principal to look up
- */
@Override
public Principal authenticate(String username) {
@@ -308,15 +287,6 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
}
- /**
- * Return the Principal associated with the specified username and
credentials, if there is one; otherwise return
- * <code>null</code>.
- *
- * @param username Username of the Principal to look up
- * @param credentials Password or other credentials to use in
authenticating this username
- *
- * @return the associated principal, or <code>null</code> if there is none.
- */
@Override
public Principal authenticate(String username, String credentials) {
// No user or no credentials
@@ -358,22 +328,6 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
}
- /**
- * Try to authenticate with the specified username, which matches the
digest calculated using the given parameters
- * using the method described in RFC 2617 (which is a superset of RFC
2069).
- *
- * @param username Username of the Principal to look up
- * @param clientDigest Digest which has been submitted by the client
- * @param nonce Unique (or supposedly unique) token which has been
used for this request
- * @param nc the nonce counter
- * @param cnonce the client chosen nonce
- * @param qop the "quality of protection" (<code>nc</code> and
<code>cnonce</code> will only be used, if
- * <code>qop</code> is not <code>null</code>).
- * @param realm Realm name
- * @param md5a2 Second MD5 digest used to calculate the digest :
MD5(Method + ":" + uri)
- *
- * @return the associated principal, or <code>null</code> if there is none.
- */
@Override
public Principal authenticate(String username, String clientDigest, String
nonce, String nc, String cnonce,
String qop, String realm, String md5a2) {
@@ -415,13 +369,6 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
}
- /**
- * Return the Principal associated with the specified chain of X509 client
certificates. If there is none, return
- * <code>null</code>.
- *
- * @param certs Array of client certificates, with the first one in the
array being the certificate of the client
- * itself.
- */
@Override
public Principal authenticate(X509Certificate certs[]) {
@@ -454,9 +401,6 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
}
- /**
- * {@inheritDoc}
- */
@Override
public Principal authenticate(GSSContext gssContext, boolean storeCred) {
if (gssContext.isEstablished()) {
@@ -494,9 +438,6 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
}
- /**
- * {@inheritDoc}
- */
@Override
public Principal authenticate(GSSName gssName, GSSCredential
gssCredential) {
if (gssName == null) {
@@ -508,8 +449,9 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
/**
- * Execute a periodic task, such as reloading, etc. This method will be
invoked inside the classloading context of
- * this container. Unexpected throwables will be caught and logged.
+ * {@inheritDoc}
+ * <p>
+ * The default implementation is NO-OP.
*/
@Override
public void backgroundProcess() {
@@ -517,13 +459,6 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
}
- /**
- * Return the SecurityConstraints configured to guard the request URI for
this request, or <code>null</code> if
- * there is no such constraint.
- *
- * @param request Request we are processing
- * @param context Context the Request is mapped to
- */
@Override
public SecurityConstraint[] findSecurityConstraints(Request request,
Context context) {
@@ -768,17 +703,6 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
}
- /**
- * Perform access control based on the specified authorization constraint.
Return <code>true</code> if this
- * constraint is satisfied and processing should continue, or
<code>false</code> otherwise.
- *
- * @param request Request we are processing
- * @param response Response we are creating
- * @param constraints Security constraint we are enforcing
- * @param context The Context to which client of this class is
attached.
- *
- * @exception IOException if an input/output error occurs
- */
@Override
public boolean hasResourcePermission(Request request, Response response,
SecurityConstraint[] constraints,
Context context) throws IOException {
@@ -885,9 +809,11 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
/**
- * {@inheritDoc} This method or {@link #hasRoleInternal(Principal,
String)} can be overridden by Realm
- * implementations, but the default is adequate when an instance of
<code>GenericPrincipal</code> is used to
- * represent authenticated Principals from this Realm.
+ * {@inheritDoc}
+ * <p>
+ * This method or {@link #hasRoleInternal(Principal, String)} can be
overridden by Realm implementations, but the
+ * default is adequate when an instance of <code>GenericPrincipal</code>
is used to represent authenticated
+ * Principals from this Realm.
*/
@Override
public boolean hasRole(Wrapper wrapper, Principal principal, String role) {
@@ -942,17 +868,6 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
}
- /**
- * Enforce any user data constraint required by the security constraint
guarding this request URI. Return
- * <code>true</code> if this constraint was not violated and processing
should continue, or <code>false</code> if we
- * have created a response already.
- *
- * @param request Request we are processing
- * @param response Response we are creating
- * @param constraints Security constraint being checked
- *
- * @exception IOException if an input/output error occurs
- */
@Override
public boolean hasUserDataPermission(Request request, Response response,
SecurityConstraint[] constraints)
throws IOException {
@@ -1032,16 +947,9 @@ public abstract class RealmBase extends
LifecycleMBeanBase implements Realm {
}
- /**
- * Remove a property change listener from this component.
- *
- * @param listener The listener to remove
- */
@Override
public void removePropertyChangeListener(PropertyChangeListener listener) {
-
support.removePropertyChangeListener(listener);
-
}
@@ -1058,6 +966,7 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
x509UsernameRetriever =
createUsernameRetriever(x509UsernameRetrieverClassName);
}
+
/**
* Prepare for the beginning of active use of the public methods of this
component and implement the requirements of
* {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
@@ -1087,9 +996,6 @@ public abstract class RealmBase extends LifecycleMBeanBase
implements Realm {
}
- /**
- * Return a String representation of this component.
- */
@Override
public String toString() {
return ToStringUtil.toString(this);
diff --git a/java/org/apache/catalina/realm/UserDatabaseRealm.java
b/java/org/apache/catalina/realm/UserDatabaseRealm.java
index f8dc9866ac..16a3f86108 100644
--- a/java/org/apache/catalina/realm/UserDatabaseRealm.java
+++ b/java/org/apache/catalina/realm/UserDatabaseRealm.java
@@ -132,6 +132,9 @@ public class UserDatabaseRealm extends RealmBase {
// ------------------------------------------------------ Protected Methods
+ /**
+ * Calls {@link UserDatabase#backgroundProcess()}.
+ */
@Override
public void backgroundProcess() {
UserDatabase database = getUserDatabase();
@@ -141,9 +144,6 @@ public class UserDatabaseRealm extends RealmBase {
}
- /**
- * Return the password associated with the given principal's user name.
- */
@Override
protected String getPassword(String username) {
UserDatabase database = getUserDatabase();
@@ -181,9 +181,6 @@ public class UserDatabaseRealm extends RealmBase {
}
- /**
- * Return the Principal associated with the given user name.
- */
@Override
protected Principal getPrincipal(String username) {
UserDatabase database = getUserDatabase();
@@ -252,12 +249,6 @@ public class UserDatabaseRealm extends RealmBase {
}
- /**
- * Gracefully terminate the active use of the public methods of this
component and implement the requirements of
- * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
- *
- * @exception LifecycleException if this component detects a fatal error
that needs to be reported
- */
@Override
protected void stopInternal() throws LifecycleException {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]