You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2003/03/12 07:50:12 UTC

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm MemoryRealm.java

costin      2003/03/11 22:50:12

  Modified:    catalina/src/share/org/apache/catalina/realm
                        MemoryRealm.java
  Log:
  Switch to commons-logging.
  
  Not final.
  
  Revision  Changes    Path
  1.2       +15 -19    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/MemoryRealm.java
  
  Index: MemoryRealm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/MemoryRealm.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MemoryRealm.java	18 Jul 2002 16:47:55 -0000	1.1
  +++ MemoryRealm.java	12 Mar 2003 06:50:12 -0000	1.2
  @@ -70,15 +70,11 @@
   import java.util.ArrayList;
   import java.util.HashMap;
   import org.apache.catalina.Container;
  -import org.apache.catalina.Lifecycle;
  -import org.apache.catalina.LifecycleEvent;
   import org.apache.catalina.LifecycleException;
  -import org.apache.catalina.LifecycleListener;
  -import org.apache.catalina.Logger;
  -import org.apache.catalina.Realm;
  -import org.apache.catalina.util.LifecycleSupport;
   import org.apache.catalina.util.StringManager;
   import org.apache.commons.digester.Digester;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   
   
   /**
  @@ -95,9 +91,9 @@
    * @version $Revision$ $Date$
    */
   
  -public final class MemoryRealm
  -    extends RealmBase {
  +public class MemoryRealm  extends RealmBase {
   
  +    private static Log log = LogFactory.getLog(MemoryRealm.class);
   
       // ----------------------------------------------------- Instance Variables
   
  @@ -215,18 +211,18 @@
                   validated = (digest(credentials)
                                .equalsIgnoreCase(principal.getPassword()));
               } else {
  -                validated = 
  +                validated =
                       (digest(credentials).equals(principal.getPassword()));
               }
           }
   
           if (validated) {
  -            if (debug >= 2)
  -                log(sm.getString("memoryRealm.authenticateSuccess", username));
  +            if (log.isDebugEnabled())
  +                log.debug(sm.getString("memoryRealm.authenticateSuccess", username));
               return (principal);
           } else {
  -            if (debug >= 2)
  -                log(sm.getString("memoryRealm.authenticateFailure", username));
  +            if (log.isDebugEnabled())
  +                log.debug(sm.getString("memoryRealm.authenticateFailure", username));
               return (null);
           }
   
  @@ -342,8 +338,8 @@
                                 file.getAbsolutePath()));
   
           // Load the contents of the database file
  -        if (debug >= 1)
  -            log(sm.getString("memoryRealm.loadPath",
  +        if (log.isDebugEnabled())
  +            log.debug(sm.getString("memoryRealm.loadPath",
                                file.getAbsolutePath()));
           Digester digester = getDigester();
           try {
  
  
  

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