directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r557171 - in /directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc: MonitorContext.java MonitorReply.java MonitorRequest.java
Date Wed, 18 Jul 2007 06:33:03 GMT
Author: erodriguez
Date: Tue Jul 17 23:33:01 2007
New Revision: 557171

URL: http://svn.apache.org/viewvc?view=rev&rev=557171
Log:
Improved exception tolerance in protocol-kerberos monitors.

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=557171&r1=557170&r2=557171
==============================================================================
--- 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
Tue Jul 17 23:33:01 2007
@@ -44,15 +44,23 @@
 
         if ( log.isDebugEnabled() )
         {
-            StringBuffer sb = new StringBuffer();
+            try
+            {
+                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() );
+                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() );
+                log.debug( sb.toString() );
+            }
+            catch ( Exception e )
+            {
+                // This is a monitor.  No exceptions should bubble up.
+                log.error( "Error in context monitor", e );
+            }
         }
 
         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=557171&r1=557170&r2=557171
==============================================================================
--- 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
Tue Jul 17 23:33:01 2007
@@ -51,23 +51,31 @@
 
             if ( log.isDebugEnabled() )
             {
-                StringBuffer sb = new StringBuffer();
+                try
+                {
+                    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()
);
+                    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() );
+                    log.debug( sb.toString() );
+                }
+                catch ( Exception e )
+                {
+                    // This is a monitor.  No exceptions should bubble up.
+                    log.error( "Error in reply monitor", e );
+                }
             }
         }
         else
@@ -78,17 +86,25 @@
 
                 if ( log.isDebugEnabled() )
                 {
-                    StringBuffer sb = new StringBuffer();
+                    try
+                    {
+                        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()
);
+                        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() );
+                        log.debug( sb.toString() );
+                    }
+                    catch ( Exception e )
+                    {
+                        // This is a monitor.  No exceptions should bubble up.
+                        log.error( "Error in reply monitor", e );
+                    }
                 }
             }
         }

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=557171&r1=557170&r2=557171
==============================================================================
--- 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
Tue Jul 17 23:33:01 2007
@@ -48,24 +48,32 @@
 
         if ( log.isDebugEnabled() )
         {
-            StringBuffer sb = new StringBuffer();
+            try
+            {
+                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() );
+                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() );
+                log.debug( sb.toString() );
+            }
+            catch ( Exception e )
+            {
+                // This is a monitor.  No exceptions should bubble up.
+                log.error( "Error in request monitor", e );
+            }
         }
 
         next.execute( session, message );



Mime
View raw message