directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1235326 [23/28] - in /directory/apacheds/trunk: jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-partitio...
Date Tue, 24 Jan 2012 16:15:29 GMT
Modified: directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java (original)
+++ directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java Tue Jan 24 16:15:05 2012
@@ -79,6 +79,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * An {@link AbstractServerTest} testing SASL GSSAPI authentication
  * and security layer negotiation.  These tests require both the LDAP
@@ -88,51 +89,51 @@ import org.junit.runner.RunWith;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith( FrameworkRunner.class )
-@CreateDS( name="SaslGssapiBindITest-class",
+@RunWith(FrameworkRunner.class)
+@CreateDS(name = "SaslGssapiBindITest-class",
     partitions =
         {
             @CreatePartition(
                 name = "example",
                 suffix = "dc=example,dc=com",
-                contextEntry = @ContextEntry( 
+                contextEntry = @ContextEntry(
                     entryLdif =
-                        "dn: dc=example,dc=com\n" +
+                    "dn: dc=example,dc=com\n" +
                         "dc: example\n" +
                         "objectClass: top\n" +
-                        "objectClass: domain\n\n" ),
-                indexes = 
-                {
-                    @CreateIndex( attribute = "objectClass" ),
-                    @CreateIndex( attribute = "dc" ),
-                    @CreateIndex( attribute = "ou" )
-                } )
-        },
-        additionalInterceptors =
-        {
-                KeyDerivationInterceptor.class
-        })
-@CreateLdapServer ( 
-    transports = 
-    {
-        @CreateTransport( protocol = "LDAP" )
+                        "objectClass: domain\n\n"),
+                indexes =
+                    {
+                        @CreateIndex(attribute = "objectClass"),
+                        @CreateIndex(attribute = "dc"),
+                        @CreateIndex(attribute = "ou")
+                })
     },
-    saslHost="localhost",
-    saslPrincipal="ldap/localhost@EXAMPLE.COM",
-        saslMechanisms = 
-            {
-                @SaslMechanism( name=SupportedSaslMechanisms.PLAIN, implClass=PlainMechanismHandler.class ),
-                @SaslMechanism( name=SupportedSaslMechanisms.CRAM_MD5, implClass=CramMd5MechanismHandler.class),
-                @SaslMechanism( name= SupportedSaslMechanisms.DIGEST_MD5, implClass=DigestMd5MechanismHandler.class),
-                @SaslMechanism( name=SupportedSaslMechanisms.GSSAPI, implClass=GssapiMechanismHandler.class),
-                @SaslMechanism( name=SupportedSaslMechanisms.NTLM, implClass=NtlmMechanismHandler.class),
-                @SaslMechanism( name=SupportedSaslMechanisms.GSS_SPNEGO, implClass=NtlmMechanismHandler.class)
-            })
-@CreateKdcServer ( 
-    transports = 
-    {
-        @CreateTransport( protocol = "UDP", port = 6088 ),
-        @CreateTransport( protocol = "TCP", port = 6088 )
+    additionalInterceptors =
+        {
+            KeyDerivationInterceptor.class
+    })
+@CreateLdapServer(
+    transports =
+        {
+            @CreateTransport(protocol = "LDAP")
+    },
+    saslHost = "localhost",
+    saslPrincipal = "ldap/localhost@EXAMPLE.COM",
+    saslMechanisms =
+        {
+            @SaslMechanism(name = SupportedSaslMechanisms.PLAIN, implClass = PlainMechanismHandler.class),
+            @SaslMechanism(name = SupportedSaslMechanisms.CRAM_MD5, implClass = CramMd5MechanismHandler.class),
+            @SaslMechanism(name = SupportedSaslMechanisms.DIGEST_MD5, implClass = DigestMd5MechanismHandler.class),
+            @SaslMechanism(name = SupportedSaslMechanisms.GSSAPI, implClass = GssapiMechanismHandler.class),
+            @SaslMechanism(name = SupportedSaslMechanisms.NTLM, implClass = NtlmMechanismHandler.class),
+            @SaslMechanism(name = SupportedSaslMechanisms.GSS_SPNEGO, implClass = NtlmMechanismHandler.class)
+    })
+@CreateKdcServer(
+    transports =
+        {
+            @CreateTransport(protocol = "UDP", port = 6088),
+            @CreateTransport(protocol = "TCP", port = 6088)
     })
 public class SaslGssapiBindITest extends AbstractLdapTestUnit
 {
@@ -147,6 +148,7 @@ public class SaslGssapiBindITest extends
     /** the context root for the rootDSE */
     protected CoreSession rootDse;
 
+
     /**
      * Creates a new instance of SaslGssapiBindTest and sets JAAS system properties.
      */
@@ -358,7 +360,7 @@ public class SaslGssapiBindITest extends
 
     }
 
-    
+
     /**
      * Tear down.
      */
@@ -368,7 +370,7 @@ public class SaslGssapiBindITest extends
         ctx.close();
         ctx = null;
     }
-    
+
 
     // copied the below two methods from AbstractServerTest
     /**
@@ -391,7 +393,7 @@ public class SaslGssapiBindITest extends
         setContexts( env );
     }
 
-    
+
     /**
      * Sets the contexts of this class taking into account the extras and overrides
      * properties.  
@@ -411,8 +413,7 @@ public class SaslGssapiBindITest extends
         envFinal.put( Context.PROVIDER_URL, SchemaConstants.OU_SCHEMA );
         schemaRoot = new InitialLdapContext( envFinal, null );
     }
-    
-    
+
     private class CallbackHandlerBean implements CallbackHandler
     {
         private String name;

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/AbstractLdifPartition.java Tue Jan 24 16:15:05 2012
@@ -45,7 +45,7 @@ public abstract class AbstractLdifPartit
     public AbstractLdifPartition( SchemaManager schemaManager )
     {
         super( schemaManager );
-        
+
         // Create the CsnFactory with a invalid ReplicaId
         // @TODO : inject a correct ReplicaId
         defaultCSNFactory = new CsnFactory( 0 );
@@ -60,7 +60,7 @@ public abstract class AbstractLdifPartit
         return 1L;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Tue Jan 24 16:15:05 2012
@@ -134,7 +134,7 @@ public class LdifPartition extends Abstr
         if ( !initialized )
         {
             File partitionDir = new File( getPartitionPath() );
-    
+
             // Initialize the suffixDirectory : it's a composition
             // of the workingDirectory followed by the suffix
             if ( ( suffixDn == null ) || ( suffixDn.isEmpty() ) )
@@ -143,17 +143,17 @@ public class LdifPartition extends Abstr
                 LOG.error( msg );
                 throw new LdapInvalidDnException( msg );
             }
-    
+
             if ( !suffixDn.isSchemaAware() )
             {
                 suffixDn.apply( schemaManager );
             }
-    
+
             String suffixDirName = getFileName( suffixDn );
             suffixDirectory = new File( partitionDir, suffixDirName );
-    
+
             super.doInit();
-    
+
             // Create the context entry now, if it does not exists, or load the
             // existing entries
             if ( suffixDirectory.exists() )
@@ -173,29 +173,29 @@ public class LdifPartition extends Abstr
                     LOG.error( msg );
                     throw se;
                 }
-    
+
                 // And create the context entry too
                 File contextEntryFile = new File( suffixDirectory + CONF_FILE_EXTN );
-    
+
                 LOG.info( "ldif file doesn't exist {}, creating it.", contextEntryFile.getAbsolutePath() );
-    
+
                 if ( contextEntryFile.exists() )
                 {
                     LdifReader reader = new LdifReader( contextEntryFile );
                     Entry contextEntry = new DefaultEntry( schemaManager, reader.next().getEntry() );
                     reader.close();
-                    
+
                     if ( contextEntry.get( SchemaConstants.ENTRY_CSN_AT ) == null )
                     {
                         contextEntry.add( SchemaConstants.ENTRY_CSN_AT, defaultCSNFactory.newInstance().toString() );
                     }
-        
+
                     if ( contextEntry.get( SchemaConstants.ENTRY_UUID_AT ) == null )
                     {
                         String uuid = UUID.randomUUID().toString();
                         contextEntry.add( SchemaConstants.ENTRY_UUID_AT, uuid );
                     }
-        
+
                     // And add this entry to the underlying partition
                     AddOperationContext addContext = new AddOperationContext( null, contextEntry );
                     add( addContext );
@@ -257,7 +257,8 @@ public class LdifPartition extends Abstr
 
         try
         {
-            super.modify( modifyContext.getDn(), modifyContext.getModItems().toArray( new Modification[]{} ) );
+            super.modify( modifyContext.getDn(), modifyContext.getModItems().toArray( new Modification[]
+                {} ) );
         }
         catch ( Exception e )
         {
@@ -275,7 +276,7 @@ public class LdifPartition extends Abstr
         try
         {
             FileWriter fw = new FileWriter( getFile( dn, DELETE ) );
-            fw.write( LdifUtils.convertToLdif(modifiedEntry, true) );
+            fw.write( LdifUtils.convertToLdif( modifiedEntry, true ) );
             fw.close();
         }
         catch ( IOException ioe )
@@ -508,7 +509,7 @@ public class LdifPartition extends Abstr
             // We have to create the entry if it does not have a parent
             if ( !dir.mkdir() )
             {
-                throw new LdapException(I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, dir ) );
+                throw new LdapException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, dir ) );
             }
         }
 
@@ -535,7 +536,7 @@ public class LdifPartition extends Abstr
         StringBuilder fileName = new StringBuilder( "" );
 
         Iterator<Ava> iterator = rdn.iterator();
-        
+
         while ( iterator.hasNext() )
         {
             Ava ava = iterator.next();
@@ -664,7 +665,7 @@ public class LdifPartition extends Abstr
                 case ']': // 0x5D
                 case '|': // 0x7C
                     sb.append( "%" ).append( Strings.dumpHex( ( byte ) ( c >> 4 ) ) )
-                                    .append( Strings.dumpHex( ( byte ) ( c & 0xF ) ) );
+                        .append( Strings.dumpHex( ( byte ) ( c & 0xF ) ) );
                     break;
 
                 default:

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java Tue Jan 24 16:15:05 2012
@@ -95,18 +95,18 @@ public class SingleFileLdifPartition ext
             {
                 throw new IllegalArgumentException( "Partition path cannot be null" );
             }
-    
+
             File partitionFile = new File( getPartitionPath() );
-            
+
             if ( partitionFile.exists() && !partitionFile.isFile() )
             {
                 throw new IllegalArgumentException( "Partition path must be a LDIF file" );
             }
-    
+
             ldifFile = new RandomAccessFile( partitionFile, "rws" );
-    
+
             LOG.debug( "id is : {}", getId() );
-    
+
             // Initialize the suffixDirectory : it's a composition
             // of the workingDirectory followed by the suffix
             if ( ( suffixDn == null ) || ( suffixDn.isEmpty() ) )
@@ -115,14 +115,14 @@ public class SingleFileLdifPartition ext
                 LOG.error( msg );
                 throw new LdapInvalidDnException( msg );
             }
-    
+
             if ( !suffixDn.isSchemaAware() )
             {
                 suffixDn.apply( schemaManager );
             }
-    
+
             super.doInit();
-            
+
             loadEntries();
         }
     }
@@ -202,7 +202,9 @@ public class SingleFileLdifPartition ext
         {
             try
             {
-                Entry modifiedEntry = super.modify( modifyContext.getDn(), modifyContext.getModItems().toArray( new Modification[]{} ) );
+                Entry modifiedEntry = super.modify( modifyContext.getDn(),
+                    modifyContext.getModItems().toArray( new Modification[]
+                        {} ) );
                 modifyContext.setAlteredEntry( modifiedEntry );
             }
             catch ( Exception e )
@@ -291,13 +293,12 @@ public class SingleFileLdifPartition ext
 
                 Long suffixId = getEntryId( suffixDn );
 
-                if( suffixId == null )
+                if ( suffixId == null )
                 {
                     return;
                 }
-                
-                IndexCursor<Long, Entry, Long> cursor = getOneLevelIndex().forwardCursor( suffixId );
 
+                IndexCursor<Long, Entry, Long> cursor = getOneLevelIndex().forwardCursor( suffixId );
 
                 appendLdif( lookup( suffixId ) );
 
@@ -391,7 +392,7 @@ public class SingleFileLdifPartition ext
         synchronized ( lock )
         {
             String ldif = LdifUtils.convertToLdif( entry );
-            ldifFile.write( Strings.getBytesUtf8(ldif + "\n") );
+            ldifFile.write( Strings.getBytesUtf8( ldif + "\n" ) );
         }
     }
 
@@ -461,7 +462,7 @@ public class SingleFileLdifPartition ext
         ldifFile.close();
     }
 
-    
+
     /**
      * enable/disable the re-writing of partition data.
      * This method internally calls the @see {@link #rewritePartitionData()} to save any dirty data if present

Modified: directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/LdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/LdifPartitionTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/LdifPartitionTest.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/LdifPartitionTest.java Tue Jan 24 16:15:05 2012
@@ -115,7 +115,7 @@ public class LdifPartitionTest
 
         if ( !loaded )
         {
-            fail( "Schema load failed : " + Exceptions.printErrors(schemaManager.getErrors()) );
+            fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
         }
 
         defaultCSNFactory = new CsnFactory( 0 );
@@ -138,12 +138,12 @@ public class LdifPartitionTest
         partition.setPartitionPath( wkdir.toURI() );
 
         partition.initialize();
-        
+
         Entry entry = createEntry( "ou=test, ou=system" );
-        
+
         entry.put( "objectClass", "top", "organizationalUnit" );
-        entry.put(  "cn", "test" );
-        
+        entry.put( "cn", "test" );
+
         AddOperationContext addContext = new AddOperationContext( null, entry );
         partition.add( addContext );
 
@@ -175,7 +175,8 @@ public class LdifPartitionTest
     public void testLdifAddEntries() throws Exception
     {
         Dn adminDn = new Dn( schemaManager, "uid=admin,ou=system" );
-        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn, AuthenticationLevel.STRONG ),
+        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn,
+            AuthenticationLevel.STRONG ),
             new MockDirectoryService( 1 ) );
         AddOperationContext addCtx = new AddOperationContext( session );
 
@@ -220,7 +221,8 @@ public class LdifPartitionTest
     public void testLdifAddExistingEntry() throws Exception
     {
         Dn adminDn = new Dn( schemaManager, "uid=admin,ou=system" );
-        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn, AuthenticationLevel.STRONG ),
+        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn,
+            AuthenticationLevel.STRONG ),
             new MockDirectoryService( 1 ) );
         AddOperationContext addCtx = new AddOperationContext( session );
 
@@ -274,7 +276,8 @@ public class LdifPartitionTest
     public void testLdifDeleteExistingEntry() throws Exception
     {
         Dn adminDn = new Dn( schemaManager, "uid=admin,ou=system" );
-        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn, AuthenticationLevel.STRONG ),
+        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn,
+            AuthenticationLevel.STRONG ),
             new MockDirectoryService( 1 ) );
         AddOperationContext addCtx = new AddOperationContext( session );
 
@@ -360,7 +363,8 @@ public class LdifPartitionTest
     public void testLdifSearchExistingEntry() throws Exception
     {
         Dn adminDn = new Dn( schemaManager, "uid=admin,ou=system" );
-        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn, AuthenticationLevel.STRONG ),
+        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn,
+            AuthenticationLevel.STRONG ),
             new MockDirectoryService( 1 ) );
         AddOperationContext addCtx = new AddOperationContext( session );
 
@@ -428,8 +432,10 @@ public class LdifPartitionTest
     {
         CoreSession session = injectEntries();
 
-        Entry childEntry1 = partition.lookup( partition.getEntryId( new Dn( schemaManager, "dc=child1,ou=test,ou=system" ) ) );
-        Entry childEntry2 = partition.lookup( partition.getEntryId( new Dn( schemaManager, "dc=child2,ou=test,ou=system" ) ) );
+        Entry childEntry1 = partition.lookup( partition.getEntryId( new Dn( schemaManager,
+            "dc=child1,ou=test,ou=system" ) ) );
+        Entry childEntry2 = partition.lookup( partition.getEntryId( new Dn( schemaManager,
+            "dc=child2,ou=test,ou=system" ) ) );
 
         MoveOperationContext moveOpCtx = new MoveOperationContext( session, childEntry1.getDn(), childEntry2.getDn() );
         partition.move( moveOpCtx );
@@ -584,7 +590,8 @@ public class LdifPartitionTest
     public void testSpecialCharacters() throws Exception
     {
         Dn adminDn = new Dn( schemaManager, "uid=admin,ou=system" );
-        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn, AuthenticationLevel.STRONG ),
+        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn,
+            AuthenticationLevel.STRONG ),
             new MockDirectoryService( 1 ) );
         AddOperationContext addCtx = new AddOperationContext( session );
 
@@ -612,18 +619,19 @@ public class LdifPartitionTest
     public void testControlCharacters() throws Exception
     {
         Dn adminDn = new Dn( schemaManager, "uid=admin,ou=system" );
-        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn, AuthenticationLevel.STRONG ),
+        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn,
+            AuthenticationLevel.STRONG ),
             new MockDirectoryService( 1 ) );
         AddOperationContext addCtx = new AddOperationContext( session );
 
         String rdnWithControlChars = "userPassword=-\u0000-\u0001-\u0002-\u0003-\u0004-\u0005-\u0006-\u0007" +
-                "-\u0008-\u0009-\n-\u000B-\u000C-\r-\u000E-\u000F" +
-                "-\u0010-\u0011-\u0012-\u0013-\u0014-\u0015-\u0016-\u0017" +
-                "-\u0018-\u0019-\u001A-\u001B-\u001C-\u001D-\u001E-\u001F" +
-                "-\u007F";
+            "-\u0008-\u0009-\n-\u000B-\u000C-\r-\u000E-\u000F" +
+            "-\u0010-\u0011-\u0012-\u0013-\u0014-\u0015-\u0016-\u0017" +
+            "-\u0018-\u0019-\u001A-\u001B-\u001C-\u001D-\u001E-\u001F" +
+            "-\u007F";
 
         String rdnWithEscapedChars = "userpassword=-%00-%01-%02-%03-%04-%05-%06-%07-%08-%09-%0a-%0b-%0c-%0d-%0e-%0f" +
-                "-%10-%11-%12-%13-%14-%15-%16-%17-%18-%19-%1a-%1b-%1c-%1d-%1e-%1f-%7f";
+            "-%10-%11-%12-%13-%14-%15-%16-%17-%18-%19-%1a-%1b-%1c-%1d-%1e-%1f-%7f";
 
         Entry entry1 = createEntry( rdnWithControlChars + ",ou=test,ou=system" );
         entry1.put( "objectClass", "top", "person" );
@@ -643,7 +651,8 @@ public class LdifPartitionTest
     private CoreSession injectEntries() throws Exception
     {
         Dn adminDn = new Dn( schemaManager, "uid=admin,ou=system" );
-        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn, AuthenticationLevel.STRONG ),
+        CoreSession session = new MockCoreSession( new LdapPrincipal( schemaManager, adminDn,
+            AuthenticationLevel.STRONG ),
             new MockDirectoryService( 1 ) );
         AddOperationContext addCtx = new AddOperationContext( session );
 

Modified: directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartitionTest.java Tue Jan 24 16:15:05 2012
@@ -173,7 +173,7 @@ public class SingleFileLdifPartitionTest
         entry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
 
         Entry clonedEntry = new ClonedServerEntry( entry );
-        
+
         return clonedEntry;
     }
 
@@ -181,8 +181,8 @@ public class SingleFileLdifPartitionTest
     private long getEntryLdifLen( Entry entry ) throws LdapException
     {
         // while writing to the file 1 extra newline char will be added
-        String ldif = LdifUtils.convertToLdif(entry) + 1;
-        byte[] data = Strings.getBytesUtf8(ldif);
+        String ldif = LdifUtils.convertToLdif( entry ) + 1;
+        byte[] data = Strings.getBytesUtf8( ldif );
 
         return data.length;
     }
@@ -434,7 +434,7 @@ public class SingleFileLdifPartitionTest
 
         file.read( entry1Data );
 
-        String ldif = Strings.utf8ToString(entry1Data);
+        String ldif = Strings.utf8ToString( entry1Data );
 
         LdifEntry ldifEntry = reader.parseLdif( ldif ).get( 0 );
 
@@ -467,7 +467,7 @@ public class SingleFileLdifPartitionTest
 
         file.read( entry1Data );
 
-        ldif = Strings.utf8ToString(entry1Data);
+        ldif = Strings.utf8ToString( entry1Data );
 
         ldifEntry = reader.parseLdif( ldif ).get( 0 );
 
@@ -683,8 +683,10 @@ public class SingleFileLdifPartitionTest
     {
         SingleFileLdifPartition partition = injectEntries();
 
-        Entry childEntry1 = partition.lookup( partition.getEntryId( new Dn( schemaManager, "dc=child1,ou=test,ou=system" ) ) );
-        Entry childEntry2 = partition.lookup( partition.getEntryId( new Dn( schemaManager, "dc=child2,ou=test,ou=system" ) ) );
+        Entry childEntry1 = partition.lookup( partition.getEntryId( new Dn( schemaManager,
+            "dc=child1,ou=test,ou=system" ) ) );
+        Entry childEntry2 = partition.lookup( partition.getEntryId( new Dn( schemaManager,
+            "dc=child2,ou=test,ou=system" ) ) );
 
         MoveOperationContext moveOpCtx = new MoveOperationContext( mockSession, childEntry1.getDn(),
             childEntry2.getDn() );
@@ -706,8 +708,10 @@ public class SingleFileLdifPartitionTest
     {
         SingleFileLdifPartition partition = injectEntries();
 
-        Entry childEntry1 = partition.lookup( partition.getEntryId( new Dn( schemaManager, "dc=grandChild11,dc=child1,ou=test,ou=system" ) ) );
-        Entry childEntry2 = partition.lookup( partition.getEntryId( new Dn( schemaManager, "dc=child2,ou=test,ou=system" ) ) );
+        Entry childEntry1 = partition.lookup( partition.getEntryId( new Dn( schemaManager,
+            "dc=grandChild11,dc=child1,ou=test,ou=system" ) ) );
+        Entry childEntry2 = partition.lookup( partition.getEntryId( new Dn( schemaManager,
+            "dc=child2,ou=test,ou=system" ) ) );
 
         MoveOperationContext moveOpCtx = new MoveOperationContext( mockSession, childEntry1.getDn(),
             childEntry2.getDn() );
@@ -821,16 +825,16 @@ public class SingleFileLdifPartitionTest
         assertTrue( dc.contains( "child1" ) );
         assertTrue( dc.contains( "movedChild1" ) );
     }
-    
-    
+
+
     @Test
     public void testEnableRewritingFlag() throws Exception
     {
         SingleFileLdifPartition partition = createPartition( null, true );
-        
+
         // disable writing
         partition.setEnableRewriting( false );
-        
+
         AddOperationContext addCtx = new AddOperationContext( mockSession );
         addCtx.setEntry( contextEntry );
 
@@ -848,10 +852,10 @@ public class SingleFileLdifPartitionTest
 
         partition = reloadPartition();
         assertNotExists( partition, contextEntry );
-        
+
         // try adding on the reloaded partition
         partition.add( addCtx );
-        
+
         // eable writing, this will let the partition write data back to disk
         partition.setEnableRewriting( false );
         assertTrue( getEntryLdifLen( contextEntry ) == file.length() );
@@ -871,22 +875,22 @@ public class SingleFileLdifPartitionTest
         SingleFileLdifPartition partition = injectEntries();
 
         ThreadGroup tg = new ThreadGroup( "singlefileldifpartitionTG" );
-        
+
         Thread modifyTask = new Thread( tg, getModifyTask( partition ), "modifyTaskThread" );
         Thread addAndDeleteTask = new Thread( tg, getAddAndDeleteTask( partition ), "addAndDeleteTaskThread" );
         Thread renameTask = new Thread( tg, getRenameTask( partition ), "renameTaskThread" );
         Thread moveTask = new Thread( tg, getMoveTask( partition ), "moveTaskThread" );
-        
+
         modifyTask.start();
         addAndDeleteTask.start();
         renameTask.start();
         moveTask.start();
-        
-        while( tg.activeCount() > 0 )
+
+        while ( tg.activeCount() > 0 )
         {
             Thread.sleep( 2000 );
         }
-        
+
         // tests to be performed after the threads finish their work
         partition = reloadPartition();
 
@@ -917,7 +921,7 @@ public class SingleFileLdifPartitionTest
             public void run()
             {
                 int i = 0;
-                
+
                 try
                 {
                     AddOperationContext addCtx = new AddOperationContext( mockSession );
@@ -977,7 +981,7 @@ public class SingleFileLdifPartitionTest
             public void run()
             {
                 int i = 0;
-                
+
                 try
                 {
                     AddOperationContext addCtx = new AddOperationContext( mockSession );
@@ -1024,7 +1028,7 @@ public class SingleFileLdifPartitionTest
             public void run()
             {
                 int i = 0;
-                
+
                 try
                 {
                     Dn dn = new Dn( schemaManager, "dc=grandChild12,dc=child1,ou=test,ou=system" );
@@ -1063,8 +1067,6 @@ public class SingleFileLdifPartitionTest
 
         return r;
     }
-    
-    
 
 
     /**
@@ -1080,7 +1082,7 @@ public class SingleFileLdifPartitionTest
             public void run()
             {
                 int i = 0;
-                
+
                 try
                 {
                     Dn originalDn = new Dn( schemaManager, "dc=grandChild11,dc=child1,ou=test,ou=system" );

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/DhcpException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/DhcpException.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/DhcpException.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/DhcpException.java Tue Jan 24 16:15:05 2012
@@ -45,7 +45,7 @@ public class DhcpException extends Excep
      * 
      * @param description this is a description of the exception
      */
-    public DhcpException(String description)
+    public DhcpException( String description )
     {
         super( description );
     }
@@ -59,7 +59,7 @@ public class DhcpException extends Excep
      *            this is a description of the exception
      * @param e
      */
-    public DhcpException(String description, Exception e)
+    public DhcpException( String description, Exception e )
     {
         super( description, e );
     }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageEncoder.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageEncoder.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/DhcpMessageEncoder.java Tue Jan 24 16:15:05 2012
@@ -143,7 +143,7 @@ public class DhcpMessageEncoder
             bytes = new byte[]
                 {};
 
-        byteBuffer.put( bytes, 0, Math.min(len, bytes.length) );
+        byteBuffer.put( bytes, 0, Math.min( len, bytes.length ) );
 
         // pad as necessary
         int remain = len - bytes.length;

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/io/package-info.java Tue Jan 24 16:15:05 2012
@@ -26,3 +26,5 @@
  */
 
 package org.apache.directory.server.dhcp.io;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/DhcpMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/DhcpMessage.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/DhcpMessage.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/DhcpMessage.java Tue Jan 24 16:15:05 2012
@@ -20,17 +20,20 @@
 
 package org.apache.directory.server.dhcp.messages;
 
+
 import java.net.InetAddress;
 
 import org.apache.directory.server.dhcp.options.OptionsField;
 
+
 /**
  * A DHCP (RFC 2131) message. Field descriptions contain the oroginal RFC field
  * names in brackets.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DhcpMessage {
+public class DhcpMessage
+{
     /**
      * Flag value: request broadcast answer.
      */
@@ -125,13 +128,16 @@ public class DhcpMessage {
 
     private HardwareAddress hardwareAddress;
 
+
     /**
      * Create a default dhcp message.
      */
-    public DhcpMessage() {
+    public DhcpMessage()
+    {
 
     }
 
+
     /**
      * Create a DHCP message based on the supplied values.
      * 
@@ -150,12 +156,13 @@ public class DhcpMessage {
      * @param bootFileName
      * @param options
      */
-    public DhcpMessage(MessageType messageType, byte op,
-            HardwareAddress hardwareAddress, short hops, int transactionId,
-            int seconds, short flags, InetAddress currentClientAddress,
-            InetAddress assignedClientAddress, InetAddress nextServerAddress,
-            InetAddress relayAgentAddress, String serverHostname,
-            String bootFileName, OptionsField options) {
+    public DhcpMessage( MessageType messageType, byte op,
+        HardwareAddress hardwareAddress, short hops, int transactionId,
+        int seconds, short flags, InetAddress currentClientAddress,
+        InetAddress assignedClientAddress, InetAddress nextServerAddress,
+        InetAddress relayAgentAddress, String serverHostname,
+        String bootFileName, OptionsField options )
+    {
         this.messageType = messageType;
         this.op = op;
         this.hardwareAddress = hardwareAddress;
@@ -172,123 +179,181 @@ public class DhcpMessage {
         this.options = options;
     }
 
-    public InetAddress getAssignedClientAddress() {
+
+    public InetAddress getAssignedClientAddress()
+    {
         return assignedClientAddress;
     }
 
-    public String getBootFileName() {
+
+    public String getBootFileName()
+    {
         return bootFileName;
     }
 
-    public InetAddress getCurrentClientAddress() {
+
+    public InetAddress getCurrentClientAddress()
+    {
         return currentClientAddress;
     }
 
-    public short getFlags() {
+
+    public short getFlags()
+    {
         return flags;
     }
 
-    public short getHopCount() {
+
+    public short getHopCount()
+    {
         return hopCount;
     }
 
-    public MessageType getMessageType() {
+
+    public MessageType getMessageType()
+    {
         return messageType;
     }
 
-    public InetAddress getNextServerAddress() {
+
+    public InetAddress getNextServerAddress()
+    {
         return nextServerAddress;
     }
 
-    public OptionsField getOptions() {
+
+    public OptionsField getOptions()
+    {
         return options;
     }
 
-    public InetAddress getRelayAgentAddress() {
+
+    public InetAddress getRelayAgentAddress()
+    {
         return relayAgentAddress;
     }
 
-    public int getSeconds() {
+
+    public int getSeconds()
+    {
         return seconds;
     }
 
-    public String getServerHostname() {
+
+    public String getServerHostname()
+    {
         return serverHostname;
     }
 
-    public int getTransactionId() {
+
+    public int getTransactionId()
+    {
         return transactionId;
     }
 
-    public void setAssignedClientAddress(InetAddress assignedClientAddress) {
+
+    public void setAssignedClientAddress( InetAddress assignedClientAddress )
+    {
         this.assignedClientAddress = assignedClientAddress;
     }
 
-    public void setBootFileName(String bootFileName) {
+
+    public void setBootFileName( String bootFileName )
+    {
         this.bootFileName = bootFileName;
     }
 
-    public void setCurrentClientAddress(InetAddress currentClientAddress) {
+
+    public void setCurrentClientAddress( InetAddress currentClientAddress )
+    {
         this.currentClientAddress = currentClientAddress;
     }
 
-    public void setFlags(short flags) {
+
+    public void setFlags( short flags )
+    {
         this.flags = flags;
     }
 
-    public void setHopCount(short hopCount) {
+
+    public void setHopCount( short hopCount )
+    {
         this.hopCount = hopCount;
     }
 
-    public void setMessageType(MessageType messageType) {
+
+    public void setMessageType( MessageType messageType )
+    {
         this.messageType = messageType;
     }
 
-    public void setNextServerAddress(InetAddress nextServerAddress) {
+
+    public void setNextServerAddress( InetAddress nextServerAddress )
+    {
         this.nextServerAddress = nextServerAddress;
     }
 
-    public void setOptions(OptionsField options) {
+
+    public void setOptions( OptionsField options )
+    {
         this.options = options;
     }
 
-    public void setRelayAgentAddress(InetAddress relayAgentAddress) {
+
+    public void setRelayAgentAddress( InetAddress relayAgentAddress )
+    {
         this.relayAgentAddress = relayAgentAddress;
     }
 
-    public void setSeconds(int seconds) {
+
+    public void setSeconds( int seconds )
+    {
         this.seconds = seconds;
     }
 
-    public void setServerHostname(String serverHostname) {
+
+    public void setServerHostname( String serverHostname )
+    {
         this.serverHostname = serverHostname;
     }
 
-    public void setTransactionId(int transactionId) {
+
+    public void setTransactionId( int transactionId )
+    {
         this.transactionId = transactionId;
     }
 
-    public byte getOp() {
+
+    public byte getOp()
+    {
         return op;
     }
 
-    public void setOp(byte op) {
+
+    public void setOp( byte op )
+    {
         this.op = op;
     }
 
-    public HardwareAddress getHardwareAddress() {
+
+    public HardwareAddress getHardwareAddress()
+    {
         return hardwareAddress;
     }
 
-    public void setHardwareAddress(HardwareAddress hardwareAddress) {
+
+    public void setHardwareAddress( HardwareAddress hardwareAddress )
+    {
         this.hardwareAddress = hardwareAddress;
     }
 
-    public String toString() {
+
+    public String toString()
+    {
         StringBuilder sb = new StringBuilder();
-        sb.append(messageType).append(": hwAddress=").append(hardwareAddress)
-                .append(", tx=").append(transactionId).append(", options=").append(
-                        options);
+        sb.append( messageType ).append( ": hwAddress=" ).append( hardwareAddress )
+            .append( ", tx=" ).append( transactionId ).append( ", options=" ).append(
+                options );
 
         return sb.toString();
     }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/HardwareAddress.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/HardwareAddress.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/HardwareAddress.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/HardwareAddress.java Tue Jan 24 16:15:05 2012
@@ -56,7 +56,7 @@ public final class HardwareAddress
      * @param length
      * @param address
      */
-    public HardwareAddress(short type, short length, byte[] address)
+    public HardwareAddress( short type, short length, byte[] address )
     {
         this.type = type;
         this.length = length;

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/messages/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.dhcp.messages;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/ByteOption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/ByteOption.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/ByteOption.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/ByteOption.java Tue Jan 24 16:15:05 2012
@@ -20,6 +20,7 @@
 
 package org.apache.directory.server.dhcp.options;
 
+
 /**
  * The Dynamic Host Configuration Protocol (DHCP) provides a framework for
  * passing configuration information to hosts on a TCP/IP network. Configuration
@@ -33,31 +34,41 @@ package org.apache.directory.server.dhcp
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * 
  */
-public abstract class ByteOption extends DhcpOption {
+public abstract class ByteOption extends DhcpOption
+{
     /**
      * The byte value (represented as a short because of the unsignedness).
      */
     private short byteValue;
 
+
     /*
      * @see org.apache.directory.server.dhcp.options.DhcpOption#setData(byte[])
      */
-    public void setData(byte[] data) {
-        byteValue = (short) (data[0] & 0xff);
+    public void setData( byte[] data )
+    {
+        byteValue = ( short ) ( data[0] & 0xff );
     }
 
+
     /*
      * @see org.apache.directory.server.dhcp.options.DhcpOption#getData()
      */
-    public byte[] getData() {
-        return new byte[]{(byte) (byteValue & 0xff)};
+    public byte[] getData()
+    {
+        return new byte[]
+            { ( byte ) ( byteValue & 0xff ) };
     }
 
-    public short getByteValue() {
+
+    public short getByteValue()
+    {
         return byteValue;
     }
 
-    public void setShortValue(short shortValue) {
+
+    public void setShortValue( short shortValue )
+    {
         this.byteValue = shortValue;
     }
 }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/IntOption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/IntOption.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/IntOption.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/IntOption.java Tue Jan 24 16:15:05 2012
@@ -18,6 +18,7 @@
 
 package org.apache.directory.server.dhcp.options;
 
+
 /**
  * The Dynamic Host Configuration Protocol (DHCP) provides a framework for
  * passing configuration information to hosts on a TCP/IP network. Configuration
@@ -29,34 +30,44 @@ package org.apache.directory.server.dhcp
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class IntOption extends DhcpOption {
+public abstract class IntOption extends DhcpOption
+{
     /**
      * The int value (represented as a long because of the unsignedness).
      */
     private long intValue;
 
+
     /*
      * @see org.apache.directory.server.dhcp.options.DhcpOption#setData(byte[])
      */
-    public void setData(byte[] data) {
-        intValue = (data[0] & 0xff) << 24 | (data[1] & 0xff) << 16
-                | (data[2] & 0xff) << 8 | (data[3] & 0xff);
+    public void setData( byte[] data )
+    {
+        intValue = ( data[0] & 0xff ) << 24 | ( data[1] & 0xff ) << 16
+            | ( data[2] & 0xff ) << 8 | ( data[3] & 0xff );
     }
 
+
     /*
      * @see org.apache.directory.server.dhcp.options.DhcpOption#getData()
      */
-    public byte[] getData() {
-        return new byte[]{(byte) (intValue >> 24 & 0xff),
-                (byte) (intValue >> 16 & 0xff), (byte) (intValue >> 8 & 0xff),
-                (byte) (intValue & 0xff)};
+    public byte[] getData()
+    {
+        return new byte[]
+            { ( byte ) ( intValue >> 24 & 0xff ),
+                ( byte ) ( intValue >> 16 & 0xff ), ( byte ) ( intValue >> 8 & 0xff ),
+                ( byte ) ( intValue & 0xff ) };
     }
 
-    public long getIntValue() {
+
+    public long getIntValue()
+    {
         return intValue;
     }
 
-    public void setIntValue(long intValue) {
+
+    public void setIntValue( long intValue )
+    {
         this.intValue = intValue;
     }
 }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/ShortOption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/ShortOption.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/ShortOption.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/ShortOption.java Tue Jan 24 16:15:05 2012
@@ -20,6 +20,7 @@
 
 package org.apache.directory.server.dhcp.options;
 
+
 /**
  * The Dynamic Host Configuration Protocol (DHCP) provides a framework for
  * passing configuration information to hosts on a TCP/IP network. Configuration
@@ -32,32 +33,42 @@ package org.apache.directory.server.dhcp
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class ShortOption extends DhcpOption {
+public abstract class ShortOption extends DhcpOption
+{
     /**
      * The short value (represented as an int because of the unsignedness).
      */
     private int shortValue;
 
+
     /*
      * @see org.apache.directory.server.dhcp.options.DhcpOption#setData(byte[])
      */
-    public void setData(byte[] data) {
-        shortValue = (data[0] & 0xff) << 8 | (data[1] & 0xff);
+    public void setData( byte[] data )
+    {
+        shortValue = ( data[0] & 0xff ) << 8 | ( data[1] & 0xff );
     }
 
+
     /*
      * @see org.apache.directory.server.dhcp.options.DhcpOption#getData()
      */
-    public byte[] getData() {
-        return new byte[]{(byte) (shortValue >> 8 & 0xff),
-                (byte) (shortValue & 0xff)};
+    public byte[] getData()
+    {
+        return new byte[]
+            { ( byte ) ( shortValue >> 8 & 0xff ),
+                ( byte ) ( shortValue & 0xff ) };
     }
 
-    public int getShortValue() {
+
+    public int getShortValue()
+    {
         return shortValue;
     }
 
-    public void setShortValue(int shortValue) {
+
+    public void setShortValue( int shortValue )
+    {
         this.shortValue = shortValue;
     }
 }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/DhcpMessageType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/DhcpMessageType.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/DhcpMessageType.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/DhcpMessageType.java Tue Jan 24 16:15:05 2012
@@ -53,7 +53,7 @@ public class DhcpMessageType extends Dhc
     }
 
 
-    public DhcpMessageType(MessageType type)
+    public DhcpMessageType( MessageType type )
     {
         this.type = type;
     }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/IpAddressLeaseTime.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/IpAddressLeaseTime.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/IpAddressLeaseTime.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/IpAddressLeaseTime.java Tue Jan 24 16:15:05 2012
@@ -44,7 +44,7 @@ public class IpAddressLeaseTime extends 
     }
 
 
-    public IpAddressLeaseTime(long leaseTime)
+    public IpAddressLeaseTime( long leaseTime )
     {
         setIntValue( leaseTime );
     }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/ServerIdentifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/ServerIdentifier.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/ServerIdentifier.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/ServerIdentifier.java Tue Jan 24 16:15:05 2012
@@ -49,7 +49,7 @@ public class ServerIdentifier extends Ad
     }
 
 
-    public ServerIdentifier(InetAddress localHost)
+    public ServerIdentifier( InetAddress localHost )
     {
         setAddress( localHost );
     }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/UnrecognizedOption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/UnrecognizedOption.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/UnrecognizedOption.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/UnrecognizedOption.java Tue Jan 24 16:15:05 2012
@@ -19,8 +19,10 @@
  */
 package org.apache.directory.server.dhcp.options.dhcp;
 
+
 import org.apache.directory.server.dhcp.options.DhcpOption;
 
+
 /**
  * This pseudo option represents all options which have not been recognized and
  * parsed as specific implementations. No special semantics are associated with
@@ -28,21 +30,28 @@ import org.apache.directory.server.dhcp.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class UnrecognizedOption extends DhcpOption {
+public class UnrecognizedOption extends DhcpOption
+{
     private final byte tag;
 
-    public UnrecognizedOption() {
+
+    public UnrecognizedOption()
+    {
         tag = -1;
     }
 
+
     /*
      * @see org.apache.directory.server.dhcp.options.DhcpOption#getTag()
      */
-    public byte getTag() {
+    public byte getTag()
+    {
         return tag;
     }
 
-    public UnrecognizedOption(byte tag) {
+
+    public UnrecognizedOption( byte tag )
+    {
         this.tag = tag;
     }
 }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/dhcp/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.dhcp.options.dhcp;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/linklayer/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/linklayer/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/linklayer/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/linklayer/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.dhcp.options.linklayer;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/misc/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/misc/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/misc/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/misc/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.dhcp.options.misc;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.dhcp.options;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/perhost/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/perhost/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/perhost/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/perhost/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.dhcp.options.perhost;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/perinterface/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/perinterface/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/perinterface/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/perinterface/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.dhcp.options.perinterface;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/tcp/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/tcp/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/tcp/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/tcp/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.dhcp.options.tcp;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/HostName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/HostName.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/HostName.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/HostName.java Tue Jan 24 16:15:05 2012
@@ -39,11 +39,12 @@ public class HostName extends StringOpti
     public HostName()
     {
     }
-    
+
+
     /**
      * @param name
      */
-    public HostName(String name)
+    public HostName( String name )
     {
         setString( name );
     }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/RootPath.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/RootPath.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/RootPath.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/RootPath.java Tue Jan 24 16:15:05 2012
@@ -43,7 +43,7 @@ public class RootPath extends StringOpti
     /**
      * @param path
      */
-    public RootPath(String path)
+    public RootPath( String path )
     {
         setString( path );
     }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/SubnetMask.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/SubnetMask.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/SubnetMask.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/SubnetMask.java Tue Jan 24 16:15:05 2012
@@ -42,11 +42,12 @@ public class SubnetMask extends AddressO
     public SubnetMask()
     {
     }
-    
+
+
     /**
      * @param netmask
      */
-    public SubnetMask(InetAddress netmask)
+    public SubnetMask( InetAddress netmask )
     {
         setAddress( netmask );
     }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/options/vendor/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.dhcp.options.vendor;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/package-info.java Tue Jan 24 16:15:05 2012
@@ -27,3 +27,5 @@
  */
 
 package org.apache.directory.server.dhcp;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/protocol/DhcpProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/protocol/DhcpProtocolHandler.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/protocol/DhcpProtocolHandler.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/protocol/DhcpProtocolHandler.java Tue Jan 24 16:15:05 2012
@@ -20,6 +20,7 @@
 
 package org.apache.directory.server.dhcp.protocol;
 
+
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 
@@ -33,6 +34,7 @@ import org.apache.mina.filter.codec.Prot
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 /**
  * Implementation of a DHCP protocol handler which delegates the work of
  * generating replys to a DhcpService implementation.
@@ -40,9 +42,10 @@ import org.slf4j.LoggerFactory;
  * @see org.apache.directory.server.dhcp.service.DhcpService
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DhcpProtocolHandler implements IoHandler {
+public class DhcpProtocolHandler implements IoHandler
+{
     private static final Logger logger = LoggerFactory
-            .getLogger(DhcpProtocolHandler.class);
+        .getLogger( DhcpProtocolHandler.class );
 
     /**
      * Default DHCP client port
@@ -60,58 +63,74 @@ public class DhcpProtocolHandler impleme
      */
     private final DhcpService dhcpService;
 
+
     /**
      * 
      */
-    public DhcpProtocolHandler(DhcpService service) {
+    public DhcpProtocolHandler( DhcpService service )
+    {
         this.dhcpService = service;
     }
 
-    public void sessionCreated(IoSession session) throws Exception {
-        logger.debug("{} CREATED", session.getLocalAddress());
-        session.getFilterChain().addFirst("codec",
-                new ProtocolCodecFilter(new DhcpProtocolCodecFactory()));
+
+    public void sessionCreated( IoSession session ) throws Exception
+    {
+        logger.debug( "{} CREATED", session.getLocalAddress() );
+        session.getFilterChain().addFirst( "codec",
+            new ProtocolCodecFilter( new DhcpProtocolCodecFactory() ) );
     }
 
-    public void sessionOpened(IoSession session) {
-        logger.debug("{} -> {} OPENED", session.getRemoteAddress(), session
-                .getLocalAddress());
+
+    public void sessionOpened( IoSession session )
+    {
+        logger.debug( "{} -> {} OPENED", session.getRemoteAddress(), session
+            .getLocalAddress() );
     }
 
-    public void sessionClosed(IoSession session) {
-        logger.debug("{} -> {} CLOSED", session.getRemoteAddress(), session
-                .getLocalAddress());
+
+    public void sessionClosed( IoSession session )
+    {
+        logger.debug( "{} -> {} CLOSED", session.getRemoteAddress(), session
+            .getLocalAddress() );
     }
 
-    public void sessionIdle(IoSession session, IdleStatus status) {
+
+    public void sessionIdle( IoSession session, IdleStatus status )
+    {
         // ignore
     }
 
-    public void exceptionCaught(IoSession session, Throwable cause) {
-        logger.error("EXCEPTION CAUGHT ", cause);
-        cause.printStackTrace(System.out);
+
+    public void exceptionCaught( IoSession session, Throwable cause )
+    {
+        logger.error( "EXCEPTION CAUGHT ", cause );
+        cause.printStackTrace( System.out );
 
         session.close( true );
     }
 
-    public void messageReceived(IoSession session, Object message)
-            throws Exception {
-        if (logger.isDebugEnabled())
-            logger.debug("{} -> {} RCVD: {} " + message, session.getRemoteAddress(),
-                    session.getLocalAddress());
 
-        final DhcpMessage request = (DhcpMessage) message;
+    public void messageReceived( IoSession session, Object message )
+        throws Exception
+    {
+        if ( logger.isDebugEnabled() )
+            logger.debug( "{} -> {} RCVD: {} " + message, session.getRemoteAddress(),
+                session.getLocalAddress() );
+
+        final DhcpMessage request = ( DhcpMessage ) message;
 
         final DhcpMessage reply = dhcpService.getReplyFor(
-                (InetSocketAddress) session.getServiceAddress(),
-                (InetSocketAddress) session.getRemoteAddress(), request);
+            ( InetSocketAddress ) session.getServiceAddress(),
+            ( InetSocketAddress ) session.getRemoteAddress(), request );
 
-        if (null != reply) {
-            final InetSocketAddress isa = determineMessageDestination(request, reply);
-            session.write(reply, isa);
+        if ( null != reply )
+        {
+            final InetSocketAddress isa = determineMessageDestination( request, reply );
+            session.write( reply, isa );
         }
     }
 
+
     /**
      * Determine where to send the message: <br>
      * If the 'giaddr' field in a DHCP message from a client is non-zero, the
@@ -132,25 +151,27 @@ public class DhcpProtocolHandler impleme
      */
     //This will suppress PMD.AvoidUsingHardCodedIP warnings in this class
     @SuppressWarnings("PMD.AvoidUsingHardCodedIP")
-    private InetSocketAddress determineMessageDestination(DhcpMessage request,
-            DhcpMessage reply) {
+    private InetSocketAddress determineMessageDestination( DhcpMessage request,
+        DhcpMessage reply )
+    {
 
         final MessageType mt = reply.getMessageType();
-        if (!isNullAddress(request.getRelayAgentAddress()))
+        if ( !isNullAddress( request.getRelayAgentAddress() ) )
             // send to agent, if received via agent.
-            return new InetSocketAddress(request.getRelayAgentAddress(), SERVER_PORT);
-        else if (null != mt && mt == MessageType.DHCPNAK)
+            return new InetSocketAddress( request.getRelayAgentAddress(), SERVER_PORT );
+        else if ( null != mt && mt == MessageType.DHCPNAK )
             // force broadcast for DHCPNAKs
-            return new InetSocketAddress("255.255.255.255", 68);
+            return new InetSocketAddress( "255.255.255.255", 68 );
         else // not a NAK...
-        if (!isNullAddress(request.getCurrentClientAddress()))
+        if ( !isNullAddress( request.getCurrentClientAddress() ) )
             // have a current address? unicast to it.
-            return new InetSocketAddress(request.getCurrentClientAddress(),
-                    CLIENT_PORT);
+            return new InetSocketAddress( request.getCurrentClientAddress(),
+                CLIENT_PORT );
         else
-            return new InetSocketAddress("255.255.255.255", 68);
+            return new InetSocketAddress( "255.255.255.255", 68 );
     }
 
+
     /**
      * Determine, whether the given address ist actually the null address
      * "0.0.0.0".
@@ -158,17 +179,20 @@ public class DhcpProtocolHandler impleme
      * @param relayAgentAddress
      * @return
      */
-    private boolean isNullAddress(InetAddress addr) {
+    private boolean isNullAddress( InetAddress addr )
+    {
         final byte a[] = addr.getAddress();
-        for (int i = 0; i < a.length; i++)
-            if (a[i] != 0)
+        for ( int i = 0; i < a.length; i++ )
+            if ( a[i] != 0 )
                 return false;
         return true;
     }
 
-    public void messageSent(IoSession session, Object message) {
-        if (logger.isDebugEnabled())
-            logger.debug("{} -> {} SENT: " + message, session.getRemoteAddress(),
-                    session.getLocalAddress());
+
+    public void messageSent( IoSession session, Object message )
+    {
+        if ( logger.isDebugEnabled() )
+            logger.debug( "{} -> {} SENT: " + message, session.getRemoteAddress(),
+                session.getLocalAddress() );
     }
 }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/protocol/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/protocol/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/protocol/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/protocol/package-info.java Tue Jan 24 16:15:05 2012
@@ -27,3 +27,5 @@
  */
 
 package org.apache.directory.server.dhcp.protocol;
+
+

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/AbstractDhcpService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/AbstractDhcpService.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/AbstractDhcpService.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/AbstractDhcpService.java Tue Jan 24 16:15:05 2012
@@ -18,6 +18,7 @@
 
 package org.apache.directory.server.dhcp.service;
 
+
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.util.Iterator;
@@ -31,6 +32,7 @@ import org.apache.directory.server.dhcp.
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 /**
  * Abstract implementation of the server-side DHCP protocol. This class just
  * provides some utility methods and dispatches server-bound messages to handler
@@ -41,53 +43,59 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * 
  */
-public abstract class AbstractDhcpService implements DhcpService {
+public abstract class AbstractDhcpService implements DhcpService
+{
     private static final Logger logger = LoggerFactory
-            .getLogger(AbstractDhcpService.class);
+        .getLogger( AbstractDhcpService.class );
+
 
     /*
      * @see org.apache.directory.server.dhcp.DhcpService#getReplyFor(org.apache.directory.server.dhcp.messages.DhcpMessage)
      */
-    public final DhcpMessage getReplyFor(InetSocketAddress localAddress,
-            InetSocketAddress clientAddress, DhcpMessage request)
-            throws DhcpException {
+    public final DhcpMessage getReplyFor( InetSocketAddress localAddress,
+        InetSocketAddress clientAddress, DhcpMessage request )
+        throws DhcpException
+    {
         // ignore messages with an op != REQUEST/REPLY
-        if (request.getOp() != DhcpMessage.OP_BOOTREQUEST
-                && request.getOp() != DhcpMessage.OP_BOOTREPLY)
+        if ( request.getOp() != DhcpMessage.OP_BOOTREQUEST
+            && request.getOp() != DhcpMessage.OP_BOOTREPLY )
             return null;
 
         // message type option MUST be set - we don't support plain BOOTP.
-        if (null == request.getMessageType()) {
-            logger.warn("Missing message type option - plain BOOTP not supported.");
+        if ( null == request.getMessageType() )
+        {
+            logger.warn( "Missing message type option - plain BOOTP not supported." );
             return null;
         }
 
         // dispatch based on the message type
-        switch (request.getMessageType()){
-            // client-to-server messages
-            case DHCPDISCOVER :
-                return handleDISCOVER(localAddress, clientAddress, request);
-            case DHCPREQUEST :
-                return handleREQUEST(localAddress, clientAddress, request);
-            case DHCPRELEASE :
-                return handleRELEASE(localAddress, clientAddress, request);
-            case DHCPINFORM :
-                return handleINFORM(localAddress, clientAddress, request);
+        switch ( request.getMessageType() )
+        {
+        // client-to-server messages
+            case DHCPDISCOVER:
+                return handleDISCOVER( localAddress, clientAddress, request );
+            case DHCPREQUEST:
+                return handleREQUEST( localAddress, clientAddress, request );
+            case DHCPRELEASE:
+                return handleRELEASE( localAddress, clientAddress, request );
+            case DHCPINFORM:
+                return handleINFORM( localAddress, clientAddress, request );
 
-            case DHCPOFFER :
-                return handleOFFER(localAddress, clientAddress, request);
+            case DHCPOFFER:
+                return handleOFFER( localAddress, clientAddress, request );
 
                 // server-to-client messages
-            case DHCPDECLINE :
-            case DHCPACK :
-            case DHCPNAK :
+            case DHCPDECLINE:
+            case DHCPACK:
+            case DHCPNAK:
                 return null; // just ignore them
 
-            default :
-                return handleUnknownMessage(clientAddress, request);
+            default:
+                return handleUnknownMessage( clientAddress, request );
         }
     }
 
+
     /**
      * Handle unknown DHCP message. The default implementation just logs and
      * ignores it.
@@ -97,14 +105,16 @@ public abstract class AbstractDhcpServic
      * @return DhcpMessage response message or <code>null</code> to ignore (don't reply to)
      *         it.
      */
-    protected DhcpMessage handleUnknownMessage(InetSocketAddress clientAddress,
-            DhcpMessage request) {
-        if (logger.isWarnEnabled())
-            logger.warn("Got unknkown DHCP message: " + request + " from:  "
-                    + clientAddress);
+    protected DhcpMessage handleUnknownMessage( InetSocketAddress clientAddress,
+        DhcpMessage request )
+    {
+        if ( logger.isWarnEnabled() )
+            logger.warn( "Got unknkown DHCP message: " + request + " from:  "
+                + clientAddress );
         return null;
     }
 
+
     /**
      * Handle DHCPINFORM message. The default implementation just ignores it.
      * 
@@ -114,15 +124,17 @@ public abstract class AbstractDhcpServic
      * @return DhcpMessage response message or <code>null</code> to ignore (don't reply to)
      *         it.
      */
-    protected DhcpMessage handleINFORM(InetSocketAddress localAddress,
-            InetSocketAddress clientAddress, DhcpMessage request)
-            throws DhcpException {
-        if (logger.isDebugEnabled())
-            logger.debug("Got INFORM message: " + request + " from:  "
-                    + clientAddress);
+    protected DhcpMessage handleINFORM( InetSocketAddress localAddress,
+        InetSocketAddress clientAddress, DhcpMessage request )
+        throws DhcpException
+    {
+        if ( logger.isDebugEnabled() )
+            logger.debug( "Got INFORM message: " + request + " from:  "
+                + clientAddress );
         return null;
     }
 
+
     /**
      * Handle DHCPRELEASE message. The default implementation just ignores it.
      * 
@@ -132,15 +144,17 @@ public abstract class AbstractDhcpServic
      * @return DhcpMessage response message or <code>null</code> to ignore (don't reply to)
      *         it.
      */
-    protected DhcpMessage handleRELEASE(InetSocketAddress localAddress,
-            InetSocketAddress clientAddress, DhcpMessage request)
-            throws DhcpException {
-        if (logger.isDebugEnabled())
-            logger.debug("Got RELEASE message: " + request + " from:  "
-                    + clientAddress);
+    protected DhcpMessage handleRELEASE( InetSocketAddress localAddress,
+        InetSocketAddress clientAddress, DhcpMessage request )
+        throws DhcpException
+    {
+        if ( logger.isDebugEnabled() )
+            logger.debug( "Got RELEASE message: " + request + " from:  "
+                + clientAddress );
         return null;
     }
 
+
     /**
      * Handle DHCPREQUEST message. The default implementation just ignores it.
      * 
@@ -150,15 +164,17 @@ public abstract class AbstractDhcpServic
      * @return DhcpMessage response message or <code>null</code> to ignore (don't reply to)
      *         it.
      */
-    protected DhcpMessage handleREQUEST(InetSocketAddress localAddress,
-            InetSocketAddress clientAddress, DhcpMessage request)
-            throws DhcpException {
-        if (logger.isDebugEnabled())
-            logger.debug("Got REQUEST message: " + request + " from:  "
-                    + clientAddress);
+    protected DhcpMessage handleREQUEST( InetSocketAddress localAddress,
+        InetSocketAddress clientAddress, DhcpMessage request )
+        throws DhcpException
+    {
+        if ( logger.isDebugEnabled() )
+            logger.debug( "Got REQUEST message: " + request + " from:  "
+                + clientAddress );
         return null;
     }
 
+
     /**
      * Handle DHCPDISCOVER message. The default implementation just ignores it.
      * 
@@ -169,15 +185,17 @@ public abstract class AbstractDhcpServic
      *         it.
      * @throws DhcpException
      */
-    protected DhcpMessage handleDISCOVER(InetSocketAddress localAddress,
-            InetSocketAddress clientAddress, DhcpMessage request)
-            throws DhcpException {
-        if (logger.isDebugEnabled())
-            logger.debug("Got DISCOVER message: " + request + " from:  "
-                    + clientAddress);
+    protected DhcpMessage handleDISCOVER( InetSocketAddress localAddress,
+        InetSocketAddress clientAddress, DhcpMessage request )
+        throws DhcpException
+    {
+        if ( logger.isDebugEnabled() )
+            logger.debug( "Got DISCOVER message: " + request + " from:  "
+                + clientAddress );
         return null;
     }
 
+
     /**
      * Handle DHCPOFFER message. The default implementation just ignores it.
      * 
@@ -188,15 +206,17 @@ public abstract class AbstractDhcpServic
      *         it.
      * @throws DhcpException
      */
-    protected DhcpMessage handleOFFER(InetSocketAddress localAddress,
-            InetSocketAddress clientAddress, DhcpMessage request)
-            throws DhcpException {
-        if (logger.isDebugEnabled())
+    protected DhcpMessage handleOFFER( InetSocketAddress localAddress,
+        InetSocketAddress clientAddress, DhcpMessage request )
+        throws DhcpException
+    {
+        if ( logger.isDebugEnabled() )
             logger
-                    .debug("Got OFFER message: " + request + " from:  " + clientAddress);
+                .debug( "Got OFFER message: " + request + " from:  " + clientAddress );
         return null;
     }
 
+
     /**
      * Initialize a general DHCP reply message. Sets:
      * <ul>
@@ -213,39 +233,43 @@ public abstract class AbstractDhcpServic
      * @param request
      * @return DhcpMessage
      */
-    protected final DhcpMessage initGeneralReply(InetSocketAddress localAddress,
-            DhcpMessage request) {
+    protected final DhcpMessage initGeneralReply( InetSocketAddress localAddress,
+        DhcpMessage request )
+    {
         final DhcpMessage reply = new DhcpMessage();
 
-        reply.setOp(DhcpMessage.OP_BOOTREPLY);
+        reply.setOp( DhcpMessage.OP_BOOTREPLY );
 
-        reply.setHardwareAddress(request.getHardwareAddress());
-        reply.setTransactionId(request.getTransactionId());
-        reply.setFlags(request.getFlags());
-        reply.setRelayAgentAddress(request.getRelayAgentAddress());
+        reply.setHardwareAddress( request.getHardwareAddress() );
+        reply.setTransactionId( request.getTransactionId() );
+        reply.setFlags( request.getFlags() );
+        reply.setRelayAgentAddress( request.getRelayAgentAddress() );
 
         // set server hostname
-        reply.setServerHostname(localAddress.getHostName());
+        reply.setServerHostname( localAddress.getHostName() );
 
         // set server identifier based on the IF on which we received the packet
-        reply.getOptions().add(new ServerIdentifier(localAddress.getAddress()));
+        reply.getOptions().add( new ServerIdentifier( localAddress.getAddress() ) );
 
         return reply;
     }
 
+
     /**
      * Check if an address is the zero-address
      * 
      * @param addr
      * @return boolean
      */
-    private boolean isZeroAddress(byte[] addr) {
-        for (int i = 0; i < addr.length; i++)
-            if (addr[i] != 0)
+    private boolean isZeroAddress( byte[] addr )
+    {
+        for ( int i = 0; i < addr.length; i++ )
+            if ( addr[i] != 0 )
                 return false;
         return true;
     }
 
+
     /**
      * Determine address on which to base selection. If the relay agent address is
      * set, we use the relay agent's address, otherwise we use the address we
@@ -256,19 +280,21 @@ public abstract class AbstractDhcpServic
      * @return InetAddress
      */
     protected final InetAddress determineSelectionBase(
-            InetSocketAddress clientAddress, DhcpMessage request) {
+        InetSocketAddress clientAddress, DhcpMessage request )
+    {
         // FIXME: do we know
         // a) the interface address over which we received a message (!)
         // b) the client address (if specified)
         // c) the relay agent address?
 
         // if the relay agent address is set, we use it as the selection base
-        if (!isZeroAddress(request.getRelayAgentAddress().getAddress()))
+        if ( !isZeroAddress( request.getRelayAgentAddress().getAddress() ) )
             return request.getRelayAgentAddress();
 
         return clientAddress.getAddress();
     }
 
+
     /**
      * Strip options that the client doesn't want, if the ParameterRequestList
      * option is present.
@@ -276,16 +302,19 @@ public abstract class AbstractDhcpServic
      * @param request
      * @param options
      */
-    protected final void stripUnwantedOptions(DhcpMessage request,
-            OptionsField options) {
-        final ParameterRequestList prl = (ParameterRequestList) request
-                .getOptions().get(ParameterRequestList.class);
-        if (null != prl) {
+    protected final void stripUnwantedOptions( DhcpMessage request,
+        OptionsField options )
+    {
+        final ParameterRequestList prl = ( ParameterRequestList ) request
+            .getOptions().get( ParameterRequestList.class );
+        if ( null != prl )
+        {
             final byte[] list = prl.getData();
-            for (final Iterator i = options.iterator(); i.hasNext();) {
-                final DhcpOption o = (DhcpOption) i.next();
-                for (int j = 0; j < list.length; j++)
-                    if (list[j] == o.getTag())
+            for ( final Iterator i = options.iterator(); i.hasNext(); )
+            {
+                final DhcpOption o = ( DhcpOption ) i.next();
+                for ( int j = 0; j < list.length; j++ )
+                    if ( list[j] == o.getTag() )
                         continue;
                 i.remove();
             }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/DhcpService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/DhcpService.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/DhcpService.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/DhcpService.java Tue Jan 24 16:15:05 2012
@@ -44,5 +44,6 @@ public interface DhcpService
      * @return DhcpMessage
      * @throws DhcpException 
      */
-    public DhcpMessage getReplyFor( InetSocketAddress localAddress, InetSocketAddress clientAddress, DhcpMessage request ) throws DhcpException;
+    public DhcpMessage getReplyFor( InetSocketAddress localAddress, InetSocketAddress clientAddress, DhcpMessage request )
+        throws DhcpException;
 }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/StoreBasedDhcpService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/StoreBasedDhcpService.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/StoreBasedDhcpService.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/StoreBasedDhcpService.java Tue Jan 24 16:15:05 2012
@@ -50,7 +50,7 @@ public class StoreBasedDhcpService exten
     private final DhcpStore dhcpStore;
 
 
-    public StoreBasedDhcpService(DhcpStore dhcpStore)
+    public StoreBasedDhcpService( DhcpStore dhcpStore )
     {
         this.dhcpStore = dhcpStore;
     }

Modified: directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/package-info.java?rev=1235326&r1=1235325&r2=1235326&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/package-info.java (original)
+++ directory/apacheds/trunk/protocol-dhcp/src/main/java/org/apache/directory/server/dhcp/service/package-info.java Tue Jan 24 16:15:05 2012
@@ -25,3 +25,5 @@
  */
 
 package org.apache.directory.server.dhcp.service;
+
+



Mime
View raw message