You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fs...@apache.org on 2016/03/05 21:43:55 UTC

svn commit: r1733760 [2/2] - in /tomcat/tc8.0.x/trunk: ./ java/org/apache/catalina/mbeans/ java/org/apache/catalina/realm/ java/org/apache/catalina/security/

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/MemoryRealm.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/MemoryRealm.java?rev=1733760&r1=1733759&r2=1733760&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/MemoryRealm.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/MemoryRealm.java Sat Mar  5 20:43:54 2016
@@ -77,7 +77,7 @@ public class MemoryRealm  extends RealmB
     // ------------------------------------------------------------- Properties
 
     /**
-     * Return the pathname of our XML file containing user definitions.
+     * @return the pathname of our XML file containing user definitions.
      */
     public String getPathname() {
 
@@ -109,6 +109,7 @@ public class MemoryRealm  extends RealmB
      * @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) {
@@ -176,7 +177,7 @@ public class MemoryRealm  extends RealmB
 
 
     /**
-     * Return a configured <code>Digester</code> to use for processing
+     * @return a configured <code>Digester</code> to use for processing
      * the XML input file, creating a new one if necessary.
      */
     protected synchronized Digester getDigester() {
@@ -199,7 +200,7 @@ public class MemoryRealm  extends RealmB
 
 
     /**
-     * Return a short name for this Realm implementation.
+     * @return a short name for this Realm implementation.
      */
     @Override
     protected String getName() {
@@ -210,7 +211,7 @@ public class MemoryRealm  extends RealmB
 
 
     /**
-     * Return the password associated with the given principal's user name.
+     * @return the password associated with the given principal's user name.
      */
     @Override
     protected String getPassword(String username) {
@@ -226,7 +227,7 @@ public class MemoryRealm  extends RealmB
 
 
     /**
-     * Return the Principal associated with the given user name.
+     * @return the Principal associated with the given user name.
      */
     @Override
     protected Principal getPrincipal(String username) {

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/RealmBase.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/RealmBase.java?rev=1733760&r1=1733759&r2=1733760&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/RealmBase.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/RealmBase.java Sat Mar  5 20:43:54 2016
@@ -443,6 +443,7 @@ public abstract class RealmBase extends
      * @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) {
@@ -1328,6 +1329,9 @@ public abstract class RealmBase extends
 
     /**
      * Return the digest associated with given principal's user name.
+     * @param username the user name
+     * @param realmName the realm name
+     * @return the digest for the specified user
      */
     protected String getDigest(String username, String realmName) {
         if (hasMessageDigest()) {
@@ -1351,20 +1355,24 @@ public abstract class RealmBase extends
 
 
     /**
-     * Return a short name for this Realm implementation, for use in
+     * @return a short name for this Realm implementation, for use in
      * log messages.
      */
     protected abstract String getName();
 
 
     /**
-     * Return the password associated with the given principal's user name.
+     * Get the password for the specified user.
+     * @param username The user name
+     * @return the password associated with the given principal's user name.
      */
     protected abstract String getPassword(String username);
 
 
     /**
-     * Return the Principal associated with the given certificate.
+     * Get the principal associated with the specified certificate.
+     * @param usercert The user certificate
+     * @return the Principal associated with the given certificate.
      */
     protected Principal getPrincipal(X509Certificate usercert) {
         String username = x509UsernameRetriever.getUsername(usercert);
@@ -1377,7 +1385,9 @@ public abstract class RealmBase extends
 
 
     /**
-     * Return the Principal associated with the given user name.
+     * Get the principal associated with the specified user.
+     * @param username The user name
+     * @return the Principal associated with the given user name.
      */
     protected abstract Principal getPrincipal(String username);
 
@@ -1398,6 +1408,7 @@ public abstract class RealmBase extends
      * with which this Realm is associated. If the server cannot be found (eg
      * because the container hierarchy is not complete), <code>null</code> is
      * returned.
+     * @return the Server associated with the realm
      */
     protected Server getServer() {
         Container c = container;

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/UserDatabaseRealm.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/UserDatabaseRealm.java?rev=1733760&r1=1733759&r2=1733760&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/UserDatabaseRealm.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/realm/UserDatabaseRealm.java Sat Mar  5 20:43:54 2016
@@ -75,7 +75,7 @@ public class UserDatabaseRealm
     // ------------------------------------------------------------- Properties
 
     /**
-     * Return the global JNDI name of the <code>UserDatabase</code> resource
+     * @return the global JNDI name of the <code>UserDatabase</code> resource
      * we will be using.
      */
     public String getResourceName() {

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/security/SecurityUtil.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/security/SecurityUtil.java?rev=1733760&r1=1733759&r2=1733760&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/security/SecurityUtil.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/security/SecurityUtil.java Sat Mar  5 20:43:54 2016
@@ -94,9 +94,10 @@ public final class SecurityUtil{
      * @param methodName the method to apply the security restriction
      * @param targetObject the <code>Servlet</code> on which the method will
      * be called.
+     * @throws Exception an execution error occurred
      */
     public static void doAsPrivilege(final String methodName,
-                                     final Servlet targetObject) throws java.lang.Exception{
+                                     final Servlet targetObject) throws Exception {
          doAsPrivilege(methodName, targetObject, null, null, null);
     }
 
@@ -112,12 +113,13 @@ public final class SecurityUtil{
      * <code>Method</code> object.
      * @param targetArguments <code>Object</code> array contains the runtime
      * parameters instance.
+     * @throws Exception an execution error occurred
      */
     public static void doAsPrivilege(final String methodName,
                                      final Servlet targetObject,
                                      final Class<?>[] targetType,
                                      final Object[] targetArguments)
-        throws java.lang.Exception{
+        throws Exception {
 
          doAsPrivilege(methodName,
                        targetObject,
@@ -133,20 +135,21 @@ public final class SecurityUtil{
      *
      * @param methodName the method to apply the security restriction
      * @param targetObject the <code>Servlet</code> on which the method will
-     * be called.
+     *  be called.
      * @param targetParameterTypes <code>Class</code> array used to instantiate a
-     * <code>Method</code> object.
+     *  <code>Method</code> object.
      * @param targetArguments <code>Object</code> array contains the
-     * runtime parameters instance.
+     *  runtime parameters instance.
      * @param principal the <code>Principal</code> to which the security
-     * privilege apply..
+     *  privilege applies
+     * @throws Exception an execution error occurred
      */
     public static void doAsPrivilege(final String methodName,
                                      final Servlet targetObject,
                                      final Class<?>[] targetParameterTypes,
                                      final Object[] targetArguments,
                                      Principal principal)
-        throws java.lang.Exception{
+        throws Exception {
 
         // CometProcessor instances must not be cached as Servlet or
         // NoSuchMethodException will be thrown.
@@ -180,11 +183,12 @@ public final class SecurityUtil{
      *
      * @param methodName the method to apply the security restriction
      * @param targetObject the <code>Filter</code> on which the method will
-     * be called.
+     *  be called.
+     * @throws Exception an execution error occurred
      */
     public static void doAsPrivilege(final String methodName,
                                      final Filter targetObject)
-        throws java.lang.Exception{
+        throws Exception {
 
          doAsPrivilege(methodName, targetObject, null, null);
     }
@@ -196,17 +200,18 @@ public final class SecurityUtil{
      *
      * @param methodName the method to apply the security restriction
      * @param targetObject the <code>Filter</code> on which the method will
-     * be called.
+     *  be called.
      * @param targetType <code>Class</code> array used to instantiate a
-     * <code>Method</code> object.
+     *  <code>Method</code> object.
      * @param targetArguments <code>Object</code> array contains the
-     * runtime parameters instance.
+     *  runtime parameters instance.
+     * @throws Exception an execution error occurred
      */
     public static void doAsPrivilege(final String methodName,
                                      final Filter targetObject,
                                      final Class<?>[] targetType,
                                      final Object[] targetArguments)
-        throws java.lang.Exception{
+        throws Exception {
 
         doAsPrivilege(
                 methodName, targetObject, targetType, targetArguments, null);
@@ -218,20 +223,21 @@ public final class SecurityUtil{
      *
      * @param methodName the method to apply the security restriction
      * @param targetObject the <code>Filter</code> on which the method will
-     * be called.
+     *  be called.
      * @param targetParameterTypes <code>Class</code> array used to instantiate a
-     * <code>Method</code> object.
+     *  <code>Method</code> object.
      * @param targetParameterValues <code>Object</code> array contains the
-     * runtime parameters instance.
+     *  runtime parameters instance.
      * @param principal the <code>Principal</code> to which the security
-     * privilege apply
+     *  privilege applies
+     * @throws Exception an execution error occurred
      */
     public static void doAsPrivilege(final String methodName,
                                      final Filter targetObject,
                                      final Class<?>[] targetParameterTypes,
                                      final Object[] targetParameterValues,
                                      Principal principal)
-        throws java.lang.Exception{
+        throws Exception {
 
         // CometFilter instances must not be cached as Filter or
         // NoSuchMethodException will be thrown.
@@ -265,17 +271,18 @@ public final class SecurityUtil{
      *
      * @param method the method to apply the security restriction
      * @param targetObject the <code>Servlet</code> on which the method will
-     * be called.
+     *  be called.
      * @param targetArguments <code>Object</code> array contains the
-     * runtime parameters instance.
+     *  runtime parameters instance.
      * @param principal the <code>Principal</code> to which the security
-     * privilege applies
+     *  privilege applies
+     * @throws Exception an execution error occurred
      */
     private static void execute(final Method method,
                                 final Object targetObject,
                                 final Object[] targetArguments,
                                 Principal principal)
-        throws java.lang.Exception{
+        throws Exception {
 
         try{
             Subject subject = null;
@@ -374,8 +381,9 @@ public final class SecurityUtil{
      * @param targetType the class on which the method will be called.
      * @param methodName the method to apply the security restriction
      * @param parameterTypes <code>Class</code> array used to instantiate a
-     * <code>Method</code> object.
+     *  <code>Method</code> object.
      * @return the method instance.
+     * @throws Exception an execution error occurred
      */
     private static Method createMethodAndCacheIt(Method[] methodsCache,
                                                  Class<?> targetType,
@@ -422,6 +430,7 @@ public final class SecurityUtil{
     /**
      * Return the <code>SecurityManager</code> only if Security is enabled AND
      * package protection mechanism is enabled.
+     * @return <code>true</code> if package level protection is enabled
      */
     public static boolean isPackageProtectionEnabled(){
         if (packageDefinitionEnabled && Globals.IS_SECURITY_ENABLED){



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org