directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r556195 - in /directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc: MonitorContext.java MonitorReply.java MonitorRequest.java
Date Sat, 14 Jul 2007 00:56:13 GMT
Author: erodriguez
Date: Fri Jul 13 17:56:12 2007
New Revision: 556195

URL: http://svn.apache.org/viewvc?view=rev&rev=556195
Log:
Modified Kerberos protocol logging monitors to use StringBuffer's to build logging messages,
mostly to improve formatting and legibility.

Modified:
    directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorContext.java
    directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorReply.java
    directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorRequest.java

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorContext.java?view=diff&rev=556195&r1=556194&r2=556195
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorContext.java
(original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorContext.java
Fri Jul 13 17:56:12 2007
@@ -44,9 +44,15 @@
 
         if ( log.isDebugEnabled() )
         {
-            log.debug( "Monitoring context:" + "\n\tconfig:                 " + kdcContext.getConfig()
-                + "\n\tstore:                  " + kdcContext.getStore() + "\n\trequest:
               "
-                + kdcContext.getRequest() + "\n\treply:                  " + kdcContext.getReply()
);
+            StringBuffer sb = new StringBuffer();
+
+            sb.append( "Monitoring context:" );
+            sb.append( "\n\t" + "config:                 " + kdcContext.getConfig() );
+            sb.append( "\n\t" + "store:                  " + kdcContext.getStore() );
+            sb.append( "\n\t" + "request:                " + kdcContext.getRequest() );
+            sb.append( "\n\t" + "reply:                  " + kdcContext.getReply() );
+
+            log.debug( sb.toString() );
         }
 
         next.execute( session, message );

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorReply.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorReply.java?view=diff&rev=556195&r1=556194&r2=556195
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorReply.java
(original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorReply.java
Fri Jul 13 17:56:12 2007
@@ -51,15 +51,23 @@
 
             if ( log.isDebugEnabled() )
             {
-                log.debug( "Responding to authentication request with reply:" + "\n\tclient
realm:          "
-                    + success.getClientRealm() + "\n\tserver realm:          " + success.getServerRealm()
-                    + "\n\tserverPrincipal:       " + success.getServerPrincipal() + "\n\tclientPrincipal:
      "
-                    + success.getClientPrincipal() + "\n\thostAddresses:         " + success.getClientAddresses()
-                    + "\n\tstart time:            " + success.getStartTime() + "\n\tend time:
             "
-                    + success.getEndTime() + "\n\tauth time:             " + success.getAuthTime()
-                    + "\n\trenew till time:       " + success.getRenewTill() + "\n\tmessageType:
          "
-                    + success.getMessageType() + "\n\tnonce:                 " + success.getNonce()
-                    + "\n\tprotocolVersionNumber: " + success.getProtocolVersionNumber()
);
+                StringBuffer sb = new StringBuffer();
+
+                sb.append( "Responding to authentication request with reply:" );
+                sb.append( "\n\t" + "client realm:          " + success.getClientRealm()
);
+                sb.append( "\n\t" + "server realm:          " + success.getServerRealm()
);
+                sb.append( "\n\t" + "serverPrincipal:       " + success.getServerPrincipal()
);
+                sb.append( "\n\t" + "clientPrincipal:       " + success.getClientPrincipal()
);
+                sb.append( "\n\t" + "hostAddresses:         " + success.getClientAddresses()
);
+                sb.append( "\n\t" + "start time:            " + success.getStartTime() );
+                sb.append( "\n\t" + "end time:              " + success.getEndTime() );
+                sb.append( "\n\t" + "auth time:             " + success.getAuthTime() );
+                sb.append( "\n\t" + "renew till time:       " + success.getRenewTill() );
+                sb.append( "\n\t" + "messageType:           " + success.getMessageType()
);
+                sb.append( "\n\t" + "nonce:                 " + success.getNonce() );
+                sb.append( "\n\t" + "protocolVersionNumber: " + success.getProtocolVersionNumber()
);
+
+                log.debug( sb.toString() );
             }
         }
         else
@@ -70,11 +78,17 @@
 
                 if ( log.isDebugEnabled() )
                 {
-                    log.debug( "Responding to authentication request with error:" + "\n\tserverPrincipal:
      "
-                        + error.getServerPrincipal() + "\n\tclientPrincipal:       " + error.getClientPrincipal()
-                        + "\n\tserver time:           " + error.getClientTime() + "\n\tclient
time:           "
-                        + error.getServerTime() + "\n\terror code:            " + error.getErrorCode()
-                        + "\n\texplanatory text:      " + error.getExplanatoryText() );
+                    StringBuffer sb = new StringBuffer();
+
+                    sb.append( "Responding to authentication request with error:" );
+                    sb.append( "\n\t" + "serverPrincipal:       " + error.getServerPrincipal()
);
+                    sb.append( "\n\t" + "clientPrincipal:       " + error.getClientPrincipal()
);
+                    sb.append( "\n\t" + "server time:           " + error.getClientTime()
);
+                    sb.append( "\n\t" + "client time:           " + error.getServerTime()
);
+                    sb.append( "\n\t" + "error code:            " + error.getErrorCode()
);
+                    sb.append( "\n\t" + "explanatory text:      " + error.getExplanatoryText()
);
+
+                    log.debug( sb.toString() );
                 }
             }
         }

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorRequest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorRequest.java?view=diff&rev=556195&r1=556194&r2=556195
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorRequest.java
(original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/MonitorRequest.java
Fri Jul 13 17:56:12 2007
@@ -48,15 +48,24 @@
 
         if ( log.isDebugEnabled() )
         {
-            log.debug( "Responding to authentication request:" + "\n\trealm:            
    " + request.getRealm()
-                + "\n\tserverPrincipal:       " + request.getServerPrincipal() + "\n\tclientPrincipal:
      "
-                + request.getClientPrincipal() + "\n\tclientAddress:         " + clientAddress
-                + "\n\thostAddresses:         " + request.getAddresses() + "\n\tencryptionType:
       "
-                + getEncryptionTypes( request ) + "\n\tfrom krb time:         " + request.getFrom()
-                + "\n\trealm krb time:        " + request.getRtime() + "\n\tkdcOptions: 
          "
-                + request.getKdcOptions() + "\n\tmessageType:           " + request.getMessageType()
-                + "\n\tnonce:                 " + request.getNonce() + "\n\tprotocolVersionNumber:
"
-                + request.getProtocolVersionNumber() + "\n\ttill:                  " + request.getTill()
);
+            StringBuffer sb = new StringBuffer();
+
+            sb.append( "Responding to authentication request:" );
+            sb.append( "\n\t" + "realm:                 " + request.getRealm() );
+            sb.append( "\n\t" + "serverPrincipal:       " + request.getServerPrincipal()
);
+            sb.append( "\n\t" + "clientPrincipal:       " + request.getClientPrincipal()
);
+            sb.append( "\n\t" + "clientAddress:         " + clientAddress );
+            sb.append( "\n\t" + "hostAddresses:         " + request.getAddresses() );
+            sb.append( "\n\t" + "encryptionType:        " + getEncryptionTypes( request )
);
+            sb.append( "\n\t" + "from krb time:         " + request.getFrom() );
+            sb.append( "\n\t" + "realm krb time:        " + request.getRtime() );
+            sb.append( "\n\t" + "kdcOptions:            " + request.getKdcOptions() );
+            sb.append( "\n\t" + "messageType:           " + request.getMessageType() );
+            sb.append( "\n\t" + "nonce:                 " + request.getNonce() );
+            sb.append( "\n\t" + "protocolVersionNumber: " + request.getProtocolVersionNumber()
);
+            sb.append( "\n\t" + "till:                  " + request.getTill() );
+
+            log.debug( sb.toString() );
         }
 
         next.execute( session, message );



Mime
View raw message