directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r542350 - /directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/exceptions/KerberosException.java
Date Mon, 28 May 2007 22:24:17 GMT
Author: erodriguez
Date: Mon May 28 15:24:16 2007
New Revision: 542350

URL: http://svn.apache.org/viewvc?view=rev&rev=542350
Log:
Clean-up of KerberosException to better support nested exceptions.

Modified:
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/exceptions/KerberosException.java

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/exceptions/KerberosException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/exceptions/KerberosException.java?view=diff&rev=542350&r1=542349&r2=542350
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/exceptions/KerberosException.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/exceptions/KerberosException.java
Mon May 28 15:24:16 2007
@@ -31,7 +31,7 @@
     private static final long serialVersionUID = 2968072183596955597L;
 
     /**
-     * The Kerberos error code associated with this exception
+     * The Kerberos error code associated with this exception.
      */
     private final int errorCode;
 
@@ -42,94 +42,91 @@
     private byte[] explanatoryData;
 
 
-    // ------------------------------------------------------------------------
-    // C O N S T R U C T O R S
-    // ------------------------------------------------------------------------
-
     /**
-     * Creates a KerberosException with an error code and a message.
+     * Creates a KerberosException with an {@link ErrorType}.
      *
-     * @param errorCode the error code associated with this KerberosException
-     * @param msg the standard Kerberos error message for this KerberosException
+     * @param errorType The error type associated with this KerberosException.
      */
-    public KerberosException(int errorCode, String msg)
+    public KerberosException( ErrorType errorType )
     {
-        super( msg );
+        super( errorType.getMessage() );
 
-        this.errorCode = errorCode;
+        this.errorCode = errorType.getOrdinal();
     }
 
 
     /**
-     * Creates a KerberosException with an error code, a message and an
-     * underlying throwable that caused this fault.
+     * Creates a KerberosException with an {@link ErrorType} and an
+     * underlying {@link Throwable} that caused this fault.
      *
-     * @param errorCode the error code associated with this KerberosException
-     * @param msg the standard Kerberos error message for this KerberosException
-     * @param cause the underlying failure, if any
+     * @param errorType The error type associated with this KerberosException.
+     * @param cause The underlying failure, if any.
      */
-    public KerberosException(int errorCode, String msg, Throwable cause)
+    public KerberosException( ErrorType errorType, Throwable cause )
     {
-        super( msg, cause );
+        super( errorType.getMessage(), cause );
 
-        this.errorCode = errorCode;
+        this.errorCode = errorType.getOrdinal();
     }
 
 
     /**
-     * Creates a KerberosException with an error code, a message, and data
-     * helping to explain what caused this fault.
+     * Creates a KerberosException with an {@link ErrorType} and a custom error message.
      *
-     * @param errorCode the error code associated with this KerberosException
-     * @param msg the standard Kerberos error message for this KerberosException
-     * @param explanatoryData data helping to explain this fault, if any
+     * @param errorType The {@link ErrorType} associated with this KerberosException.
+     * @param msg A custom error message for this KerberosException.
      */
-    public KerberosException(int errorCode, String msg, byte[] explanatoryData)
+    public KerberosException( ErrorType errorType, String msg )
     {
         super( msg );
 
-        this.errorCode = errorCode;
-        this.explanatoryData = explanatoryData;
+        this.errorCode = errorType.getOrdinal();
     }
 
 
     /**
-     * Creates a KerberosException with an error type.
+     * Creates a KerberosException with an {@link ErrorType}, a custom error message, and
an
+     * underlying {@link Throwable} that caused this fault.
      *
-     * @param errorType the error type associated with this KerberosException
+     * @param errorType The error type associated with this KerberosException.
+     * @param msg A custom error message for this KerberosException.
+     * @param cause The underlying failure, if any.
      */
-    public KerberosException(ErrorType errorType)
+    public KerberosException( ErrorType errorType, String msg, Throwable cause )
     {
-        super( errorType.getMessage() );
+        super( msg, cause );
 
         this.errorCode = errorType.getOrdinal();
     }
 
 
     /**
-     * Creates a KerberosException with an error type and a custom error message.
+     * Creates a KerberosException with an {@link ErrorType} and data helping to
+     * explain what caused this fault.
      *
-     * @param errorType the error type associated with this KerberosException
-     * @param msg a custom error message for this KerberosException
+     * @param errorType The error type associated with this KerberosException.
+     * @param explanatoryData Data helping to explain this fault, if any.
      */
-    public KerberosException(ErrorType errorType, String msg)
+    public KerberosException( ErrorType errorType, byte[] explanatoryData )
     {
-        super( msg );
+        super( errorType.getMessage() );
 
         this.errorCode = errorType.getOrdinal();
+        this.explanatoryData = explanatoryData;
     }
 
 
     /**
-     * Creates a KerberosException with an error type and data helping to
-     * explain what caused this fault.
+     * Creates a KerberosException with an {@link ErrorType}, data helping to
+     * explain what caused this fault, and an underlying {@link Throwable} that caused this
fault.
      *
-     * @param errorType the error type associated with this KerberosException
-     * @param explanatoryData data helping to explain this fault, if any
+     * @param errorType The error type associated with this KerberosException.
+     * @param explanatoryData Data helping to explain this fault, if any.
+     * @param cause The underlying failure, if any.
      */
-    public KerberosException(ErrorType errorType, byte[] explanatoryData)
+    public KerberosException( ErrorType errorType, byte[] explanatoryData, Throwable cause
)
     {
-        super( errorType.getMessage() );
+        super( errorType.getMessage(), cause );
 
         this.errorCode = errorType.getOrdinal();
         this.explanatoryData = explanatoryData;
@@ -139,7 +136,7 @@
     /**
      * Gets the protocol error code associated with this KerberosException.
      *
-     * @return the error code associated with this KerberosException
+     * @return The error code associated with this KerberosException.
      */
     public int getErrorCode()
     {
@@ -150,10 +147,75 @@
     /**
      * Gets the explanatory data associated with this KerberosException.
      *
-     * @return the explanatory data associated with this KerberosException
+     * @return The explanatory data associated with this KerberosException.
      */
     public byte[] getExplanatoryData()
     {
         return explanatoryData;
+    }
+
+
+    /**
+     * Creates a KerberosException with an error code and a message.
+     *
+     * @param errorCode The error code associated with this KerberosException.
+     * @param msg The standard Kerberos error message for this KerberosException.
+     */
+    protected KerberosException( int errorCode, String msg )
+    {
+        super( msg );
+
+        this.errorCode = errorCode;
+    }
+
+
+    /**
+     * Creates a KerberosException with an error code, a message and an
+     * underlying {@link Throwable} that caused this fault.
+     *
+     * @param errorCode The error code associated with this KerberosException.
+     * @param msg The standard Kerberos error message for this KerberosException.
+     * @param cause The underlying failure, if any.
+     */
+    protected KerberosException( int errorCode, String msg, Throwable cause )
+    {
+        super( msg, cause );
+
+        this.errorCode = errorCode;
+    }
+
+
+    /**
+     * Creates a KerberosException with an error code, a message, and data
+     * helping to explain what caused this fault.
+     *
+     * @param errorCode The error code associated with this KerberosException.
+     * @param msg The standard Kerberos error message for this KerberosException.
+     * @param explanatoryData Data helping to explain this fault, if any.
+     */
+    protected KerberosException( int errorCode, String msg, byte[] explanatoryData )
+    {
+        super( msg );
+
+        this.errorCode = errorCode;
+        this.explanatoryData = explanatoryData;
+    }
+
+
+    /**
+     * Creates a KerberosException with an error code, a message, and data
+     * helping to explain what caused this fault.
+     *
+     * @param errorCode The error code associated with this KerberosException.
+     * @param msg The standard Kerberos error message for this KerberosException.
+     * @param explanatoryData Data helping to explain this fault, if any.
+     * @param cause The underlying failure, if any.
+     */
+    protected KerberosException( int errorCode, String msg, byte[] explanatoryData, Throwable
cause )
+    {
+        super( msg, cause );
+
+        this.errorCode = errorCode;
+        this.explanatoryData = explanatoryData;
     }
 }



Mime
View raw message