You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by er...@apache.org on 2007/05/17 07:47:32 UTC

svn commit: r538808 - in /directory/apacheds/branches/kerberos-encryption-types: kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/ kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/ ...

Author: erodriguez
Date: Wed May 16 22:47:31 2007
New Revision: 538808

URL: http://svn.apache.org/viewvc?view=rev&rev=538808
Log:
Javadocs and minor warning clean-up.

Modified:
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/ApOptions.java
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationData.java
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataEntry.java
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationType.java
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
    directory/apacheds/branches/kerberos-encryption-types/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/value/OptionsTest.java

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/ApOptions.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/ApOptions.java?view=diff&rev=538808&r1=538807&r2=538808
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/ApOptions.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/ApOptions.java Wed May 16 22:47:31 2007
@@ -26,19 +26,29 @@
  */
 public class ApOptions extends Options
 {
-    // AP Request option - reserved
+    /**
+     * AP Request option - reserved
+     */
     public static final int RESERVED = 0;
-    // AP Request option - use session key
+
+    /**
+     * AP Request option - use session key
+     */
     public static final int USE_SESSION_KEY = 1;
-    // AP Request option - mutual authentication required
+
+    /**
+     * AP Request option - mutual authentication required
+     */
     public static final int MUTUAL_REQUIRED = 2;
 
-    // AP Request option - maximum value
+    /**
+     * AP Request option - maximum value
+     */
     public static final int MAX_VALUE = 32;
 
 
     /**
-     * Class constructors
+     * Creates a new instance of ApOptions.
      */
     public ApOptions()
     {
@@ -46,7 +56,12 @@
     }
 
 
-    public ApOptions(byte[] options)
+    /**
+     * Creates a new instance of ApOptions.
+     *
+     * @param options
+     */
+    public ApOptions( byte[] options )
     {
         super( MAX_VALUE );
         setBytes( options );
@@ -54,7 +69,7 @@
 
 
     /**
-     * Converts the object to a printable string
+     * Converts the object to a printable string.
      */
     public String toString()
     {

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationData.java?view=diff&rev=538808&r1=538807&r2=538808
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationData.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationData.java Wed May 16 22:47:31 2007
@@ -33,11 +33,11 @@
  */
 public class AuthorizationData implements Encodable
 {
-    private List entries = new ArrayList();
+    private List<AuthorizationDataEntry> entries = new ArrayList<AuthorizationDataEntry>();
 
 
     /**
-     * Class constructor
+     * Creates a new instance of AuthorizationData.
      */
     public AuthorizationData()
     {
@@ -45,18 +45,33 @@
     }
 
 
+    /**
+     * Adds all {@link AuthorizationData} entries to this {@link AuthorizationData}.
+     *
+     * @param data
+     */
     public void add( AuthorizationData data )
     {
         entries.addAll( data.entries );
     }
 
 
+    /**
+     * Adds an {@link AuthorizationDataEntry} to this {@link AuthorizationData}.
+     *
+     * @param entry
+     */
     public void add( AuthorizationDataEntry entry )
     {
         entries.add( entry );
     }
 
 
+    /**
+     * Returns an {@link Iterator} over the entries in this {@link AuthorizationData}.
+     *
+     * @return An {@link Iterator} over the entries in this {@link AuthorizationData}.
+     */
     public Iterator iterator()
     {
         return entries.iterator();

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataEntry.java?view=diff&rev=538808&r1=538807&r2=538808
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataEntry.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataEntry.java Wed May 16 22:47:31 2007
@@ -31,21 +31,34 @@
 
 
     /**
-     * Class constructor
+     * Creates a new instance of AuthorizationDataEntry.
+     *
+     * @param adType
+     * @param adData
      */
-    public AuthorizationDataEntry(AuthorizationType adType, byte[] adData)
+    public AuthorizationDataEntry( AuthorizationType adType, byte[] adData )
     {
         authorizationDataType = adType;
         authorizationData = adData;
     }
 
 
+    /**
+     * Returns the raw bytes of the authorization data.
+     *
+     * @return The raw bytes of the authorization data.
+     */
     public byte[] getAuthorizationData()
     {
         return authorizationData;
     }
 
 
+    /**
+     * Returns the {@link AuthorizationType}.
+     *
+     * @return The {@link AuthorizationType}.
+     */
     public AuthorizationType getAuthorizationDataType()
     {
         return authorizationDataType;

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationType.java?view=diff&rev=538808&r1=538807&r2=538808
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationType.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationType.java Wed May 16 22:47:31 2007
@@ -32,35 +32,96 @@
 public final class AuthorizationType implements Comparable
 {
     /**
-     * Enumeration elements are constructed once upon class loading.
-     * Order of appearance here determines the order of compareTo.
+     * Constant for the "null" authorization type.
      */
     public static final AuthorizationType NULL = new AuthorizationType( 0, "null" );
+
+    /**
+     * Constant for the "if relevant" authorization type.
+     */
     public static final AuthorizationType IF_RELEVANT = new AuthorizationType( 1, "if relevant" );
+
+    /**
+     * Constant for the "intended for server" authorization type.
+     */
     public static final AuthorizationType INTENDED_FOR_SERVER = new AuthorizationType( 2, "intended for server" );
+
+    /**
+     * Constant for the  "intended for application class" authorization type.
+     */
     public static final AuthorizationType INTENDED_FOR_APPLICATION_CLASS = new AuthorizationType( 3,
         "intended for application class" );
+
+    /**
+     * Constant for the "kdc issued" authorization type.
+     */
     public static final AuthorizationType KDC_ISSUED = new AuthorizationType( 4, "kdc issued" );
+
+    /**
+     * Constant for the "or" authorization type.
+     */
     public static final AuthorizationType OR = new AuthorizationType( 5, "or" );
+
+    /**
+     * Constant for the "mandatory ticket extensions" authorization type.
+     */
     public static final AuthorizationType MANDATORY_TICKET_EXTENSIONS = new AuthorizationType( 6,
         "mandatory ticket extensions" );
+
+    /**
+     * Constant for the "in ticket extensions" authorization type.
+     */
     public static final AuthorizationType IN_TICKET_EXTENSIONS = new AuthorizationType( 7, "in ticket extensions" );
+
+    /**
+     * Constant for the "OSF DCE" authorization type.
+     */
     public static final AuthorizationType OSF_DCE = new AuthorizationType( 64, "OSF DCE" );
+
+    /**
+     * Constant for the "sesame" authorization type.
+     */
     public static final AuthorizationType SESAME = new AuthorizationType( 65, "sesame" );
 
+    /**
+     * Array for building a List of VALUES.
+     */
+    private static final AuthorizationType[] values =
+        { NULL, IF_RELEVANT, INTENDED_FOR_SERVER, INTENDED_FOR_APPLICATION_CLASS, KDC_ISSUED, OR,
+            MANDATORY_TICKET_EXTENSIONS, IN_TICKET_EXTENSIONS, OSF_DCE, SESAME };
 
-    public String toString()
-    {
-        return name + " (" + ordinal + ")";
-    }
+    /**
+     * A List of all the authorization type constants.
+     */
+    public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
 
+    /**
+     * The name of the authorization type.
+     */
+    private final String name;
 
-    public int compareTo( Object that )
+    /**
+     * The value/code for the authorization type.
+     */
+    private final int ordinal;
+
+
+    /**
+     * Private constructor prevents construction outside of this class.
+     */
+    private AuthorizationType( int ordinal, String name )
     {
-        return ordinal - ( ( AuthorizationType ) that ).ordinal;
+        this.ordinal = ordinal;
+        this.name = name;
     }
 
 
+    /**
+     * Returns the authorization type when specified by its ordinal.
+     *
+     * @param type
+     * @return The authorization type.
+     */
     public static AuthorizationType getTypeByOrdinal( int type )
     {
         for ( int ii = 0; ii < values.length; ii++ )
@@ -73,31 +134,25 @@
     }
 
 
+    /**
+     * Returns the number associated with this authorization type.
+     *
+     * @return The authorization type ordinal.
+     */
     public int getOrdinal()
     {
         return ordinal;
     }
 
-    /// PRIVATE /////
-    private final String name;
-    private final int ordinal;
 
-
-    /**
-     * Private constructor prevents construction outside of this class.
-     */
-    private AuthorizationType(int ordinal, String name)
+    public int compareTo( Object that )
     {
-        this.ordinal = ordinal;
-        this.name = name;
+        return ordinal - ( ( AuthorizationType ) that ).ordinal;
     }
 
-    /**
-     * These two lines are all that's necessary to export a List of VALUES.
-     */
-    private static final AuthorizationType[] values =
-        { NULL, IF_RELEVANT, INTENDED_FOR_SERVER, INTENDED_FOR_APPLICATION_CLASS, KDC_ISSUED, OR,
-            MANDATORY_TICKET_EXTENSIONS, IN_TICKET_EXTENSIONS, OSF_DCE, SESAME };
-    // VALUES needs to be located here, otherwise illegal forward reference
-    public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
+
+    public String toString()
+    {
+        return name + " (" + ordinal + ")";
+    }
 }

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java?view=diff&rev=538808&r1=538807&r2=538808
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java Wed May 16 22:47:31 2007
@@ -69,6 +69,11 @@
     private Map<EncryptionType, EncryptionKey> keyMap;
 
 
+    /**
+     * Returns the {@link PrincipalStoreEntry}.
+     *
+     * @return The {@link PrincipalStoreEntry}.
+     */
     public PrincipalStoreEntry getEntry()
     {
         return new PrincipalStoreEntry( commonName, userId, principal, keyVersionNumber, validStart, validEnd,
@@ -77,108 +82,201 @@
     }
 
 
+    /**
+     * Sets whether the account is disabled.
+     *
+     * @param disabled
+     */
     public void setDisabled( boolean disabled )
     {
         this.disabled = disabled;
     }
 
 
+    /**
+     * Sets whether the account is locked-out.
+     *
+     * @param lockedOut
+     */
     public void setLockedOut( boolean lockedOut )
     {
         this.lockedOut = lockedOut;
     }
 
 
+    /**
+     * Sets the expiration time.
+     *
+     * @param expiration
+     */
     public void setExpiration( KerberosTime expiration )
     {
         this.expiration = expiration;
     }
 
 
+    /**
+     * Sets the common name (cn).
+     *
+     * @param commonName
+     */
     public void setCommonName( String commonName )
     {
         this.commonName = commonName;
     }
 
 
+    /**
+     * Sets the user ID.
+     *
+     * @param userId
+     */
     public void setUserId( String userId )
     {
         this.userId = userId;
     }
 
 
+    /**
+     * Sets the encryption type.
+     *
+     * @param encryptionType
+     */
     public void setEncryptionType( int encryptionType )
     {
         this.encryptionType = encryptionType;
     }
 
 
+    /**
+     * Sets the KDC flags.
+     *
+     * @param kdcFlags
+     */
     public void setKDCFlags( int kdcFlags )
     {
         this.kdcFlags = kdcFlags;
     }
 
 
+    /**
+     * Sets the key map.
+     *
+     * @param keyMap
+     */
     public void setKeyMap( Map<EncryptionType, EncryptionKey> keyMap )
     {
         this.keyMap = keyMap;
     }
 
 
+    /**
+     * Sets the key version number.
+     *
+     * @param keyVersionNumber
+     */
     public void setKeyVersionNumber( int keyVersionNumber )
     {
         this.keyVersionNumber = keyVersionNumber;
     }
 
 
+    /**
+     * Sets the ticket maximum life time.
+     *
+     * @param maxLife
+     */
     public void setMaxLife( int maxLife )
     {
         this.maxLife = maxLife;
     }
 
 
+    /**
+     * Sets the ticket maximum renew time.
+     *
+     * @param maxRenew
+     */
     public void setMaxRenew( int maxRenew )
     {
         this.maxRenew = maxRenew;
     }
 
 
+    /**
+     * Sets the end-of-life for the password.
+     *
+     * @param passwordEnd
+     */
     public void setPasswordEnd( KerberosTime passwordEnd )
     {
         this.passwordEnd = passwordEnd;
     }
 
 
+    /**
+     * Sets the principal.
+     *
+     * @param principal
+     */
     public void setPrincipal( KerberosPrincipal principal )
     {
         this.principal = principal;
     }
 
 
+    /**
+     * Sets the realm.
+     *
+     * @param realmName
+     */
     public void setRealmName( String realmName )
     {
         this.realmName = realmName;
     }
 
 
+    /**
+     * Sets the end of validity.
+     *
+     * @param validEnd
+     */
     public void setValidEnd( KerberosTime validEnd )
     {
         this.validEnd = validEnd;
     }
 
 
+    /**
+     * Sets the start of validity.
+     *
+     * @param validStart
+     */
     public void setValidStart( KerberosTime validStart )
     {
         this.validStart = validStart;
     }
 
 
+    /**
+     * Sets the single-use authentication (SAM) type.
+     *
+     * @param samType
+     */
     public void setSamType( SamType samType )
     {
         this.samType = samType;
     }
 
 
+    /**
+     * Converts the ASN.1 encoded key set to a map of encryption types to encryption keys.
+     *
+     * @param krb5key
+     * @return The map of encryption types to encryption keys.
+     * @throws NamingException
+     * @throws IOException
+     */
     public Map<EncryptionType, EncryptionKey> reconstituteKeyMap( Attribute krb5key ) throws NamingException,
         IOException
     {

Modified: directory/apacheds/branches/kerberos-encryption-types/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/value/OptionsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/value/OptionsTest.java?view=diff&rev=538808&r1=538807&r2=538808
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/value/OptionsTest.java (original)
+++ directory/apacheds/branches/kerberos-encryption-types/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/value/OptionsTest.java Wed May 16 22:47:31 2007
@@ -22,11 +22,11 @@
 
 import java.util.Arrays;
 
+import junit.framework.TestCase;
+
 import org.apache.directory.server.kerberos.shared.messages.value.KdcOptions;
 import org.apache.directory.server.kerberos.shared.messages.value.TicketFlags;
 
-import junit.framework.TestCase;
-
 
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -38,6 +38,9 @@
         { ( byte ) 0x50, ( byte ) 0x00, ( byte ) 0x00, ( byte ) 0x10 };
 
 
+    /**
+     * Tests converting the ticket flags to a descriptive String.
+     */
     public void testToString()
     {
         TicketFlags flags = new TicketFlags();
@@ -49,6 +52,9 @@
     }
 
 
+    /**
+     * Tests that setting flags is idempotent.
+     */
     public void testDuplicateSetting()
     {
         TicketFlags flags = new TicketFlags();
@@ -61,6 +67,9 @@
     }
 
 
+    /**
+     * Tests the basic construction of the {@link KdcOptions}.
+     */
     public void testConstruction()
     {
         KdcOptions options = new KdcOptions( fpriOptions );