CVS: beepcore-java/tls/org/beepcore/beep/profile/tls/jsse TLSProfileJSSE.java,1.6,1.7

Huston Franklin <[email protected]> Sat, 05 Oct 2002 08:45:58 -0700
Newsgroups gmane.network.beep.beepcore.java.cvs
Message-ID <[email protected]>
Update of /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse
In directory usw-pr-cvs1:/tmp/cvs-serv15890/tls/org/beepcore/beep/profile/tls/jsse

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

Index: TLSProfileJSSE.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/tls/org/beepcore/beep/profile/tls/jsse/TLSProfileJSSE.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** TLSProfileJSSE.java	7 Sep 2002 15:13:12 -0000	1.6
--- TLSProfileJSSE.java	5 Oct 2002 15:45:56 -0000	1.7
***************
*** 42,45 ****
--- 42,48 ----
  import java.io.FileInputStream;
  
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
+ 
  
  /**
***************
*** 122,125 ****
--- 125,130 ----
      static SSLSocketFactory socketFactory = null;
  
+     private Log log = LogFactory.getLog(this.getClass());
+ 
      // listeners to update when an SSL handshake completes
      //      static List handshakeListeners = null;
***************
*** 140,144 ****
          public void handshakeCompleted(HandshakeCompletedEvent event)
          {
!             Log.logEntry(Log.SEV_DEBUG, "HandshakeCompleted");
              synchronized (handshakeListeners) {
                  Iterator i = TLSProfileJSSE.handshakeListeners.iterator();
--- 145,149 ----
          public void handshakeCompleted(HandshakeCompletedEvent event)
          {
!             log.debug("HandshakeCompleted");
              synchronized (handshakeListeners) {
                  Iterator i = TLSProfileJSSE.handshakeListeners.iterator();
***************
*** 196,202 ****
              socketFactory = (SSLSocketFactory) ctx.getSocketFactory();
          } catch (NoSuchAlgorithmException e) {
!             Log.logEntry(1, "JSSE TLS Profile", e.getMessage());
          } catch (KeyManagementException e) {
!             Log.logEntry(1, "JSSE TLS Profile", e.getMessage());
          }
  
--- 201,207 ----
              socketFactory = (SSLSocketFactory) ctx.getSocketFactory();
          } catch (NoSuchAlgorithmException e) {
!             log.error(e.getMessage());
          } catch (KeyManagementException e) {
!             log.error(e.getMessage());
          }
  
***************
*** 426,430 ****
              return this;
          } catch (Exception e) {
!             Log.logEntry(Log.SEV_ERROR, e);
  
              throw new BEEPException(e.getMessage());
--- 431,435 ----
              return this;
          } catch (Exception e) {
!             log.error(e);
  
              throw new BEEPException(e.getMessage());
***************
*** 529,533 ****
  
              // @todo should be more detailed
!             Log.logEntry(Log.SEV_ERROR, x.getMessage());
  
              throw new StartChannelException(450, x.getMessage());
--- 534,538 ----
  
              // @todo should be more detailed
!             log.error(x.getMessage());
  
              throw new StartChannelException(450, x.getMessage());
***************
*** 549,553 ****
      public void closeChannel(Channel channel) throws CloseChannelException
      {
!         Log.logEntry(Log.SEV_DEBUG, "Closing TLS channel.");
      }
  
--- 554,558 ----
      public void closeChannel(Channel channel) throws CloseChannelException
      {
!         log.debug("Closing TLS channel.");
      }
  
***************
*** 589,598 ****
          String data = ch.getStartData();
  
!         Log.logEntry(Log.SEV_DEBUG, "Got start data of " + data);
  
          // Consider the data (see if it's proceed)
          if ((data == null)
!                 || (!data.equals(PROCEED1) &&!data.equals(PROCEED2))) {
!             Log.logEntry(Log.SEV_ERROR, "Invalid reply: " + data);
              throw new BEEPException(ERR_EXPECTED_PROCEED);
          }
--- 594,606 ----
          String data = ch.getStartData();
  
!         if (log.isDebugEnabled()) {
!             log.debug("Got start data of " + data);
!         }
  
          // Consider the data (see if it's proceed)
          if ((data == null)
!                 || (!data.equals(PROCEED1) &&!data.equals(PROCEED2)))
!         {
!             log.error("Invalid reply: " + data);
              throw new BEEPException(ERR_EXPECTED_PROCEED);
          }
***************
*** 619,625 ****
              l.session = session;
  
!             Log.logEntry(Log.SEV_DEBUG, "Handshake starting");
              newSocket.startHandshake();
!             Log.logEntry(Log.SEV_DEBUG, "Handshake returned");
  
              synchronized (l) {
--- 627,633 ----
              l.session = session;
  
!             log.debug("Handshake starting");
              newSocket.startHandshake();
!             log.debug("Handshake returned");
  
              synchronized (l) {
***************
*** 632,644 ****
                  }
              }
!             Log.logEntry(Log.SEV_DEBUG, "Handshake done waiting");
          } catch (javax.net.ssl.SSLException e) {
!             Log.logEntry(Log.SEV_ERROR, e);
              throw new BEEPException(e.getMessage());
          } catch (java.io.IOException e) {
!             Log.logEntry(Log.SEV_ERROR, e);
              throw new BEEPException(ERR_TLS_SOCKET);
          } catch (InterruptedException e) {
!             Log.logEntry(Log.SEV_ERROR, e);
              throw new BEEPException(ERR_TLS_HANDSHAKE_WAIT);
          }
--- 640,652 ----
                  }
              }
!             log.debug("Handshake done waiting");
          } catch (javax.net.ssl.SSLException e) {
!             log.error(e);
              throw new BEEPException(e.getMessage());
          } catch (java.io.IOException e) {
!             log.error(e);
              throw new BEEPException(ERR_TLS_SOCKET);
          } catch (InterruptedException e) {
!             log.error(e);
              throw new BEEPException(ERR_TLS_HANDSHAKE_WAIT);
          }



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