directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1044549 - in /directory/apacheds/trunk: kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/ kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/ kerberos-codec/src/main/java/or...
Date Sat, 11 Dec 2010 00:17:49 GMT
Author: elecharny
Date: Sat Dec 11 00:17:48 2010
New Revision: 1044549

URL: http://svn.apache.org/viewvc?rev=1044549&view=rev
Log:
o Rename a getOrdinal() method to getValue()
o Some added Javadoc

Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/ErrorType.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java
    directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java?rev=1044549&r1=1044548&r2=1044549&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java
Sat Dec 11 00:17:48 2010
@@ -51,7 +51,7 @@ public class StoreErrorCode extends Abst
     {
         KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
         
-        ErrorType errorCode = ErrorType.getTypeByOrdinal( value );
+        ErrorType errorCode = ErrorType.getTypeByValue( value );
         
         krbErrContainer.getKrbError().setErrorCode( errorCode );
     }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/ErrorType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/ErrorType.java?rev=1044549&r1=1044548&r2=1044549&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/ErrorType.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/exceptions/ErrorType.java
Sat Dec 11 00:17:48 2010
@@ -461,15 +461,15 @@ public final class ErrorType implements 
     /**
      * The value/code for the error type.
      */
-    private final int ordinal;
+    private final int value;
 
 
     /**
      * Private constructor prevents construction outside of this class.
      */
-    private ErrorType( int ordinal, String name )
+    private ErrorType(int value, String name)
     {
-        this.ordinal = ordinal;
+        this.value = value;
         this.name = name;
     }
 
@@ -501,25 +501,25 @@ public final class ErrorType implements 
      * type.
      *
      * @param that the object to compare this KerberosError to
-     * @return ordinal - ( ( KerberosError ) that ).ordinal;
+     * @return value - ( ( KerberosError ) that ).ordinal;
      */
     public int compareTo( ErrorType that )
     {
-        return ordinal - that.ordinal;
+        return value - that.value;
     }
 
 
     /**
-     * Gets the ordinal by its ordinal value.
+     * Gets the value by its value value.
      *
-     * @param ordinal the ordinal value of the ordinal
-     * @return the type corresponding to the ordinal value
+     * @param value the value value of the value
+     * @return the type corresponding to the value value
      */
-    public static ErrorType getTypeByOrdinal( int ordinal )
+    public static ErrorType getTypeByValue(int ordinal)
     {
         for ( int ii = 0; ii < values.length; ii++ )
         {
-            if ( values[ii].ordinal == ordinal )
+            if ( values[ii].value == ordinal )
             {
                 return values[ii];
             }
@@ -530,12 +530,12 @@ public final class ErrorType implements 
 
 
     /**
-     * Gets the ordinal value associated with this Kerberos error.
+     * Gets the value value associated with this Kerberos error.
      *
-     * @return the ordinal value associated with this Kerberos error
+     * @return the value value associated with this Kerberos error
      */
-    public int getOrdinal()
+    public int getValue()
     {
-        return ordinal;
+        return value;
     }
 }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java?rev=1044549&r1=1044548&r2=1044549&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KrbError.java
Sat Dec 11 00:17:48 2010
@@ -432,7 +432,7 @@ public class KrbError extends KerberosMe
         krbErrorSeqLength += 1 + TLV.getNbBytes( susecLength ) + susecLength;
 
         // The error-code
-        errorCodeLength = 1 + 1 + Value.getNbBytes( errorCode.getOrdinal() );
+        errorCodeLength = 1 + 1 + Value.getNbBytes( errorCode.getValue() );
         krbErrorSeqLength += 1 + TLV.getNbBytes( errorCodeLength ) + errorCodeLength;
 
         // The crealm, if any
@@ -583,7 +583,7 @@ public class KrbError extends KerberosMe
             // error-code tag and value
             buffer.put( ( byte ) KerberosConstants.KRB_ERROR_ERROR_CODE_TAG );
             buffer.put( TLV.getBytes( errorCodeLength ) );
-            Value.encode( buffer, errorCode.getOrdinal() );
+            Value.encode( buffer, errorCode.getValue() );
 
             // crealm tage and value, if any
             if ( cRealm != null)

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java?rev=1044549&r1=1044548&r2=1044549&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java
(original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java
Sat Dec 11 00:17:48 2010
@@ -54,10 +54,15 @@ import org.slf4j.LoggerFactory;
  */
 public class KerberosProtocolHandler implements IoHandler
 {
+    /** The logger for this class */
     private static final Logger log = LoggerFactory.getLogger( KerberosProtocolHandler.class
);
 
+    /** The KDC server instance */
     private KdcServer config;
+
+    /** The principal Name store */
     private PrincipalStore store;
+
     private static final String CONTEXT_KEY = "context";
     
 
@@ -224,12 +229,12 @@ public class KerberosProtocolHandler imp
 
         KerberosTime now = new KerberosTime();
 
-        krbError.setErrorCode( ErrorType.getTypeByOrdinal( exception.getErrorCode() ) );
+        krbError.setErrorCode( ErrorType.getTypeByValue( exception.getErrorCode() ) );
         krbError.setEText( exception.getLocalizedMessage() );
         krbError.setSName( new PrincipalName( principal ) );
         krbError.setRealm( principal.getRealm() );
         krbError.setSTime( now );
-        krbError.setSusec(  0 );
+        krbError.setSusec( 0 );
         krbError.setEData( exception.getExplanatoryData() );
 
         return krbError;



Mime
View raw message