directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r553086 - in /directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos: GetServiceTicket.java GetTicketGrantingTicket.java KdcConnectionException.java
Date Wed, 04 Jul 2007 05:46:59 GMT
Author: erodriguez
Date: Tue Jul  3 22:46:58 2007
New Revision: 553086

URL: http://svn.apache.org/viewvc?view=rev&rev=553086
Log:
Added support for error codes to the client-side Kerberos exception.

Modified:
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetServiceTicket.java
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetTicketGrantingTicket.java
    directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/KdcConnectionException.java

Modified: directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetServiceTicket.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetServiceTicket.java?view=diff&rev=553086&r1=553085&r2=553086
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetServiceTicket.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetServiceTicket.java
Tue Jul  3 22:46:58 2007
@@ -174,7 +174,7 @@
         int errorCode = error.getErrorCode();
         String errorText = error.getExplanatoryText();
 
-        throw new KdcConnectionException( errorText + " (" + errorCode + ")" );
+        throw new KdcConnectionException( errorText, errorCode );
     }
 
 
@@ -254,15 +254,6 @@
 
         RequestBodyModifier modifier = new RequestBodyModifier();
 
-        /*
-         Forwardable Ticket false
-         Forwarded Ticket false
-         Proxiable Ticket false
-         Proxy Ticket false
-         Postdated Ticket false
-         Renewable Ticket false
-         Initial Ticket false
-         */
         KdcOptions kdcOptions = new KdcOptions();
 
         /*

Modified: directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetTicketGrantingTicket.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetTicketGrantingTicket.java?view=diff&rev=553086&r1=553085&r2=553086
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetTicketGrantingTicket.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/GetTicketGrantingTicket.java
Tue Jul  3 22:46:58 2007
@@ -164,7 +164,7 @@
         int errorCode = error.getErrorCode();
         String errorText = error.getExplanatoryText();
 
-        throw new KdcConnectionException( errorText + " (" + errorCode + ")" );
+        throw new KdcConnectionException( errorText, errorCode );
     }
 
 
@@ -241,15 +241,6 @@
         KerberosKey kerberosKey = new KerberosKey( clientPrincipal, password.toCharArray(),
"DES" );
         clientKey = new EncryptionKey( EncryptionType.DES_CBC_MD5, kerberosKey.getEncoded()
);
 
-        /*
-         Forwardable Ticket false
-         Forwarded Ticket false
-         Proxiable Ticket false
-         Proxy Ticket false
-         Postdated Ticket false
-         Renewable Ticket false
-         Initial Ticket false
-         */
         KdcOptions kdcOptions = new KdcOptions();
 
         PreAuthenticationData[] paData = new PreAuthenticationData[1];

Modified: directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/KdcConnectionException.java
URL: http://svn.apache.org/viewvc/directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/KdcConnectionException.java?view=diff&rev=553086&r1=553085&r2=553086
==============================================================================
--- directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/KdcConnectionException.java
(original)
+++ directory/clients/trunk/kerberos/client/src/main/java/org/apache/directory/client/kerberos/KdcConnectionException.java
Tue Jul  3 22:46:58 2007
@@ -34,6 +34,11 @@
      */
     private static final long serialVersionUID = -3882166764471452526L;
 
+    /**
+     * The Kerberos error code associated with this exception.
+     */
+    private int errorCode = 0;
+
 
     /**
      * @param message
@@ -45,6 +50,17 @@
 
 
     /**
+     * @param message
+     * @param errorCode
+     */
+    public KdcConnectionException( String message, int errorCode )
+    {
+        super( message );
+        this.errorCode = errorCode;
+    }
+
+
+    /**
      * @param cause
      */
     public KdcConnectionException( Throwable cause )
@@ -60,5 +76,22 @@
     public KdcConnectionException( String message, Throwable cause )
     {
         super( message, cause );
+    }
+
+
+    /**
+     * Gets the protocol error code associated with this {@link KdcConnectionException}.
+     *
+     * @return The error code associated with this {@link KdcConnectionException}.
+     */
+    public int getErrorCode()
+    {
+        return this.errorCode;
+    }
+
+
+    public String getMessage()
+    {
+        return super.getMessage() + " (" + errorCode + ")";
     }
 }



Mime
View raw message