CVS: beepcore-java/src/org/beepcore/beep/profile/sasl/otp/database UserDatabasePool.java,1.2,1.3

Huston Franklin <[email protected]> Sat, 05 Oct 2002 08:32:08 -0700
Newsgroups gmane.network.beep.beepcore.java.cvs
Message-ID <[email protected]>
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/database
In directory usw-pr-cvs1:/tmp/cvs-serv7819/src/org/beepcore/beep/profile/sasl/otp/database

Modified Files:
	UserDatabasePool.java 
Log Message:
changed to use commons-logging

Index: UserDatabasePool.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/otp/database/UserDatabasePool.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** UserDatabasePool.java	8 Nov 2001 05:51:35 -0000	1.2
--- UserDatabasePool.java	5 Oct 2002 15:32:06 -0000	1.3
***************
*** 24,30 ****
  import java.util.Properties;
  
  import org.beepcore.beep.core.TuningProfile;
  import org.beepcore.beep.profile.sasl.SASLException;
- import org.beepcore.beep.util.Log;
  
  
--- 24,32 ----
  import java.util.Properties;
  
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
+ 
  import org.beepcore.beep.core.TuningProfile;
  import org.beepcore.beep.profile.sasl.SASLException;
  
  
***************
*** 50,53 ****
--- 52,57 ----
  {
      // Data 
+     private Log log = LogFactory.getLog(this.getClass());
+ 
      private Hashtable userpool = new Hashtable(4);
  
***************
*** 92,103 ****
  
              try {
!                 Log.logEntry(Log.SEV_DEBUG,
!                              ("Loading otp property file " + username
!                               + OTP_SUFFIX));
                  p.load(new FileInputStream(username + OTP_SUFFIX));
              } catch (IOException x) {
!                 Log.logEntry(Log.SEV_ERROR,
!                              new String(UserDBNotFoundException.MSG
!                                         + username));
  
                  throw new UserDBNotFoundException(username);
--- 96,106 ----
  
              try {
!                 if (log.isDebugEnabled()) {
!                     log.debug("Loading otp property file " + username
!                               + OTP_SUFFIX);
!                 }
                  p.load(new FileInputStream(username + OTP_SUFFIX));
              } catch (IOException x) {
!                 log.error(UserDBNotFoundException.MSG + username);
  
                  throw new UserDBNotFoundException(username);
***************
*** 117,125 ****
              }
              userpool.put(username, ud);
!             Log.logEntry(Log.SEV_DEBUG, p.toString());
!             Log.logEntry(Log.SEV_DEBUG,
!                          ("Stored otp settings for " + username));
          }
-         Log.logEntry(Log.SEV_DEBUG, "Fetching User Database for " + username);
          return ud;
      }
--- 120,131 ----
              }
              userpool.put(username, ud);
!             if (log.isDebugEnabled()) {
!                 log.debug(p.toString());
!                 log.debug("Stored otp settings for " + username);
!             }
!         }
!         if (log.isDebugEnabled()) {
!             log.debug("Fetching User Database for " + username);
          }
          return ud;
      }
***************
*** 172,177 ****
              String authenticator = ud.getAuthenticator();
  
!             Log.logEntry(Log.SEV_DEBUG,
!                          "Updating User DB on for=>" + authenticator);
              p.setProperty(OTP_AUTHENTICATOR, authenticator);
              p.setProperty(OTP_LAST_HASH, ud.getLastHashAsString());
--- 178,184 ----
              String authenticator = ud.getAuthenticator();
  
!             if (log.isDebugEnabled()) {
!                 log.debug("Updating User DB on for=>" + authenticator);
!             }
              p.setProperty(OTP_AUTHENTICATOR, authenticator);
              p.setProperty(OTP_LAST_HASH, ud.getLastHashAsString());
***************
*** 183,187 ****
                      OTP_HEADER);
          } catch (IOException x) {
!             Log.logEntry(Log.SEV_ERROR, x);
  
              throw new SASLException(x.getMessage());
--- 190,194 ----
                      OTP_HEADER);
          } catch (IOException x) {
!             log.error(x);
  
              throw new SASLException(x.getMessage());
***************
*** 238,242 ****
              p.store(new FileOutputStream("IW_User2.otp"), OTP_HEADER);
          } catch (IOException x) {
!             Log.logEntry(Log.SEV_ERROR, x);
          }
      }
--- 245,249 ----
              p.store(new FileOutputStream("IW_User2.otp"), OTP_HEADER);
          } catch (IOException x) {
!             log.error(x);
          }
      }



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf