directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r376623 [26/38] - in /directory/sandbox/akarasulu/rc1/apacheds: core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/ core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/ core-shared/src/main/java/org/...
Date Fri, 10 Feb 2006 10:49:57 GMT
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/SamType.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/SamType.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/SamType.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/SamType.java Fri Feb 10 02:48:07 2006
@@ -16,10 +16,12 @@
  */
 package org.apache.kerberos.messages.value;
 
+
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+
 /**
  * Type safe enumeration of Single-use Authentication Mechanism types
  *
@@ -28,38 +30,36 @@
  */
 public final class SamType implements Comparable
 {
-	/*
-	 * Enumeration elements are constructed once upon class loading.
-	 * Order of appearance here determines the order of compareTo.
-	 */
+    /*
+     * Enumeration elements are constructed once upon class loading.
+     * Order of appearance here determines the order of compareTo.
+     */
 
     /** safe SAM type enum for Enigma Logic */
-	public static final SamType PA_SAM_TYPE_ENIGMA = new SamType( 1, "Enigma Logic" );
+    public static final SamType PA_SAM_TYPE_ENIGMA = new SamType( 1, "Enigma Logic" );
 
     /** safe SAM type enum for Digital Pathways */
-	public static final SamType PA_SAM_TYPE_DIGI_PATH = new SamType( 2, "Digital Pathways" );
+    public static final SamType PA_SAM_TYPE_DIGI_PATH = new SamType( 2, "Digital Pathways" );
 
     /** safe SAM type enum for S/key where KDC has key 0 */
-	public static final SamType PA_SAM_TYPE_SKEY_K0 = new SamType( 3, "S/key where KDC has key 0" );
+    public static final SamType PA_SAM_TYPE_SKEY_K0 = new SamType( 3, "S/key where KDC has key 0" );
 
     /** safe SAM type enum for Traditional S/Key */
-	public static final SamType PA_SAM_TYPE_SKEY = new SamType( 4, "Traditional S/Key" );
+    public static final SamType PA_SAM_TYPE_SKEY = new SamType( 4, "Traditional S/Key" );
 
     /** safe SAM type enum for Security Dynamics */
-	public static final SamType PA_SAM_TYPE_SECURID = new SamType( 5, "Security Dynamics" );
+    public static final SamType PA_SAM_TYPE_SECURID = new SamType( 5, "Security Dynamics" );
 
     /** safe SAM type enum for CRYPTOCard */
-	public static final SamType PA_SAM_TYPE_CRYPTOCARD = new SamType( 6, "CRYPTOCard" );
+    public static final SamType PA_SAM_TYPE_CRYPTOCARD = new SamType( 6, "CRYPTOCard" );
 
     /** safe SAM type enum for Apache Software Foundation */
-	public static final SamType PA_SAM_TYPE_APACHE = new SamType( 7, "Apache Software Foundation" );
+    public static final SamType PA_SAM_TYPE_APACHE = new SamType( 7, "Apache Software Foundation" );
 
     /** Array for building a List of VALUES. */
-    private static final SamType[] values = {
-        PA_SAM_TYPE_ENIGMA, PA_SAM_TYPE_DIGI_PATH, PA_SAM_TYPE_SKEY_K0,
-        PA_SAM_TYPE_SKEY, PA_SAM_TYPE_SECURID, PA_SAM_TYPE_CRYPTOCARD,
-        PA_SAM_TYPE_APACHE
-    };
+    private static final SamType[] values =
+        { PA_SAM_TYPE_ENIGMA, PA_SAM_TYPE_DIGI_PATH, PA_SAM_TYPE_SKEY_K0, PA_SAM_TYPE_SKEY, PA_SAM_TYPE_SECURID,
+            PA_SAM_TYPE_CRYPTOCARD, PA_SAM_TYPE_APACHE };
 
     /** a list of all the sam type constants */
     public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
@@ -70,15 +70,17 @@
     /** the value/code for the sam type */
     private final int ordinal;
 
+
     /**
      * Private constructor prevents construction outside of this class.
      */
-    private SamType( int ordinal, String name )
+    private SamType(int ordinal, String name)
     {
         this.ordinal = ordinal;
-        this.name    = name;
+        this.name = name;
     }
 
+
     /**
      * Returns the name of the SamType.
      *
@@ -86,8 +88,9 @@
      */
     public String toString()
     {
-		return name;
-	}
+        return name;
+    }
+
 
     /**
      * Compares this type to another object hopefully one that is of the same
@@ -96,10 +99,11 @@
      * @param that the object to compare this SamType to
      * @return ordinal - ( ( SamType ) that ).ordinal;
      */
-	public int compareTo( Object that )
+    public int compareTo( Object that )
     {
-		return ordinal - ( ( SamType ) that ).ordinal;
-	}
+        return ordinal - ( ( SamType ) that ).ordinal;
+    }
+
 
     /**
      * Gets the ordinal by its ordinal value.
@@ -107,26 +111,27 @@
      * @param ordinal the ordinal value of the ordinal
      * @return the type corresponding to the ordinal value
      */
-	public static SamType getTypeByOrdinal( int ordinal )
+    public static SamType getTypeByOrdinal( int ordinal )
     {
-		for ( int ii = 0; ii < values.length; ii++ )
+        for ( int ii = 0; ii < values.length; ii++ )
         {
-			if ( values[ ii ].ordinal == ordinal )
+            if ( values[ii].ordinal == ordinal )
             {
-				return values[ ii ];
+                return values[ii];
             }
         }
 
-		return PA_SAM_TYPE_APACHE;
-	}
+        return PA_SAM_TYPE_APACHE;
+    }
+
 
     /**
      * Gets the ordinal value associated with this SAM type.
      *
      * @return the ordinal value associated with this SAM type
      */
-	public int getOrdinal()
+    public int getOrdinal()
     {
-		return ordinal;
-	}
+        return ordinal;
+    }
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TicketFlags.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TicketFlags.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TicketFlags.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TicketFlags.java Fri Feb 10 02:48:07 2006
@@ -16,41 +16,43 @@
  */
 package org.apache.kerberos.messages.value;
 
+
 public class TicketFlags extends Options
 {
-	// Ticket flag - reserved
-	public static final int RESERVED                 = 0;
-	// Ticket flag - forwardable
-	public static final int FORWARDABLE              = 1;
-	// Ticket flag - forwarded
-	public static final int FORWARDED                = 2;
-	// Ticket flag - proxiable
-	public static final int PROXIABLE                = 3;
-	// Ticket flag - proxy
-	public static final int PROXY                    = 4;
-	// Ticket flag - may be postdated
-	public static final int MAY_POSTDATE             = 5;
-	// Ticket flag - postdated
-	public static final int POSTDATED                = 6;
-	// Ticket flag - invalid
-	public static final int INVALID                  = 7;
-	// Ticket flag - renewable
-	public static final int RENEWABLE                = 8;
-	// Ticket flag - initial
-	public static final int INITIAL                  = 9;
-	// Ticket flag - pre-authentication
-	public static final int PRE_AUTHENT              = 10;
-	// Ticket flag - hardware authentication
-	public static final int HW_AUTHENT               = 11;
-	// Ticket flag - transitedEncoding policy checked
-	public static final int TRANSITED_POLICY_CHECKED = 12;
-	// Ticket flag - OK as delegate
-	public static final int OK_AS_DELEGATE           = 13;
+    // Ticket flag - reserved
+    public static final int RESERVED = 0;
+    // Ticket flag - forwardable
+    public static final int FORWARDABLE = 1;
+    // Ticket flag - forwarded
+    public static final int FORWARDED = 2;
+    // Ticket flag - proxiable
+    public static final int PROXIABLE = 3;
+    // Ticket flag - proxy
+    public static final int PROXY = 4;
+    // Ticket flag - may be postdated
+    public static final int MAY_POSTDATE = 5;
+    // Ticket flag - postdated
+    public static final int POSTDATED = 6;
+    // Ticket flag - invalid
+    public static final int INVALID = 7;
+    // Ticket flag - renewable
+    public static final int RENEWABLE = 8;
+    // Ticket flag - initial
+    public static final int INITIAL = 9;
+    // Ticket flag - pre-authentication
+    public static final int PRE_AUTHENT = 10;
+    // Ticket flag - hardware authentication
+    public static final int HW_AUTHENT = 11;
+    // Ticket flag - transitedEncoding policy checked
+    public static final int TRANSITED_POLICY_CHECKED = 12;
+    // Ticket flag - OK as delegate
+    public static final int OK_AS_DELEGATE = 13;
+
+    // Ticket flag - maximum value
+    public static final int MAX_VALUE = 32;
 
-	// Ticket flag - maximum value
-	public static final int MAX_VALUE                = 32;
 
-	/**
+    /**
      * Class constructor
      */
     public TicketFlags()
@@ -58,11 +60,13 @@
         super( MAX_VALUE );
     }
 
-    public TicketFlags( byte[] options )
+
+    public TicketFlags(byte[] options)
     {
         super( MAX_VALUE );
         setBytes( options );
     }
+
 
     /**
      * Converts the object to a printable string

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TransitedEncoding.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TransitedEncoding.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TransitedEncoding.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TransitedEncoding.java Fri Feb 10 02:48:07 2006
@@ -16,27 +16,32 @@
  */
 package org.apache.kerberos.messages.value;
 
+
 public class TransitedEncoding
 {
     private TransitedEncodingType type;
     private byte[] contents;
 
+
     public TransitedEncoding()
     {
         type = TransitedEncodingType.NULL;
-        contents = new byte[ 0 ];
+        contents = new byte[0];
     }
 
-    public TransitedEncoding( TransitedEncodingType type, byte[] contents )
+
+    public TransitedEncoding(TransitedEncodingType type, byte[] contents)
     {
         this.type = type;
         this.contents = contents;
     }
 
+
     public byte[] getContents()
     {
         return contents;
     }
+
 
     public TransitedEncodingType getType()
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TransitedEncodingType.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TransitedEncodingType.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TransitedEncodingType.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/TransitedEncodingType.java Fri Feb 10 02:48:07 2006
@@ -16,42 +16,49 @@
  */
 package org.apache.kerberos.messages.value;
 
+
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+
 public final class TransitedEncodingType implements Comparable
 {
-	/**
-	 * Enumeration elements are constructed once upon class loading.
-	 * Order of appearance here determines the order of compareTo.
-	 */
-	public static final TransitedEncodingType NULL                 = new TransitedEncodingType(0, "null");
-	public static final TransitedEncodingType DOMAIN_X500_COMPRESS = new TransitedEncodingType(1, "Domain X500 compress");
+    /**
+     * Enumeration elements are constructed once upon class loading.
+     * Order of appearance here determines the order of compareTo.
+     */
+    public static final TransitedEncodingType NULL = new TransitedEncodingType( 0, "null" );
+    public static final TransitedEncodingType DOMAIN_X500_COMPRESS = new TransitedEncodingType( 1,
+        "Domain X500 compress" );
+
 
-	public String toString()
+    public String toString()
     {
         return name + " (" + ordinal + ")";
     }
 
+
     public int compareTo( Object that )
     {
-        return ordinal - ( (TransitedEncodingType) that ).ordinal;
+        return ordinal - ( ( TransitedEncodingType ) that ).ordinal;
     }
 
+
     public static TransitedEncodingType getTypeByOrdinal( int type )
     {
         for ( int ii = 0; ii < values.length; ii++ )
         {
-            if ( values[ ii ].ordinal == type )
+            if ( values[ii].ordinal == type )
             {
-                return values[ ii ];
+                return values[ii];
             }
         }
-        
+
         return NULL;
     }
 
+
     public int getOrdinal()
     {
         return ordinal;
@@ -61,10 +68,11 @@
     private final String name;
     private final int ordinal;
 
+
     /**
      * Private constructor prevents construction outside of this class.
      */
-    private TransitedEncodingType( int ordinal, String name )
+    private TransitedEncodingType(int ordinal, String name)
     {
         this.ordinal = ordinal;
         this.name = name;
@@ -73,7 +81,8 @@
     /**
      * These two lines are all that's necessary to export a List of VALUES.
      */
-    private static final TransitedEncodingType[] values = { NULL, DOMAIN_X500_COMPRESS };
+    private static final TransitedEncodingType[] values =
+        { NULL, DOMAIN_X500_COMPRESS };
     // VALUES needs to be located here, otherwise illegal forward reference
     public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/replay/InMemoryReplayCache.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/replay/InMemoryReplayCache.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/replay/InMemoryReplayCache.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/replay/InMemoryReplayCache.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.replay;
 
+
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Iterator;
@@ -25,19 +26,21 @@
 
 import org.apache.kerberos.messages.value.KerberosTime;
 
+
 public class InMemoryReplayCache implements ReplayCache
 {
     private static final long TWO_WEEKS = 1000 * 60 * 60 * 24 * 14;
 
     private List list = new ArrayList();
 
+
     public synchronized boolean isReplay( KerberosTime clientTime, KerberosPrincipal clientPrincipal )
     {
         ReplayCacheEntry testEntry = new ReplayCacheEntry( clientTime, clientPrincipal );
         Iterator it = list.iterator();
         while ( it.hasNext() )
         {
-            ReplayCacheEntry entry = (ReplayCacheEntry) it.next();
+            ReplayCacheEntry entry = ( ReplayCacheEntry ) it.next();
             if ( entry.equals( testEntry ) )
             {
                 return true;
@@ -46,12 +49,14 @@
         return false;
     }
 
+
     public synchronized void save( KerberosTime clientTime, KerberosPrincipal clientPrincipal )
     {
         list.add( new ReplayCacheEntry( clientTime, clientPrincipal ) );
         purgeExpired();
     }
 
+
     /*
      * TODO - age needs to be configurable; requires store
      */
@@ -64,7 +69,7 @@
         Iterator it = list.iterator();
         while ( it.hasNext() )
         {
-            ReplayCacheEntry entry = (ReplayCacheEntry) it.next();
+            ReplayCacheEntry entry = ( ReplayCacheEntry ) it.next();
             if ( entry.olderThan( age ) )
             {
                 list.remove( entry );
@@ -77,17 +82,19 @@
         private KerberosTime clientTime;
         private KerberosPrincipal clientPrincipal;
 
-        public ReplayCacheEntry( KerberosTime time, KerberosPrincipal principal )
+
+        public ReplayCacheEntry(KerberosTime time, KerberosPrincipal principal)
         {
             clientTime = time;
             clientPrincipal = principal;
         }
 
+
         public boolean equals( ReplayCacheEntry other )
         {
-            return clientTime.equals( other.clientTime )
-                    && clientPrincipal.equals( other.clientPrincipal );
+            return clientTime.equals( other.clientTime ) && clientPrincipal.equals( other.clientPrincipal );
         }
+
 
         public boolean olderThan( KerberosTime time )
         {

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/replay/ReplayCache.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/replay/ReplayCache.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/replay/ReplayCache.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/replay/ReplayCache.java Fri Feb 10 02:48:07 2006
@@ -16,13 +16,16 @@
  */
 package org.apache.kerberos.replay;
 
+
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.kerberos.messages.value.KerberosTime;
 
+
 public interface ReplayCache
 {
     boolean isReplay( KerberosTime clientTime, KerberosPrincipal clientPrincipal );
+
 
     void save( KerberosTime clientTime, KerberosPrincipal clientPrincipal );
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/DesStringToKey.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/DesStringToKey.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/DesStringToKey.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/DesStringToKey.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.service;
 
+
 import java.io.UnsupportedEncodingException;
 
 import org.apache.directory.server.protocol.shared.chain.impl.CommandBase;
@@ -25,6 +26,7 @@
 import org.bouncycastle.crypto.params.KeyParameter;
 import org.bouncycastle.crypto.params.ParametersWithIV;
 
+
 public abstract class DesStringToKey extends CommandBase
 {
     public byte[] getKey( String passPhrase )
@@ -32,12 +34,14 @@
         return generateKey( passPhrase );
     }
 
+
     // This is the concatenation order as designated in RFC 1510
     public byte[] getKey( String password, String realmName, String userName )
     {
         return generateKey( password + realmName + userName );
     }
 
+
     private byte[] generateKey( String passPhrase )
     {
         byte encodedByteArray[] = characterEncodeString( passPhrase );
@@ -65,22 +69,23 @@
         return secretKey;
     }
 
+
     private byte[] fanFold( byte[] paddedByteArray )
     {
-        byte secretKey[] = new byte[ 8 ];
+        byte secretKey[] = new byte[8];
 
         int div = paddedByteArray.length / 8;
 
         for ( int ii = 0; ii < div; ii++ )
         {
-            byte blockValue1[] = new byte[ 8 ];
+            byte blockValue1[] = new byte[8];
             System.arraycopy( paddedByteArray, ii * 8, blockValue1, 0, 8 );
 
             if ( ii % 2 == 1 )
             {
                 byte tempbyte1 = 0;
                 byte tempbyte2 = 0;
-                byte blockValue2[] = new byte[ 8 ];
+                byte blockValue2[] = new byte[8];
 
                 for ( int jj = 0; jj < 8; jj++ )
                 {
@@ -88,25 +93,25 @@
 
                     for ( int kk = 0; kk < 4; kk++ )
                     {
-                        tempbyte2 = (byte) ( ( 1 << ( 7 - kk ) ) & 0xff );
-                        tempbyte1 |= ( blockValue1[ jj ] & tempbyte2 ) >>> ( 7 - 2 * kk );
+                        tempbyte2 = ( byte ) ( ( 1 << ( 7 - kk ) ) & 0xff );
+                        tempbyte1 |= ( blockValue1[jj] & tempbyte2 ) >>> ( 7 - 2 * kk );
                         tempbyte2 = 0;
                     }
 
                     for ( int kk = 4; kk < 8; kk++ )
                     {
-                        tempbyte2 = (byte) ( ( 1 << ( 7 - kk ) ) & 0xff );
-                        tempbyte1 |= ( blockValue1[ jj ] & tempbyte2 ) << ( 2 * kk - 7 );
+                        tempbyte2 = ( byte ) ( ( 1 << ( 7 - kk ) ) & 0xff );
+                        tempbyte1 |= ( blockValue1[jj] & tempbyte2 ) << ( 2 * kk - 7 );
                         tempbyte2 = 0;
                     }
 
-                    blockValue2[ 7 - jj ] = tempbyte1;
+                    blockValue2[7 - jj] = tempbyte1;
                     tempbyte1 = 0;
                 }
 
                 for ( int jj = 0; jj < 8; jj++ )
                 {
-                    blockValue2[ jj ] = (byte) ( ( ( blockValue2[ jj ] & 0xff ) >>> 1 ) & 0xff );
+                    blockValue2[jj] = ( byte ) ( ( ( blockValue2[jj] & 0xff ) >>> 1 ) & 0xff );
                 }
 
                 System.arraycopy( blockValue2, 0, blockValue1, 0, blockValue2.length );
@@ -114,19 +119,20 @@
 
             for ( int jj = 0; jj < 8; jj++ )
             {
-                blockValue1[ jj ] = (byte) ( ( ( blockValue1[ jj ] & 0xff ) << 1 ) & 0xff );
+                blockValue1[jj] = ( byte ) ( ( ( blockValue1[jj] & 0xff ) << 1 ) & 0xff );
             }
 
             // ... eXclusive-ORed with itself to form an 8-byte DES key
             for ( int jj = 0; jj < 8; jj++ )
             {
-                secretKey[ jj ] ^= blockValue1[ jj ];
+                secretKey[jj] ^= blockValue1[jj];
             }
         }
 
         return secretKey;
     }
 
+
     // TODO - Re-evaluate when DES3 keys are supported.  This is duplicated
     //        with parts of EncryptionEngine, but makes this class standalone.
     private byte[] encryptSecretKey( byte data[], byte key[] )
@@ -138,8 +144,8 @@
         iv = new ParametersWithIV( kp, key );
         cipher.init( true, iv );
 
-        byte encKey[] = new byte[ data.length ];
-        byte ivBytes[] = new byte[ 8 ];
+        byte encKey[] = new byte[data.length];
+        byte ivBytes[] = new byte[8];
 
         for ( int ii = 0; ii < data.length / 8; ii++ )
         {
@@ -152,18 +158,20 @@
         return ivBytes;
     }
 
+
     // Corrects the weak key by exclusive OR with 0xF0 constant.
     private byte[] getStrongKey( byte keyValue[] )
     {
-        keyValue[ 7 ] ^= 0xf0;
+        keyValue[7] ^= 0xf0;
 
         return keyValue;
     }
 
+
     // Encodes string with ISO-Latin encoding
     private byte[] characterEncodeString( String str )
     {
-        byte encodedByteArray[] = new byte[ str.length() ];
+        byte encodedByteArray[] = new byte[str.length()];
 
         try
         {
@@ -176,6 +184,7 @@
         return encodedByteArray;
     }
 
+
     // Add padding to make an exact multiple of 8.
     // TODO - Re-evaluate when DES3 keys are supported.  This is duplicated
     //        with parts of EncryptionEngine, but makes this class standalone.
@@ -197,11 +206,11 @@
             return encodedString;
         }
 
-        byte paddedByteArray[] = new byte[ ( 8 - length ) + encodedString.length ];
+        byte paddedByteArray[] = new byte[( 8 - length ) + encodedString.length];
 
         for ( int ii = paddedByteArray.length - 1; ii > encodedString.length - 1; ii-- )
         {
-            paddedByteArray[ ii ] = 0;
+            paddedByteArray[ii] = 0;
         }
 
         System.arraycopy( encodedString, 0, paddedByteArray, 0, encodedString.length );

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/ErrorMessageHandler.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/ErrorMessageHandler.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/ErrorMessageHandler.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/ErrorMessageHandler.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.service;
 
+
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.protocol.shared.chain.Command;
@@ -25,6 +26,7 @@
 import org.apache.kerberos.messages.ErrorMessage;
 import org.apache.kerberos.messages.ErrorMessageModifier;
 import org.apache.kerberos.messages.value.KerberosTime;
+
 
 /**
  * A {@link Command} for helping convert a {@link KerberosException} into

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/GetPrincipalStoreEntry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/GetPrincipalStoreEntry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/GetPrincipalStoreEntry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/GetPrincipalStoreEntry.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.service;
 
+
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.protocol.shared.chain.impl.CommandBase;
@@ -24,10 +25,11 @@
 import org.apache.kerberos.store.PrincipalStore;
 import org.apache.kerberos.store.PrincipalStoreEntry;
 
+
 public abstract class GetPrincipalStoreEntry extends CommandBase
 {
-    public PrincipalStoreEntry getEntry( KerberosPrincipal principal, PrincipalStore store,
-            ErrorType errorType ) throws Exception
+    public PrincipalStoreEntry getEntry( KerberosPrincipal principal, PrincipalStore store, ErrorType errorType )
+        throws Exception
     {
         PrincipalStoreEntry entry = null;
 

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/LockBox.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/LockBox.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/LockBox.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/LockBox.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.kerberos.service;
 
+
 import java.io.IOException;
 import java.util.Collections;
 import java.util.HashMap;
@@ -57,6 +58,7 @@
 import org.apache.kerberos.messages.value.EncryptedTimeStamp;
 import org.apache.kerberos.messages.value.EncryptionKey;
 
+
 /**
  * A Hashed Adapter encapsulating ASN.1 encoders and decoders and cipher text engines to
  * perform seal() and unseal() operations.  A seal() operation performs an encode and an
@@ -110,6 +112,7 @@
         DEFAULT_CIPHERS = Collections.unmodifiableMap( map );
     }
 
+
     public EncryptedData seal( EncryptionKey key, Encodable encodable ) throws KerberosException
     {
         try
@@ -126,6 +129,7 @@
         }
     }
 
+
     public Encodable unseal( Class hint, EncryptionKey key, EncryptedData data ) throws KerberosException
     {
         try
@@ -142,6 +146,7 @@
         }
     }
 
+
     private EncryptedData encrypt( EncryptionKey key, byte[] plainText ) throws KerberosException
     {
         EncryptionEngine engine = getEngine( key );
@@ -149,6 +154,7 @@
         return engine.getEncryptedData( key, plainText );
     }
 
+
     private byte[] decrypt( EncryptionKey key, EncryptedData data ) throws KerberosException
     {
         EncryptionEngine engine = getEngine( key );
@@ -156,11 +162,12 @@
         return engine.getDecryptedData( key, data );
     }
 
+
     private byte[] encode( Encodable encodable ) throws IOException
     {
         Class encodableClass = encodable.getClass();
 
-        Class clazz = (Class) DEFAULT_ENCODERS.get( encodableClass );
+        Class clazz = ( Class ) DEFAULT_ENCODERS.get( encodableClass );
 
         if ( clazz == null )
         {
@@ -171,7 +178,7 @@
 
         try
         {
-            factory = (EncoderFactory) clazz.newInstance();
+            factory = ( EncoderFactory ) clazz.newInstance();
         }
         catch ( IllegalAccessException iae )
         {
@@ -187,9 +194,10 @@
         return encoder.encode( encodable );
     }
 
+
     private Encodable decode( Class encodable, byte[] plainText ) throws IOException
     {
-        Class clazz = (Class) DEFAULT_DECODERS.get( encodable );
+        Class clazz = ( Class ) DEFAULT_DECODERS.get( encodable );
 
         if ( clazz == null )
         {
@@ -200,7 +208,7 @@
 
         try
         {
-            factory = (DecoderFactory) clazz.newInstance();
+            factory = ( DecoderFactory ) clazz.newInstance();
         }
         catch ( IllegalAccessException iae )
         {
@@ -216,11 +224,12 @@
         return decoder.decode( plainText );
     }
 
+
     private EncryptionEngine getEngine( EncryptionKey key ) throws KerberosException
     {
         EncryptionType encryptionType = key.getKeyType();
 
-        Class clazz = (Class) DEFAULT_CIPHERS.get( encryptionType );
+        Class clazz = ( Class ) DEFAULT_CIPHERS.get( encryptionType );
 
         if ( clazz == null )
         {
@@ -229,7 +238,7 @@
 
         try
         {
-            return (EncryptionEngine) clazz.newInstance();
+            return ( EncryptionEngine ) clazz.newInstance();
         }
         catch ( IllegalAccessException iae )
         {

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/VerifyAuthHeader.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/VerifyAuthHeader.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/VerifyAuthHeader.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/VerifyAuthHeader.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.service;
 
+
 import java.net.InetAddress;
 
 import org.apache.directory.server.protocol.shared.chain.impl.CommandBase;
@@ -33,6 +34,7 @@
 import org.apache.kerberos.messages.value.TicketFlags;
 import org.apache.kerberos.replay.ReplayCache;
 
+
 /*
  * Shared by TGS and Changepw
  */
@@ -40,8 +42,8 @@
 {
     // RFC 1510 A.10.  KRB_AP_REQ verification
     public Authenticator verifyAuthHeader( ApplicationRequest authHeader, Ticket ticket, EncryptionKey serverKey,
-            long clockSkew, ReplayCache replayCache, boolean emptyAddressesAllowed, InetAddress clientAddress, LockBox lockBox )
-            throws KerberosException
+        long clockSkew, ReplayCache replayCache, boolean emptyAddressesAllowed, InetAddress clientAddress,
+        LockBox lockBox ) throws KerberosException
     {
         if ( authHeader.getProtocolVersionNumber() != 5 )
         {
@@ -80,10 +82,11 @@
             throw new KerberosException( ErrorType.KRB_AP_ERR_NOKEY );
         }
 
-        EncTicketPart encPart = (EncTicketPart) lockBox.unseal( EncTicketPart.class, ticketKey, ticket.getEncPart() );
+        EncTicketPart encPart = ( EncTicketPart ) lockBox.unseal( EncTicketPart.class, ticketKey, ticket.getEncPart() );
         ticket.setEncTicketPart( encPart );
 
-        Authenticator authenticator = (Authenticator) lockBox.unseal( Authenticator.class, ticket.getSessionKey(), authHeader.getEncPart() );
+        Authenticator authenticator = ( Authenticator ) lockBox.unseal( Authenticator.class, ticket.getSessionKey(),
+            authHeader.getEncPart() );
 
         if ( !authenticator.getClientPrincipal().getName().equals( ticket.getClientPrincipal().getName() ) )
         {
@@ -118,7 +121,7 @@
         }
 
         if ( ticket.getStartTime() != null && !ticket.getStartTime().isInClockSkew( clockSkew )
-                || ticket.getFlag( TicketFlags.INVALID ) )
+            || ticket.getFlag( TicketFlags.INVALID ) )
         {
             // it hasn't yet become valid
             throw new KerberosException( ErrorType.KRB_AP_ERR_TKT_NYV );

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/VerifyTicket.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/VerifyTicket.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/VerifyTicket.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/service/VerifyTicket.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.service;
 
+
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.protocol.shared.chain.impl.CommandBase;
@@ -23,6 +24,7 @@
 import org.apache.kerberos.exceptions.KerberosException;
 import org.apache.kerberos.messages.components.Ticket;
 
+
 /*
  * Shared by TGS and Changepw
  */
@@ -30,8 +32,7 @@
 {
     public void verifyTicket( Ticket ticket, String primaryRealm, KerberosPrincipal serverPrincipal ) throws Exception
     {
-        if ( !ticket.getRealm().equals( primaryRealm )
-                && !ticket.getServerPrincipal().equals( serverPrincipal ) )
+        if ( !ticket.getRealm().equals( primaryRealm ) && !ticket.getServerPrincipal().equals( serverPrincipal ) )
         {
             throw new KerberosException( ErrorType.KRB_AP_ERR_NOT_US );
         }

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java Fri Feb 10 02:48:07 2006
@@ -16,12 +16,14 @@
  */
 package org.apache.kerberos.store;
 
+
 import javax.naming.spi.InitialContextFactory;
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.protocol.shared.ServiceConfiguration;
 
+
 /**
  * A JNDI-backed implementation of the PrincipalStore interface.  This PrincipalStore uses
  * the Strategy pattern to either serve principals based on a single base DN or to lookup
@@ -41,7 +43,8 @@
     /** a handle on the search strategy */
     private PrincipalStore store;
 
-    public JndiPrincipalStoreImpl( ServiceConfiguration config, InitialContextFactory factory )
+
+    public JndiPrincipalStoreImpl(ServiceConfiguration config, InitialContextFactory factory)
     {
         this.config = config;
         this.factory = factory;
@@ -49,30 +52,36 @@
         store = getStore();
     }
 
+
     public String addPrincipal( PrincipalStoreEntry entry ) throws Exception
     {
         return store.addPrincipal( entry );
     }
 
+
     public String deletePrincipal( KerberosPrincipal principal ) throws Exception
     {
         return store.deletePrincipal( principal );
     }
 
+
     public PrincipalStoreEntry[] getAllPrincipals( String realm ) throws Exception
     {
         return store.getAllPrincipals( realm );
     }
 
+
     public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception
     {
         return store.getPrincipal( principal );
     }
 
+
     public String changePassword( KerberosPrincipal principal, KerberosKey newKey ) throws Exception
     {
         return store.changePassword( principal, newKey );
     }
+
 
     private PrincipalStore getStore()
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/KerberosAttribute.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/KerberosAttribute.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/KerberosAttribute.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/KerberosAttribute.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.store;
 
+
 public class KerberosAttribute
 {
     // ------------------------------------------------------------------------
@@ -23,13 +24,13 @@
     // ------------------------------------------------------------------------
 
     /** the krb5kdc schema key for a krb5KDCEntry */
-    public static final String KEY       = "krb5Key";
+    public static final String KEY = "krb5Key";
     /** the krb5kdc schema key encryption type for a krb5KDCEntry */
-    public static final String TYPE      = "krb5EncryptionType";
+    public static final String TYPE = "krb5EncryptionType";
     /** the krb5kdc schema principal name for a krb5KDCEntry */
     public static final String PRINCIPAL = "krb5PrincipalName";
     /** the krb5kdc schema key version identifier for a krb5KDCEntry */
-    public static final String VERSION   = "krb5KeyVersionNumber";
+    public static final String VERSION = "krb5KeyVersionNumber";
     /** the Apache specific SAM type attribute */
-    public static final String SAM_TYPE  = "apacheSamType";
+    public static final String SAM_TYPE = "apacheSamType";
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/KerberosCatalog.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/KerberosCatalog.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/KerberosCatalog.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/KerberosCatalog.java Fri Feb 10 02:48:07 2006
@@ -17,10 +17,12 @@
 
 package org.apache.kerberos.store;
 
+
 import java.util.Map;
 
 import org.apache.directory.server.protocol.shared.catalog.Catalog;
 
+
 /**
  * A catalog for mapping Kerberos realms to search base DN's. 
  * 
@@ -31,11 +33,13 @@
 {
     private Map map;
 
-    public KerberosCatalog( Map map )
+
+    public KerberosCatalog(Map map)
     {
         this.map = map;
     }
 
+
     public String getBaseDn( String name )
     {
         name = name.toLowerCase();
@@ -48,7 +52,7 @@
 
         while ( !name.equals( "" ) && name != null )
         {
-            String candidate = (String) map.get( name );
+            String candidate = ( String ) map.get( name );
             if ( candidate != null )
             {
                 return candidate;

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/MultiBaseSearch.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/MultiBaseSearch.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/MultiBaseSearch.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/MultiBaseSearch.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.kerberos.store;
 
+
 import java.util.Hashtable;
 import java.util.Map;
 
@@ -38,6 +39,7 @@
 import org.apache.kerberos.store.operations.GetAllPrincipals;
 import org.apache.kerberos.store.operations.GetPrincipal;
 
+
 /**
  * A JNDI-backed search strategy implementation.  This search strategy builds a
  * catalog from configuration in the DIT to determine where realms are to search
@@ -53,7 +55,8 @@
 
     private Catalog catalog;
 
-    MultiBaseSearch( ServiceConfiguration config, InitialContextFactory factory )
+
+    MultiBaseSearch(ServiceConfiguration config, InitialContextFactory factory)
     {
         this.factory = factory;
 
@@ -63,95 +66,101 @@
 
         try
         {
-            DirContext ctx = (DirContext) factory.getInitialContext( env );
-            catalog = new KerberosCatalog( (Map) execute( ctx, new GetCatalog() ) );
+            DirContext ctx = ( DirContext ) factory.getInitialContext( env );
+            catalog = new KerberosCatalog( ( Map ) execute( ctx, new GetCatalog() ) );
         }
         catch ( Exception e )
         {
-            String message = "Failed to get catalog context " + (String) env.get( Context.PROVIDER_URL );
+            String message = "Failed to get catalog context " + ( String ) env.get( Context.PROVIDER_URL );
             throw new ConfigurationException( message, e );
         }
     }
 
+
     public String addPrincipal( PrincipalStoreEntry entry ) throws Exception
     {
         env.put( Context.PROVIDER_URL, catalog.getBaseDn( entry.getRealmName() ) );
 
         try
         {
-            DirContext ctx = (DirContext) factory.getInitialContext( env );
-            return (String) execute( ctx, new AddPrincipal( entry ) );
+            DirContext ctx = ( DirContext ) factory.getInitialContext( env );
+            return ( String ) execute( ctx, new AddPrincipal( entry ) );
         }
         catch ( NamingException ne )
         {
-            String message = "Failed to get initial context " + (String) env.get( Context.PROVIDER_URL );
+            String message = "Failed to get initial context " + ( String ) env.get( Context.PROVIDER_URL );
             throw new ConfigurationException( message, ne );
         }
     }
 
+
     public String deletePrincipal( KerberosPrincipal principal ) throws Exception
     {
         env.put( Context.PROVIDER_URL, catalog.getBaseDn( principal.getRealm() ) );
 
         try
         {
-            DirContext ctx = (DirContext) factory.getInitialContext( env );
-            return (String) execute( ctx, new DeletePrincipal( principal ) );
+            DirContext ctx = ( DirContext ) factory.getInitialContext( env );
+            return ( String ) execute( ctx, new DeletePrincipal( principal ) );
         }
         catch ( NamingException ne )
         {
-            String message = "Failed to get initial context " + (String) env.get( Context.PROVIDER_URL );
+            String message = "Failed to get initial context " + ( String ) env.get( Context.PROVIDER_URL );
             throw new ConfigurationException( message, ne );
         }
     }
 
+
     public PrincipalStoreEntry[] getAllPrincipals( String realm ) throws Exception
     {
         env.put( Context.PROVIDER_URL, catalog.getBaseDn( realm ) );
 
         try
         {
-            DirContext ctx = (DirContext) factory.getInitialContext( env );
-            return (PrincipalStoreEntry[]) execute( ctx, new GetAllPrincipals() );
+            DirContext ctx = ( DirContext ) factory.getInitialContext( env );
+            return ( PrincipalStoreEntry[] ) execute( ctx, new GetAllPrincipals() );
         }
         catch ( NamingException ne )
         {
-            String message = "Failed to get initial context " + (String) env.get( Context.PROVIDER_URL );
+            String message = "Failed to get initial context " + ( String ) env.get( Context.PROVIDER_URL );
             throw new ConfigurationException( message, ne );
         }
     }
 
+
     public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception
     {
         env.put( Context.PROVIDER_URL, catalog.getBaseDn( principal.getRealm() ) );
 
         try
         {
-            DirContext ctx = (DirContext) factory.getInitialContext( env );
-            return (PrincipalStoreEntry) execute( ctx, new GetPrincipal( principal ) );
+            DirContext ctx = ( DirContext ) factory.getInitialContext( env );
+            return ( PrincipalStoreEntry ) execute( ctx, new GetPrincipal( principal ) );
         }
         catch ( NamingException ne )
         {
-            String message = "Failed to get initial context " + (String) env.get( Context.PROVIDER_URL );
+            String message = "Failed to get initial context " + ( String ) env.get( Context.PROVIDER_URL );
             throw new ConfigurationException( message, ne );
         }
     }
 
+
     public String changePassword( KerberosPrincipal principal, KerberosKey newKey ) throws Exception
     {
         env.put( Context.PROVIDER_URL, catalog.getBaseDn( principal.getRealm() ) );
 
         try
         {
-            DirContext ctx = (DirContext) factory.getInitialContext( env );
-            return (String) execute( ctx, new ChangePassword( principal, newKey ) );
+            DirContext ctx = ( DirContext ) factory.getInitialContext( env );
+            return ( String ) execute( ctx, new ChangePassword( principal, newKey ) );
         }
         catch ( NamingException ne )
         {
-            String message = "Failed to get initial context " + (String) env.get( Context.PROVIDER_URL );
+            String message = "Failed to get initial context " + ( String ) env.get( Context.PROVIDER_URL );
             throw new ConfigurationException( message, ne );
         }
     }
+
 
     private Object execute( DirContext ctx, ContextOperation operation ) throws Exception
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStore.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStore.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStore.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStore.java Fri Feb 10 02:48:07 2006
@@ -16,9 +16,11 @@
  */
 package org.apache.kerberos.store;
 
+
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
+
 /**
  * The store interface used by Kerberos services.
  * 
@@ -29,11 +31,15 @@
 {
     public String addPrincipal( PrincipalStoreEntry entry ) throws Exception;
 
+
     public String changePassword( KerberosPrincipal principal, KerberosKey newKey ) throws Exception;
 
+
     public String deletePrincipal( KerberosPrincipal principal ) throws Exception;
 
+
     public PrincipalStoreEntry[] getAllPrincipals( String realm ) throws Exception;
+
 
     public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception;
 }

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStoreEntry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStoreEntry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStoreEntry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStoreEntry.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.store;
 
+
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.kerberos.crypto.encryption.EncryptionType;
@@ -23,6 +24,7 @@
 import org.apache.kerberos.messages.value.KerberosTime;
 import org.apache.kerberos.messages.value.SamType;
 
+
 public class PrincipalStoreEntry
 {
     // principal
@@ -43,9 +45,10 @@
     private SamType samType;
     private EncryptionKey key;
 
-    PrincipalStoreEntry( String commonName, String userId, KerberosPrincipal principal, int keyVersionNumber,
-            KerberosTime validStart, KerberosTime validEnd, KerberosTime passwordEnd, int maxLife, int maxRenew,
-            int kdcFlags, int keyType, byte[] key, String realmName, SamType samType )
+
+    PrincipalStoreEntry(String commonName, String userId, KerberosPrincipal principal, int keyVersionNumber,
+        KerberosTime validStart, KerberosTime validEnd, KerberosTime passwordEnd, int maxLife, int maxRenew,
+        int kdcFlags, int keyType, byte[] key, String realmName, SamType samType)
     {
         this.commonName = commonName;
         this.userId = userId;
@@ -63,60 +66,72 @@
         this.key = new EncryptionKey( EncryptionType.getTypeByOrdinal( keyType ), key, keyVersionNumber );
     }
 
+
     public String getCommonName()
     {
         return commonName;
     }
 
+
     public String getUserId()
     {
         return userId;
     }
 
+
     public EncryptionKey getEncryptionKey()
     {
         return key;
     }
 
+
     public int getKDCFlags()
     {
         return kdcFlags;
     }
 
+
     public int getMaxLife()
     {
         return maxLife;
     }
 
+
     public int getMaxRenew()
     {
         return maxRenew;
     }
 
+
     public KerberosTime getPasswordEnd()
     {
         return passwordEnd;
     }
 
+
     public KerberosPrincipal getPrincipal()
     {
         return principal;
     }
 
+
     public String getRealmName()
     {
         return realmName;
     }
 
+
     public KerberosTime getValidEnd()
     {
         return validEnd;
     }
 
+
     public KerberosTime getValidStart()
     {
         return validStart;
     }
+
 
     public SamType getSamType()
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStoreEntryModifier.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStoreEntryModifier.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStoreEntryModifier.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/PrincipalStoreEntryModifier.java Fri Feb 10 02:48:07 2006
@@ -16,11 +16,13 @@
  */
 package org.apache.kerberos.store;
 
+
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.kerberos.messages.value.KerberosTime;
 import org.apache.kerberos.messages.value.SamType;
 
+
 public class PrincipalStoreEntryModifier
 {
     // principal
@@ -45,76 +47,91 @@
     private SamType samType;
     private byte[] key;
 
+
     public PrincipalStoreEntry getEntry()
     {
         return new PrincipalStoreEntry( commonName, userId, principal, keyVersionNumber, validStart, validEnd,
-                passwordEnd, maxLife, maxRenew, kdcFlags, encryptionType, key, realmName, samType );
+            passwordEnd, maxLife, maxRenew, kdcFlags, encryptionType, key, realmName, samType );
     }
 
+
     public void setCommonName( String commonName )
     {
         this.commonName = commonName;
     }
 
+
     public void setUserId( String userId )
     {
         this.userId = userId;
     }
 
+
     public void setEncryptionType( int encryptionType )
     {
         this.encryptionType = encryptionType;
     }
 
+
     public void setKDCFlags( int kdcFlags )
     {
         this.kdcFlags = kdcFlags;
     }
 
+
     public void setKey( byte[] key )
     {
         this.key = key;
     }
 
+
     public void setKeyVersionNumber( int keyVersionNumber )
     {
         this.keyVersionNumber = keyVersionNumber;
     }
 
+
     public void setMaxLife( int maxLife )
     {
         this.maxLife = maxLife;
     }
 
+
     public void setMaxRenew( int maxRenew )
     {
         this.maxRenew = maxRenew;
     }
 
+
     public void setPasswordEnd( KerberosTime passwordEnd )
     {
         this.passwordEnd = passwordEnd;
     }
 
+
     public void setPrincipal( KerberosPrincipal principal )
     {
         this.principal = principal;
     }
 
+
     public void setRealmName( String realmName )
     {
         this.realmName = realmName;
     }
 
+
     public void setValidEnd( KerberosTime validEnd )
     {
         this.validEnd = validEnd;
     }
 
+
     public void setValidStart( KerberosTime validStart )
     {
         this.validStart = validStart;
     }
+
 
     public void setSamType( SamType samType )
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/SingleBaseSearch.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/SingleBaseSearch.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/SingleBaseSearch.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/SingleBaseSearch.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.kerberos.store;
 
+
 import java.util.Hashtable;
 
 import javax.naming.Context;
@@ -35,6 +36,7 @@
 import org.apache.kerberos.store.operations.GetAllPrincipals;
 import org.apache.kerberos.store.operations.GetPrincipal;
 
+
 /**
  * A JNDI-backed search strategy implementation.  This search strategy searches a
  * single base DN for Kerberos principals.
@@ -46,7 +48,8 @@
 {
     private DirContext ctx;
 
-    SingleBaseSearch( ServiceConfiguration config, InitialContextFactory factory )
+
+    SingleBaseSearch(ServiceConfiguration config, InitialContextFactory factory)
     {
         Hashtable env = new Hashtable( config.toJndiEnvironment() );
         env.put( Context.INITIAL_CONTEXT_FACTORY, config.getInitialContextFactory() );
@@ -54,39 +57,45 @@
 
         try
         {
-            ctx = (DirContext) factory.getInitialContext( env );
+            ctx = ( DirContext ) factory.getInitialContext( env );
         }
         catch ( NamingException ne )
         {
-            String message = "Failed to get initial context " + (String) env.get( Context.PROVIDER_URL );
+            String message = "Failed to get initial context " + ( String ) env.get( Context.PROVIDER_URL );
             throw new ConfigurationException( message, ne );
         }
     }
 
+
     public String addPrincipal( PrincipalStoreEntry entry ) throws Exception
     {
-        return (String) execute( new AddPrincipal( entry ) );
+        return ( String ) execute( new AddPrincipal( entry ) );
     }
 
+
     public String deletePrincipal( KerberosPrincipal principal ) throws Exception
     {
-        return (String) execute( new DeletePrincipal( principal ) );
+        return ( String ) execute( new DeletePrincipal( principal ) );
     }
 
+
     public PrincipalStoreEntry[] getAllPrincipals( String realm ) throws Exception
     {
-        return (PrincipalStoreEntry[]) execute( new GetAllPrincipals() );
+        return ( PrincipalStoreEntry[] ) execute( new GetAllPrincipals() );
     }
 
+
     public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception
     {
-        return (PrincipalStoreEntry) execute( new GetPrincipal( principal ) );
+        return ( PrincipalStoreEntry ) execute( new GetPrincipal( principal ) );
     }
 
+
     public String changePassword( KerberosPrincipal principal, KerberosKey newKey ) throws Exception
     {
-        return (String) execute( new ChangePassword( principal, newKey ) );
+        return ( String ) execute( new ChangePassword( principal, newKey ) );
     }
+
 
     private Object execute( ContextOperation operation ) throws Exception
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/AddPrincipal.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/AddPrincipal.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/AddPrincipal.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/AddPrincipal.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.kerberos.store.operations;
 
+
 import javax.naming.Name;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
@@ -32,6 +33,7 @@
 import org.apache.directory.shared.ldap.name.LdapName;
 import org.apache.kerberos.store.PrincipalStoreEntry;
 
+
 /**
  * Command for adding a principal to a JNDI context.
  *
@@ -45,13 +47,15 @@
     /** The Kerberos principal who is to be added. */
     protected PrincipalStoreEntry entry;
 
+
     /**
      * Creates the action to be used against the embedded ApacheDS DIT.
      */
-    public AddPrincipal( PrincipalStoreEntry entry )
+    public AddPrincipal(PrincipalStoreEntry entry)
     {
         this.entry = entry;
     }
+
 
     public Object execute( DirContext ctx, Name searchBaseDn )
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/ChangePassword.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/ChangePassword.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/ChangePassword.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/ChangePassword.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.store.operations;
 
+
 import java.util.Properties;
 
 import javax.naming.CompoundName;
@@ -35,6 +36,7 @@
 import org.apache.directory.server.protocol.shared.store.ContextOperation;
 import org.apache.kerberos.store.KerberosAttribute;
 
+
 /**
  * Command for changing a principal's password in a JNDI context.
  *
@@ -50,15 +52,17 @@
     /** The new key for the update. */
     protected KerberosKey newKey;
 
+
     /**
      * Creates the action to be used against the embedded ApacheDS DIT.
      */
-    public ChangePassword( KerberosPrincipal principal, KerberosKey newKey )
+    public ChangePassword(KerberosPrincipal principal, KerberosKey newKey)
     {
         this.principal = principal;
         this.newKey = newKey;
     }
 
+
     public Object execute( DirContext ctx, Name searchBaseDn )
     {
         if ( principal == null )
@@ -66,9 +70,9 @@
             return null;
         }
 
-        ModificationItem[] mods = new ModificationItem[ 1 ];
+        ModificationItem[] mods = new ModificationItem[1];
         Attribute newKeyAttribute = new BasicAttribute( "krb5key", newKey.getEncoded() );
-        mods[ 0 ] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, newKeyAttribute );
+        mods[0] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, newKeyAttribute );
 
         String dn = null;
 
@@ -86,10 +90,11 @@
         return dn;
     }
 
+
     private String search( DirContext ctx, String principal ) throws NamingException
     {
-        String[] attrIDs = { KerberosAttribute.PRINCIPAL, KerberosAttribute.VERSION, KerberosAttribute.TYPE,
-                KerberosAttribute.KEY };
+        String[] attrIDs =
+            { KerberosAttribute.PRINCIPAL, KerberosAttribute.VERSION, KerberosAttribute.TYPE, KerberosAttribute.KEY };
 
         Attributes matchAttrs = new BasicAttributes( false ); // case-sensitive
         matchAttrs.put( new BasicAttribute( KerberosAttribute.PRINCIPAL, principal ) );
@@ -98,7 +103,7 @@
 
         if ( answer.hasMore() )
         {
-            SearchResult sr = (SearchResult) answer.next();
+            SearchResult sr = ( SearchResult ) answer.next();
             if ( sr != null )
             {
                 return sr.getName();
@@ -107,6 +112,7 @@
 
         return null;
     }
+
 
     private Name getRelativeName( String nameInNamespace, String baseDn ) throws NamingException
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/DeletePrincipal.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/DeletePrincipal.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/DeletePrincipal.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/DeletePrincipal.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.kerberos.store.operations;
 
+
 import java.util.Properties;
 
 import javax.naming.CompoundName;
@@ -33,6 +34,7 @@
 import org.apache.directory.server.protocol.shared.store.ContextOperation;
 import org.apache.kerberos.store.KerberosAttribute;
 
+
 /**
  * Command for deleting a principal from a JNDI context.
  *
@@ -46,14 +48,16 @@
     /** The Kerberos principal who is to be deleted. */
     protected KerberosPrincipal principal;
 
+
     /**
      * Creates the action to be used against the embedded ApacheDS DIT.
      */
-    public DeletePrincipal( KerberosPrincipal principal )
+    public DeletePrincipal(KerberosPrincipal principal)
     {
         this.principal = principal;
     }
 
+
     public Object execute( DirContext ctx, Name searchBaseDn )
     {
         if ( principal == null )
@@ -78,10 +82,11 @@
         return dn;
     }
 
+
     private String search( DirContext ctx, Name searchBaseDn, String principal ) throws NamingException
     {
-        String[] attrIDs = { KerberosAttribute.PRINCIPAL, KerberosAttribute.VERSION, KerberosAttribute.TYPE,
-                KerberosAttribute.KEY };
+        String[] attrIDs =
+            { KerberosAttribute.PRINCIPAL, KerberosAttribute.VERSION, KerberosAttribute.TYPE, KerberosAttribute.KEY };
 
         Attributes matchAttrs = new BasicAttributes( false ); // case-sensitive
         matchAttrs.put( new BasicAttribute( KerberosAttribute.PRINCIPAL, principal ) );
@@ -91,7 +96,7 @@
 
         if ( answer.hasMore() )
         {
-            SearchResult sr = (SearchResult) answer.next();
+            SearchResult sr = ( SearchResult ) answer.next();
             if ( sr != null )
             {
                 return sr.getName();
@@ -100,6 +105,7 @@
 
         return null;
     }
+
 
     private Name getRelativeName( DirContext ctx, String baseDn ) throws NamingException
     {

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/GetAllPrincipals.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/GetAllPrincipals.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/GetAllPrincipals.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/GetAllPrincipals.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.kerberos.store.operations;
 
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -35,6 +36,7 @@
 import org.apache.kerberos.store.PrincipalStoreEntry;
 import org.apache.kerberos.store.PrincipalStoreEntryModifier;
 
+
 /**
  * Command for getting all principals in a JNDI context.
  *
@@ -45,6 +47,7 @@
 {
     private static final long serialVersionUID = -1214321426487445132L;
 
+
     public Object execute( DirContext ctx, Name searchBaseDn )
     {
         SearchControls controls = new SearchControls();
@@ -61,7 +64,7 @@
 
             while ( answer.hasMore() )
             {
-                SearchResult result = (SearchResult) answer.next();
+                SearchResult result = ( SearchResult ) answer.next();
                 attrs = result.getAttributes();
                 PrincipalStoreEntry entry = getEntry( attrs );
                 System.out.println( "Result name is " + result.getName() );
@@ -70,9 +73,9 @@
 
             answer.close();
 
-            PrincipalStoreEntry[] entries = new PrincipalStoreEntry[ answers.size() ];
+            PrincipalStoreEntry[] entries = new PrincipalStoreEntry[answers.size()];
 
-            return (PrincipalStoreEntry[]) answers.toArray( entries );
+            return ( PrincipalStoreEntry[] ) answers.toArray( entries );
         }
         catch ( NamingException e )
         {
@@ -82,6 +85,7 @@
         }
     }
 
+
     /**
      * Marshals an a PrincipalStoreEntry from an Attributes object.
      *
@@ -93,20 +97,20 @@
     {
         PrincipalStoreEntryModifier modifier = new PrincipalStoreEntryModifier();
 
-        String principal = (String) attrs.get( KerberosAttribute.PRINCIPAL ).get();
-        String encryptionType = (String) attrs.get( KerberosAttribute.TYPE ).get();
-        String keyVersionNumber = (String) attrs.get( KerberosAttribute.VERSION ).get();
+        String principal = ( String ) attrs.get( KerberosAttribute.PRINCIPAL ).get();
+        String encryptionType = ( String ) attrs.get( KerberosAttribute.TYPE ).get();
+        String keyVersionNumber = ( String ) attrs.get( KerberosAttribute.VERSION ).get();
 
-        String commonName = (String) attrs.get( "cn" ).get();
+        String commonName = ( String ) attrs.get( "cn" ).get();
 
         if ( attrs.get( "apacheSamType" ) != null )
         {
-            String samType = (String) attrs.get( "apacheSamType" ).get();
+            String samType = ( String ) attrs.get( "apacheSamType" ).get();
 
             modifier.setSamType( SamType.getTypeByOrdinal( Integer.parseInt( samType ) ) );
         }
 
-        byte[] keyBytes = (byte[]) attrs.get( KerberosAttribute.KEY ).get();
+        byte[] keyBytes = ( byte[] ) attrs.get( KerberosAttribute.KEY ).get();
 
         modifier.setCommonName( commonName );
         modifier.setPrincipal( new KerberosPrincipal( principal ) );

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/GetPrincipal.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/GetPrincipal.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/GetPrincipal.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/GetPrincipal.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.store.operations;
 
+
 import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
@@ -32,6 +33,7 @@
 import org.apache.kerberos.store.PrincipalStoreEntry;
 import org.apache.kerberos.store.PrincipalStoreEntryModifier;
 
+
 /**
  * Encapsulates the action of looking up a principal in an embedded ApacheDS DIT.
  *
@@ -45,14 +47,16 @@
     /** The name of the principal to get. */
     private final KerberosPrincipal principal;
 
+
     /**
      * Creates the action to be used against the embedded ApacheDS DIT.
      */
-    public GetPrincipal( KerberosPrincipal principal )
+    public GetPrincipal(KerberosPrincipal principal)
     {
         this.principal = principal;
     }
 
+
     /**
      * Note that the base is a relative path from the existing context.
      * It is not a DN.
@@ -64,8 +68,9 @@
             return null;
         }
 
-        String[] attrIDs = { KerberosAttribute.PRINCIPAL, KerberosAttribute.VERSION, KerberosAttribute.TYPE,
-                KerberosAttribute.KEY, KerberosAttribute.SAM_TYPE };
+        String[] attrIDs =
+            { KerberosAttribute.PRINCIPAL, KerberosAttribute.VERSION, KerberosAttribute.TYPE, KerberosAttribute.KEY,
+                KerberosAttribute.SAM_TYPE };
 
         Attributes matchAttrs = new BasicAttributes( false ); // case-sensitive
         matchAttrs.put( new BasicAttribute( KerberosAttribute.PRINCIPAL, principal.getName() ) );
@@ -78,7 +83,7 @@
 
             if ( answer.hasMore() )
             {
-                SearchResult result = (SearchResult) answer.next();
+                SearchResult result = ( SearchResult ) answer.next();
 
                 Attributes attrs = result.getAttributes();
 
@@ -98,6 +103,7 @@
         return entry;
     }
 
+
     /**
      * Marshals an a PrincipalStoreEntry from an Attributes object.
      *
@@ -108,13 +114,13 @@
     private PrincipalStoreEntry getEntry( Attributes attrs ) throws NamingException
     {
         PrincipalStoreEntryModifier modifier = new PrincipalStoreEntryModifier();
-        String principal = (String) attrs.get( KerberosAttribute.PRINCIPAL ).get();
-        String encryptionType = (String) attrs.get( KerberosAttribute.TYPE ).get();
-        String keyVersionNumber = (String) attrs.get( KerberosAttribute.VERSION ).get();
+        String principal = ( String ) attrs.get( KerberosAttribute.PRINCIPAL ).get();
+        String encryptionType = ( String ) attrs.get( KerberosAttribute.TYPE ).get();
+        String keyVersionNumber = ( String ) attrs.get( KerberosAttribute.VERSION ).get();
 
         if ( attrs.get( KerberosAttribute.SAM_TYPE ) != null )
         {
-            String samType = (String) attrs.get( KerberosAttribute.SAM_TYPE ).get();
+            String samType = ( String ) attrs.get( KerberosAttribute.SAM_TYPE ).get();
             modifier.setSamType( SamType.getTypeByOrdinal( Integer.parseInt( samType ) ) );
         }
 
@@ -127,7 +133,7 @@
             throw new NamingException( msg );
         }
 
-        keyBytes = (byte[]) key;
+        keyBytes = ( byte[] ) key;
         modifier.setKey( keyBytes );
 
         modifier.setPrincipal( new KerberosPrincipal( principal ) );

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/PrincipalObjectFactory.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/PrincipalObjectFactory.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/PrincipalObjectFactory.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/PrincipalObjectFactory.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.kerberos.store.operations;
 
+
 import java.util.Hashtable;
 
 import javax.naming.Context;
@@ -28,6 +29,7 @@
 import org.apache.kerberos.store.KerberosAttribute;
 import org.apache.kerberos.store.PrincipalStoreEntryModifier;
 
+
 /**
  * An ObjectFactory that resusitates objects from directory attributes.
  *
@@ -36,31 +38,33 @@
  */
 public class PrincipalObjectFactory implements DirObjectFactory
 {
-    public Object getObjectInstance( Object obj, Name name, Context nameCtx, Hashtable environment, Attributes attrs ) throws Exception
+    public Object getObjectInstance( Object obj, Name name, Context nameCtx, Hashtable environment, Attributes attrs )
+        throws Exception
     {
-        if ( attrs == null || attrs.get( "objectClass" ) == null || ! attrs.get( "objectClass" ).contains( "krb5KDCEntry" ) )
+        if ( attrs == null || attrs.get( "objectClass" ) == null
+            || !attrs.get( "objectClass" ).contains( "krb5KDCEntry" ) )
         {
             return null;
         }
-        
+
         PrincipalStoreEntryModifier modifier = new PrincipalStoreEntryModifier();
-        
+
         modifier.setUserId( ( String ) attrs.get( "uid" ).get() );
         modifier.setCommonName( ( String ) attrs.get( "cn" ).get() );
-        
+
         KerberosPrincipal principal = new KerberosPrincipal( ( String ) attrs.get( KerberosAttribute.PRINCIPAL ).get() );
         modifier.setPrincipal( principal );
-        
+
         modifier.setKey( ( byte[] ) attrs.get( KerberosAttribute.KEY ).get() );
         modifier.setEncryptionType( Integer.parseInt( ( String ) attrs.get( KerberosAttribute.TYPE ).get() ) );
         modifier.setKeyVersionNumber( Integer.parseInt( ( String ) attrs.get( KerberosAttribute.VERSION ).get() ) );
-        
+
         return modifier.getEntry();
     }
-    
+
+
     public Object getObjectInstance( Object obj, Name name, Context nameCtx, Hashtable environment ) throws Exception
     {
         throw new UnsupportedOperationException( "Attributes are required to add an entry." );
     }
 }
-

Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/PrincipalStateFactory.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/PrincipalStateFactory.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/PrincipalStateFactory.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/store/operations/PrincipalStateFactory.java Fri Feb 10 02:48:07 2006
@@ -17,6 +17,7 @@
 
 package org.apache.kerberos.store.operations;
 
+
 import java.util.Hashtable;
 
 import javax.naming.Context;
@@ -32,6 +33,7 @@
 import org.apache.kerberos.store.KerberosAttribute;
 import org.apache.kerberos.store.PrincipalStoreEntry;
 
+
 /**
  * A StateFactory for a server profile.
  *
@@ -41,111 +43,111 @@
 public class PrincipalStateFactory implements DirStateFactory
 {
     public Result getStateToBind( Object obj, Name name, Context nameCtx, Hashtable environment, Attributes inAttrs )
-    		throws NamingException
+        throws NamingException
     {
         // Only interested in PrincipalStoreEntry objects
         if ( obj instanceof PrincipalStoreEntry )
         {
-	        Attributes outAttrs;
-	        if (inAttrs == null)
-	        {
-	            outAttrs = new BasicAttributes(true);
-	        }
-	        else
-	        {
-	            outAttrs = (Attributes) inAttrs.clone();
-	        }
-	        
-	        // process the objectClass attribute
-	        Attribute oc = outAttrs.get( "objectClass" );
-	
-	        if ( oc == null )
-	        {
-	            oc = new BasicAttribute( "objectClass" );
-	            outAttrs.put( oc );
-	        }
-	
-	        if ( ! oc.contains( "top" ) )
-	        {
-	            oc.add( "top" );
-	        }
-	        
-	        PrincipalStoreEntry p = (PrincipalStoreEntry) obj;
-	        
-	        if ( ! oc.contains( "uidObject" ) )
-	        {
-	            oc.add( "uidObject" );
-	            if ( p.getUserId() != null )
-	            {
-	                outAttrs.put( "uid", p.getUserId() );
-	            }
-	            else
-	            {
-	                throw new SchemaViolationException( "Person must have uid." );
-	            }
-	        }
-	        
-	        if ( ! oc.contains( "extensibleObject" ) )
-	        {
-	            oc.add( "extensibleObject" );
-	            outAttrs.put( "apacheSamType", "7" );
-	        }
-	
-	        if ( ! oc.contains( "person" ) )
-	        {
-	            oc.add( "person" );
-	            
-	            // TODO - look into adding sn, gn, and cn to ServerProfiles
-	            outAttrs.put( "sn", p.getUserId() );
-	            outAttrs.put( "cn", p.getCommonName() );
-	        }
-	
-	        if ( ! oc.contains( "organizationalPerson" ) )
-	        {
-	            oc.add( "organizationalPerson" );
-	        }
-	
-	        if ( ! oc.contains( "inetOrgPerson" ) )
-	        {
-	            oc.add( "inetOrgPerson" );
-	        }
-	        
-	        if ( ! oc.contains( "krb5Principal" ) )
-	        {
-	            oc.add( "krb5Principal" );
-	        }
-	        
-	        if ( ! oc.contains( "krb5KDCEntry" ) )
-	        {
-	            oc.add( "krb5KDCEntry" );
-	            
-	            String principal = p.getPrincipal().getName();
-	            byte[] keyBytes  = p.getEncryptionKey().getKeyValue();
-	            int keyType      = p.getEncryptionKey().getKeyType().getOrdinal();
-	            int keyVersion   = p.getEncryptionKey().getKeyVersion();
-	            
-	            outAttrs.put( KerberosAttribute.PRINCIPAL, principal );
-	            outAttrs.put( KerberosAttribute.KEY, keyBytes );
-	            outAttrs.put( KerberosAttribute.TYPE, Integer.toString( keyType ) );
-	            outAttrs.put( KerberosAttribute.VERSION, Integer.toString( keyVersion ) );
-	        }
-	        
-	        Result r = new Result( obj, outAttrs );
-	        
-	        System.out.println( "Result from obj " + obj );
-	        System.out.println( "Result attrs " + outAttrs );
-	        
-	        return r;
+            Attributes outAttrs;
+            if ( inAttrs == null )
+            {
+                outAttrs = new BasicAttributes( true );
+            }
+            else
+            {
+                outAttrs = ( Attributes ) inAttrs.clone();
+            }
+
+            // process the objectClass attribute
+            Attribute oc = outAttrs.get( "objectClass" );
+
+            if ( oc == null )
+            {
+                oc = new BasicAttribute( "objectClass" );
+                outAttrs.put( oc );
+            }
+
+            if ( !oc.contains( "top" ) )
+            {
+                oc.add( "top" );
+            }
+
+            PrincipalStoreEntry p = ( PrincipalStoreEntry ) obj;
+
+            if ( !oc.contains( "uidObject" ) )
+            {
+                oc.add( "uidObject" );
+                if ( p.getUserId() != null )
+                {
+                    outAttrs.put( "uid", p.getUserId() );
+                }
+                else
+                {
+                    throw new SchemaViolationException( "Person must have uid." );
+                }
+            }
+
+            if ( !oc.contains( "extensibleObject" ) )
+            {
+                oc.add( "extensibleObject" );
+                outAttrs.put( "apacheSamType", "7" );
+            }
+
+            if ( !oc.contains( "person" ) )
+            {
+                oc.add( "person" );
+
+                // TODO - look into adding sn, gn, and cn to ServerProfiles
+                outAttrs.put( "sn", p.getUserId() );
+                outAttrs.put( "cn", p.getCommonName() );
+            }
+
+            if ( !oc.contains( "organizationalPerson" ) )
+            {
+                oc.add( "organizationalPerson" );
+            }
+
+            if ( !oc.contains( "inetOrgPerson" ) )
+            {
+                oc.add( "inetOrgPerson" );
+            }
+
+            if ( !oc.contains( "krb5Principal" ) )
+            {
+                oc.add( "krb5Principal" );
+            }
+
+            if ( !oc.contains( "krb5KDCEntry" ) )
+            {
+                oc.add( "krb5KDCEntry" );
+
+                String principal = p.getPrincipal().getName();
+                byte[] keyBytes = p.getEncryptionKey().getKeyValue();
+                int keyType = p.getEncryptionKey().getKeyType().getOrdinal();
+                int keyVersion = p.getEncryptionKey().getKeyVersion();
+
+                outAttrs.put( KerberosAttribute.PRINCIPAL, principal );
+                outAttrs.put( KerberosAttribute.KEY, keyBytes );
+                outAttrs.put( KerberosAttribute.TYPE, Integer.toString( keyType ) );
+                outAttrs.put( KerberosAttribute.VERSION, Integer.toString( keyVersion ) );
+            }
+
+            Result r = new Result( obj, outAttrs );
+
+            System.out.println( "Result from obj " + obj );
+            System.out.println( "Result attrs " + outAttrs );
+
+            return r;
         }
-        
+
         System.out.println( "ERROR:  entry was not correct type " + obj );
         return null;
     }
-    
+
+
     public Object getStateToBind( Object obj, Name name, Context nameCtx, Hashtable environment )
-    		throws NamingException
+        throws NamingException
     {
         throw new UnsupportedOperationException( "Structural objectClass needed with additional attributes!" );
     }
 }
-

Modified: directory/sandbox/akarasulu/rc1/apacheds/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordConfiguration.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.directory.server.changepw;
 
+
 import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.HashMap;
@@ -31,6 +32,7 @@
 import org.apache.directory.server.protocol.shared.ServiceConfiguration;
 import org.apache.kerberos.crypto.encryption.EncryptionType;
 
+
 public class ChangePasswordConfiguration extends ServiceConfiguration
 {
     private static final long serialVersionUID = 3509208713288140629L;
@@ -54,7 +56,8 @@
     private static final String ENCRYPTION_TYPES_KEY = "encryption.types";
 
     /** the default encryption types */
-    public static final String[] DEFAULT_ENCRYPTION_TYPES = new String[] { "des-cbc-md5" };
+    public static final String[] DEFAULT_ENCRYPTION_TYPES = new String[]
+        { "des-cbc-md5" };
 
     /** the prop key const for allowable.clockskew */
     private static final String ALLOWABLE_CLOCKSKEW_KEY = "allowable.clockskew";
@@ -84,6 +87,7 @@
 
     private EncryptionType[] encryptionTypes;
 
+
     /**
      * Creates a new instance with default settings.
      */
@@ -92,22 +96,25 @@
         this( getDefaultConfig(), LoadStrategy.LDAP );
     }
 
+
     /**
      * Creates a new instance with default settings that operates on the
      * {@link DirectoryService} with the specified ID.
      */
-    public ChangePasswordConfiguration( String instanceId )
+    public ChangePasswordConfiguration(String instanceId)
     {
         this( getDefaultConfig(), LoadStrategy.LDAP );
         setInstanceId( instanceId );
     }
 
-    public ChangePasswordConfiguration( Map properties )
+
+    public ChangePasswordConfiguration(Map properties)
     {
         this( properties, LoadStrategy.LDAP );
     }
 
-    public ChangePasswordConfiguration( Map properties, int strategy )
+
+    public ChangePasswordConfiguration(Map properties, int strategy)
     {
         if ( properties == null )
         {
@@ -128,6 +135,7 @@
         prepareEncryptionTypes();
     }
 
+
     public static Map getDefaultConfig()
     {
         Map defaults = new HashMap();
@@ -138,11 +146,12 @@
         return defaults;
     }
 
+
     public boolean isDifferent( Dictionary config )
     {
         int port = getPort();
 
-        if ( port == Integer.parseInt( (String) config.get( IP_PORT_KEY ) ) )
+        if ( port == Integer.parseInt( ( String ) config.get( IP_PORT_KEY ) ) )
         {
             return false;
         }
@@ -150,11 +159,13 @@
         return true;
     }
 
+
     public String getName()
     {
         return DEFAULT_NAME;
     }
 
+
     public int getPort()
     {
         String key = IP_PORT_KEY;
@@ -167,6 +178,7 @@
         return Integer.parseInt( DEFAULT_IP_PORT );
     }
 
+
     public String getPrimaryRealm()
     {
         String key = REALM_KEY;
@@ -179,11 +191,13 @@
         return DEFAULT_REALM;
     }
 
+
     public EncryptionType[] getEncryptionTypes()
     {
         return encryptionTypes;
     }
 
+
     public Map getProperties()
     {
         // Request that the krb5key value be returned as binary
@@ -192,6 +206,7 @@
         return configuration;
     }
 
+
     public long getClockSkew()
     {
         String key = ALLOWABLE_CLOCKSKEW_KEY;
@@ -204,6 +219,7 @@
         return DEFAULT_ALLOWABLE_CLOCKSKEW;
     }
 
+
     public int getBufferSize()
     {
         String key = BUFFER_SIZE_KEY;
@@ -216,6 +232,7 @@
         return DEFAULT_BUFFER_SIZE;
     }
 
+
     public KerberosPrincipal getChangepwPrincipal()
     {
         String key = PRINCIPAL_KEY;
@@ -228,6 +245,7 @@
         return new KerberosPrincipal( DEFAULT_PRINCIPAL );
     }
 
+
     public boolean isEmptyAddressesAllowed()
     {
         String key = EMPTY_ADDRESSES_ALLOWED_KEY;
@@ -240,6 +258,7 @@
         return DEFAULT_EMPTY_ADDRESSES_ALLOWED;
     }
 
+
     public int getPasswordLengthPolicy()
     {
         String key = PASSWORD_LENGTH_KEY;
@@ -252,6 +271,7 @@
         return DEFAULT_PASSWORD_LENGTH;
     }
 
+
     public int getCategoryCountPolicy()
     {
         String key = CATEGORY_COUNT_KEY;
@@ -264,6 +284,7 @@
         return DEFAULT_CATEGORY_COUNT;
     }
 
+
     public int getTokenSizePolicy()
     {
         String key = TOKEN_SIZE_KEY;
@@ -276,6 +297,7 @@
         return DEFAULT_TOKEN_SIZE;
     }
 
+
     private void prepareEncryptionTypes()
     {
         String[] encryptionTypeStrings = null;
@@ -295,13 +317,13 @@
 
         for ( int ii = 0; ii < encryptionTypeStrings.length; ii++ )
         {
-            String enc = encryptionTypeStrings[ ii ];
+            String enc = encryptionTypeStrings[ii];
 
             Iterator it = EncryptionType.VALUES.iterator();
 
             while ( it.hasNext() )
             {
-                EncryptionType type = (EncryptionType) it.next();
+                EncryptionType type = ( EncryptionType ) it.next();
 
                 if ( type.toString().equalsIgnoreCase( enc ) )
                 {
@@ -310,6 +332,6 @@
             }
         }
 
-        encryptionTypes = (EncryptionType[]) encTypes.toArray( new EncryptionType[ encTypes.size() ] );
+        encryptionTypes = ( EncryptionType[] ) encTypes.toArray( new EncryptionType[encTypes.size()] );
     }
 }



Mime
View raw message