directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1039063 - in /directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos: codec/principalName/actions/StoreNameType.java codec/types/PrincipalNameType.java components/PrincipalName.java
Date Thu, 25 Nov 2010 14:35:00 GMT
Author: kayyagari
Date: Thu Nov 25 14:35:00 2010
New Revision: 1039063

URL: http://svn.apache.org/viewvc?rev=1039063&view=rev
Log:
o removed confusing types from PrincipalNameType
o renamed getTypeByOrdinal to getTypeByValue

Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/principalName/actions/StoreNameType.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PrincipalNameType.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PrincipalName.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/principalName/actions/StoreNameType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/principalName/actions/StoreNameType.java?rev=1039063&r1=1039062&r2=1039063&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/principalName/actions/StoreNameType.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/principalName/actions/StoreNameType.java
Thu Nov 25 14:35:00 2010
@@ -86,8 +86,8 @@ public class StoreNameType extends Gramm
         
         try
         {
-            int nameType = IntegerDecoder.parse( value, PrincipalNameType.FIRST_NAME_TYPE.getValue(),
PrincipalNameType.LAST_NAME_TYPE.getValue() );
-            principalNameType = PrincipalNameType.getTypeByOrdinal( nameType );
+            int nameType = IntegerDecoder.parse( value, PrincipalNameType.KRB_NT_UNKNOWN.getValue(),
PrincipalNameType.KRB_NT_ENTERPRISE.getValue() );
+            principalNameType = PrincipalNameType.getTypeByValue( nameType );
 
             principalName.setNameType( principalNameType );
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PrincipalNameType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PrincipalNameType.java?rev=1039063&r1=1039062&r2=1039063&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PrincipalNameType.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/PrincipalNameType.java
Thu Nov 25 14:35:00 2010
@@ -42,12 +42,6 @@ package org.apache.directory.shared.kerb
  */
 public enum PrincipalNameType
 {
-    /** The first possible ordinal value */
-    FIRST_NAME_TYPE( 0 ),
-    
-    /** The last possible ordinal value */
-    LAST_NAME_TYPE( 10 ),
-    
     /** Constant for the "Name type not known" principal name type. */
     KRB_NT_UNKNOWN( 0 ),
 
@@ -96,7 +90,7 @@ public enum PrincipalNameType
      * @param type
      * @return The principal name type.
      */
-    public static PrincipalNameType getTypeByOrdinal( int type )
+    public static PrincipalNameType getTypeByValue( int type )
     {
         switch ( type )
         {

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PrincipalName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PrincipalName.java?rev=1039063&r1=1039062&r2=1039063&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PrincipalName.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PrincipalName.java
Thu Nov 25 14:35:00 2010
@@ -167,7 +167,7 @@ public class PrincipalName extends Abstr
             nameString = KerberosUtils.EMPTY_PRINCIPAL_NAME;
         }
 
-        this.nameType = PrincipalNameType.getTypeByOrdinal( principal.getNameType() );
+        this.nameType = PrincipalNameType.getTypeByValue( principal.getNameType() );
     }
     
     /**
@@ -194,7 +194,7 @@ public class PrincipalName extends Abstr
     {
         this.nameString = KerberosUtils.getNames( nameString );
         
-        this.nameType = PrincipalNameType.getTypeByOrdinal( nameType );
+        this.nameType = PrincipalNameType.getTypeByValue( nameType );
     }
 
 
@@ -223,7 +223,7 @@ public class PrincipalName extends Abstr
      */
     public void setNameType( int nameType )
     {
-        this.nameType = PrincipalNameType.getTypeByOrdinal( nameType );
+        this.nameType = PrincipalNameType.getTypeByValue( nameType );
     }
 
     /**



Mime
View raw message