directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1235300 [1/2] - in /directory/apacheds/trunk: installers-maven-plugin/src/main/java/org/apache/directory/server/installers/ installers-maven-plugin/src/main/java/org/apache/directory/server/installers/archive/ installers-maven-plugin/src/m...
Date Tue, 24 Jan 2012 15:32:29 GMT
Author: elecharny
Date: Tue Jan 24 15:32:28 2012
New Revision: 1235300

URL: http://svn.apache.org/viewvc?rev=1235300&view=rev
Log:
Formatted the code using Directory formatter

Modified:
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/AbstractMojoCommand.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/MojoHelperUtils.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/archive/ArchiveInstallerCommand.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/bin/BinInstallerCommand.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebInstallerCommand.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgInstallerCommand.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmInstallerCommand.java
    directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
    directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/Authenticator.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/EncryptionMethod.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/PasswordHistory.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/StrongAuthenticator.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/ppolicy/PpolicyConfigContainer.java
    directory/apacheds/trunk/interceptors/authn/src/test/java/org/apache/directory/server/core/authn/LdapPrincipalTest.java
    directory/apacheds/trunk/interceptors/authn/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticatorOneWayEncryptedTest.java

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/AbstractMojoCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/AbstractMojoCommand.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/AbstractMojoCommand.java (original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/AbstractMojoCommand.java Tue Jan 24 15:32:28 2012
@@ -194,12 +194,12 @@ public abstract class AbstractMojoComman
 
         // Copying the LICENSE and NOTICE files
         MojoHelperUtils.copyBinaryFile(
-                getClass().getResourceAsStream( "/org/apache/directory/server/installers/LICENSE" ),
-                new File( installationLayout.getInstallationDirectory(), "LICENSE" ) );
+            getClass().getResourceAsStream( "/org/apache/directory/server/installers/LICENSE" ),
+            new File( installationLayout.getInstallationDirectory(), "LICENSE" ) );
         MojoHelperUtils.copyBinaryFile(
-                getClass().getResourceAsStream( "/org/apache/directory/server/installers/NOTICE" ),
-                new File( installationLayout.getInstallationDirectory(),
-                    "NOTICE" ) );
+            getClass().getResourceAsStream( "/org/apache/directory/server/installers/NOTICE" ),
+            new File( installationLayout.getInstallationDirectory(),
+                "NOTICE" ) );
 
         // Copying the 'apacheds' shell script (only for Linux, Solaris or Mac OS X)
         if ( target.isOsNameLinux() || target.isOsNameSolaris() || target.isOsNameMacOSX() )
@@ -241,13 +241,13 @@ public abstract class AbstractMojoComman
 
         // Copying the wrapper configuration file
         MojoHelperUtils.copyAsciiFile( mojo, filterProperties,
-                getClass().getResourceAsStream( "/org/apache/directory/server/installers/wrapper-instance.conf" ),
-                new File( instanceLayout.getConfDirectory(), "wrapper.conf" ), true );
+            getClass().getResourceAsStream( "/org/apache/directory/server/installers/wrapper-instance.conf" ),
+            new File( instanceLayout.getConfDirectory(), "wrapper.conf" ), true );
 
         // Copying ApacheDS LDIF configuration file
         MojoHelperUtils.copyAsciiFile( mojo, filterProperties,
-                getClass().getResourceAsStream( "/org/apache/directory/server/installers/config.ldif" ),
-                new File( instanceLayout.getConfDirectory(), "config.ldif" ), false );
+            getClass().getResourceAsStream( "/org/apache/directory/server/installers/config.ldif" ),
+            new File( instanceLayout.getConfDirectory(), "config.ldif" ), false );
     }
 
 
@@ -292,7 +292,7 @@ public abstract class AbstractMojoComman
             {
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
                     "/org/apache/directory/server/installers/wrapper/bin/wrapper-macosx-universal-32" ), new File(
-                        getInstallationLayout().getBinDirectory(), "wrapper" ) );
+                    getInstallationLayout().getBinDirectory(), "wrapper" ) );
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
                     "/org/apache/directory/server/installers/wrapper/lib/libwrapper-macosx-universal-32.jnilib" ),
                     new File( getInstallationLayout().getLibDirectory(),
@@ -303,73 +303,73 @@ public abstract class AbstractMojoComman
             if ( target.isOsNameMacOSX() && target.isOsArchX86_64() )
             {
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
-                        "/org/apache/directory/server/installers/wrapper/bin/wrapper-macosx-universal-64" ), new File(
-                        getInstallationLayout().getBinDirectory(), "wrapper" ) );
+                    "/org/apache/directory/server/installers/wrapper/bin/wrapper-macosx-universal-64" ), new File(
+                    getInstallationLayout().getBinDirectory(), "wrapper" ) );
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
-                        "/org/apache/directory/server/installers/wrapper/lib/libwrapper-macosx-universal-64.jnilib" ),
-                        new File( getInstallationLayout().getLibDirectory(),
-                            "libwrapper.jnilib" ) );
+                    "/org/apache/directory/server/installers/wrapper/lib/libwrapper-macosx-universal-64.jnilib" ),
+                    new File( getInstallationLayout().getLibDirectory(),
+                        "libwrapper.jnilib" ) );
             }
 
             // Linux i386 & x86
             if ( target.isOsNameLinux() && ( target.isOsArchI386() || target.isOsArchx86() ) )
             {
                 MojoHelperUtils.copyBinaryFile(
-                        getClass().getResourceAsStream(
-                            "/org/apache/directory/server/installers/wrapper/bin/wrapper-linux-x86-32" ),
-                        new File( getInstallationLayout().getBinDirectory(), "wrapper" ) );
+                    getClass().getResourceAsStream(
+                        "/org/apache/directory/server/installers/wrapper/bin/wrapper-linux-x86-32" ),
+                    new File( getInstallationLayout().getBinDirectory(), "wrapper" ) );
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
-                        "/org/apache/directory/server/installers/wrapper/lib/libwrapper-linux-x86-32.so" ),
-                        new File( getInstallationLayout().getLibDirectory(), "libwrapper.so" ) );
+                    "/org/apache/directory/server/installers/wrapper/lib/libwrapper-linux-x86-32.so" ),
+                    new File( getInstallationLayout().getLibDirectory(), "libwrapper.so" ) );
             }
 
             // Linux x86_64 & amd64
             if ( target.isOsNameLinux() && ( target.isOsArchX86_64() || target.isOsArchAmd64() ) )
             {
                 MojoHelperUtils.copyBinaryFile(
-                        getClass().getResourceAsStream(
-                            "/org/apache/directory/server/installers/wrapper/bin/wrapper-linux-x86-64" ),
-                        new File( getInstallationLayout().getBinDirectory(), "wrapper" ) );
+                    getClass().getResourceAsStream(
+                        "/org/apache/directory/server/installers/wrapper/bin/wrapper-linux-x86-64" ),
+                    new File( getInstallationLayout().getBinDirectory(), "wrapper" ) );
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
-                        "/org/apache/directory/server/installers/wrapper/lib/libwrapper-linux-x86-64.so" ),
-                        new File( getInstallationLayout().getLibDirectory(), "libwrapper.so" ) );
+                    "/org/apache/directory/server/installers/wrapper/lib/libwrapper-linux-x86-64.so" ),
+                    new File( getInstallationLayout().getLibDirectory(), "libwrapper.so" ) );
             }
 
             // Solaris x86
             if ( target.isOsNameSolaris() && target.isOsArchx86() )
             {
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
-                        "/org/apache/directory/server/installers/wrapper/bin/wrapper-solaris-x86-32" ),
-                        new File( getInstallationLayout().getBinDirectory(), "wrapper" ) );
+                    "/org/apache/directory/server/installers/wrapper/bin/wrapper-solaris-x86-32" ),
+                    new File( getInstallationLayout().getBinDirectory(), "wrapper" ) );
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
-                        "/org/apache/directory/server/installers/wrapper/lib/libwrapper-solaris-x86-32.so" ), new File(
-                        getInstallationLayout().getLibDirectory(),
-                        "libwrapper.so" ) );
+                    "/org/apache/directory/server/installers/wrapper/lib/libwrapper-solaris-x86-32.so" ), new File(
+                    getInstallationLayout().getLibDirectory(),
+                    "libwrapper.so" ) );
             }
 
             // Solaris Sparc
             if ( target.isOsNameSolaris() && target.isOsArchSparc() )
             {
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
-                        "/org/apache/directory/server/installers/wrapper/bin/wrapper-solaris-sparc-32" ),
-                        new File( getInstallationLayout().getBinDirectory(), "wrapper" ) );
+                    "/org/apache/directory/server/installers/wrapper/bin/wrapper-solaris-sparc-32" ),
+                    new File( getInstallationLayout().getBinDirectory(), "wrapper" ) );
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
-                        "/org/apache/directory/server/installers/wrapper/lib/libwrapper-solaris-sparc-32.so" ),
-                        new File(
-                            getInstallationLayout().getLibDirectory(),
-                            "libwrapper.so" ) );
+                    "/org/apache/directory/server/installers/wrapper/lib/libwrapper-solaris-sparc-32.so" ),
+                    new File(
+                        getInstallationLayout().getLibDirectory(),
+                        "libwrapper.so" ) );
             }
 
             // Windows
             if ( target.isOsNameWindows() )
             {
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
-                        "/org/apache/directory/server/installers/wrapper/bin/wrapper-windows-x86-32.exe" ),
-                        new File( getInstallationLayout().getBinDirectory(), "wrapper.exe" ) );
+                    "/org/apache/directory/server/installers/wrapper/bin/wrapper-windows-x86-32.exe" ),
+                    new File( getInstallationLayout().getBinDirectory(), "wrapper.exe" ) );
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream(
-                        "/org/apache/directory/server/installers/wrapper/lib/wrapper-windows-x86-32.dll" ), new File(
-                        getInstallationLayout().getLibDirectory(),
-                        "wrapper.dll" ) );
+                    "/org/apache/directory/server/installers/wrapper/lib/wrapper-windows-x86-32.dll" ), new File(
+                    getInstallationLayout().getLibDirectory(),
+                    "wrapper.dll" ) );
             }
         }
         catch ( IOException e )

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/MojoHelperUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/MojoHelperUtils.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/MojoHelperUtils.java (original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/MojoHelperUtils.java Tue Jan 24 15:32:28 2012
@@ -227,7 +227,7 @@ public class MojoHelperUtils
 
             if ( !dest.mkdirs() )
             {
-                throw new IOException(I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, dest ) );
+                throw new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, dest ) );
             }
 
             for ( File file : files )

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/archive/ArchiveInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/archive/ArchiveInstallerCommand.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/archive/ArchiveInstallerCommand.java (original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/archive/ArchiveInstallerCommand.java Tue Jan 24 15:32:28 2012
@@ -110,7 +110,7 @@ public class ArchiveInstallerCommand ext
             File wrapperConf = new File( getInstanceLayout().getConfDirectory(), "wrapper.conf" );
             if ( !wrapperConf.delete() )
             {
-                throw new IOException(I18n.err( I18n.ERR_113_COULD_NOT_DELETE_FILE_OR_DIRECTORY, wrapperConf ) );
+                throw new IOException( I18n.err( I18n.ERR_113_COULD_NOT_DELETE_FILE_OR_DIRECTORY, wrapperConf ) );
             }
             FileUtils.deleteDirectory( getInstanceLayout().getRunDirectory() );
         }

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/bin/BinInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/bin/BinInstallerCommand.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/bin/BinInstallerCommand.java (original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/bin/BinInstallerCommand.java Tue Jan 24 15:32:28 2012
@@ -109,16 +109,16 @@ public class BinInstallerCommand extends
                 getClass().getResourceAsStream( "/org/apache/directory/server/installers/log4j.properties" ),
                 new File( instanceDirectory, "log4j.properties" ), true );
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties,
-                    getClass().getResourceAsStream( "/org/apache/directory/server/installers/wrapper-instance.conf" ),
-                    new File( instanceDirectory, "wrapper.conf" ), true );
+                getClass().getResourceAsStream( "/org/apache/directory/server/installers/wrapper-instance.conf" ),
+                new File( instanceDirectory, "wrapper.conf" ), true );
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties,
-                    getClass().getResourceAsStream( "/org/apache/directory/server/installers/config.ldif" ),
-                    new File( instanceDirectory, "config.ldif" ), false );
+                getClass().getResourceAsStream( "/org/apache/directory/server/installers/config.ldif" ),
+                new File( instanceDirectory, "config.ldif" ), false );
 
             // Copying the init script to the instance directory
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties,
-                    getClass().getResourceAsStream( "/org/apache/directory/server/installers/etc-initd-script" ),
-                    new File( instanceDirectory, "etc-initd-script" ), true );
+                getClass().getResourceAsStream( "/org/apache/directory/server/installers/etc-initd-script" ),
+                new File( instanceDirectory, "etc-initd-script" ), true );
 
             // Creating the sh directory for the shell scripts
             File binShDirectory = new File( getBinInstallerDirectory(), "sh" );
@@ -131,15 +131,15 @@ public class BinInstallerCommand extends
 
             // Copying shell script utilities for the installer
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "bootstrap.sh" ),
-                        new File( getBinInstallerDirectory(), "bootstrap.sh" ), true );
+                new File( getBinInstallerDirectory(), "bootstrap.sh" ), true );
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream(
-                        "createInstaller.sh" ), new File( getBinInstallerDirectory(), "createInstaller.sh" ), true );
+                "createInstaller.sh" ), new File( getBinInstallerDirectory(), "createInstaller.sh" ), true );
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "functions.sh" ),
-                        new File( binShDirectory, "functions.sh" ), false );
+                new File( binShDirectory, "functions.sh" ), false );
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "install.sh" ),
-                        new File( binShDirectory, "install.sh" ), false );
+                new File( binShDirectory, "install.sh" ), false );
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "variables.sh" ),
-                        new File( binShDirectory, "variables.sh" ), false );
+                new File( binShDirectory, "variables.sh" ), false );
         }
         catch ( Exception e )
         {
@@ -151,7 +151,7 @@ public class BinInstallerCommand extends
         log.info( "    Generating Bin installer" );
         Execute createBinTask = new Execute();
         String[] cmd = new String[]
-                    { shUtility.getAbsolutePath(), "createInstaller.sh" };
+            { shUtility.getAbsolutePath(), "createInstaller.sh" };
         createBinTask.setCommandline( cmd );
         createBinTask.setWorkingDirectory( getBinInstallerDirectory() );
         try

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebInstallerCommand.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebInstallerCommand.java (original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebInstallerCommand.java Tue Jan 24 15:32:28 2012
@@ -118,13 +118,13 @@ public class DebInstallerCommand extends
         try
         {
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "control" ),
-                        new File( debDebianDirectory, "control" ), true );
+                new File( debDebianDirectory, "control" ), true );
 
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "postinst" ),
-                        new File( debDebianDirectory, "postinst" ), true );
+                new File( debDebianDirectory, "postinst" ), true );
 
             MojoHelperUtils.copyAsciiFile( mojo, filterProperties, getClass().getResourceAsStream( "prerm" ),
-                        new File( debDebianDirectory, "prerm" ), true );
+                new File( debDebianDirectory, "prerm" ), true );
         }
         catch ( IOException e )
         {
@@ -134,10 +134,10 @@ public class DebInstallerCommand extends
 
         // Setting correct permission on the postinst script
         MojoHelperUtils.exec( new String[]
-                    { "chmod", "755", new File( debDebianDirectory, "postinst" ).toString() }, debDebianDirectory,
+            { "chmod", "755", new File( debDebianDirectory, "postinst" ).toString() }, debDebianDirectory,
             false );
         MojoHelperUtils.exec( new String[]
-                    { "chmod", "755", new File( debDebianDirectory, "prerm" ).toString() }, debDebianDirectory, false );
+            { "chmod", "755", new File( debDebianDirectory, "prerm" ).toString() }, debDebianDirectory, false );
 
         // Generating the Deb
         log.info( "    Generating Deb installer" );
@@ -150,12 +150,12 @@ public class DebInstallerCommand extends
 
         Execute createDebTask = new Execute();
         String[] cmd = new String[]
-                    {
-                        mojo.getDpkgUtility().getAbsolutePath(),
-                        "-b",
-                        getTargetDirectory().getName() + "/" + getDebDirectory().getName(),
-                        finalName
-                    };
+            {
+                mojo.getDpkgUtility().getAbsolutePath(),
+                "-b",
+                getTargetDirectory().getName() + "/" + getDebDirectory().getName(),
+                finalName
+        };
         createDebTask.setCommandline( cmd );
         createDebTask.setWorkingDirectory( mojo.getOutputDirectory() );
 

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgInstallerCommand.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgInstallerCommand.java (original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgInstallerCommand.java Tue Jan 24 15:32:28 2012
@@ -107,7 +107,8 @@ public class MacOsXPkgInstallerCommand e
             + mojo.getProject().getVersion() );
         if ( !pkgRootUsrLocalApachedsDirectory.mkdirs() )
         {
-            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, pkgRootUsrLocalApachedsDirectory ) );
+            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY,
+                pkgRootUsrLocalApachedsDirectory ) );
             log.error( e.getLocalizedMessage() );
             throw new MojoFailureException( e.getMessage() );
         }
@@ -121,42 +122,48 @@ public class MacOsXPkgInstallerCommand e
         File pkgRootInstancesDefaultDirectory = new File( pkgRootInstancesDirectory, "default" );
         if ( !pkgRootInstancesDefaultDirectory.mkdirs() )
         {
-            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, pkgRootInstancesDefaultDirectory ) );
+            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY,
+                pkgRootInstancesDefaultDirectory ) );
             log.error( e.getLocalizedMessage() );
             throw new MojoFailureException( e.getMessage() );
         }
         File pkgRootInstancesDefaultConfDirectory = new File( pkgRootInstancesDefaultDirectory, "conf" );
         if ( !pkgRootInstancesDefaultConfDirectory.mkdirs() )
         {
-            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, pkgRootInstancesDefaultConfDirectory ) );
+            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY,
+                pkgRootInstancesDefaultConfDirectory ) );
             log.error( e.getLocalizedMessage() );
             throw new MojoFailureException( e.getMessage() );
         }
         File pkgRootInstancesDefaultDirectoryLog = new File( pkgRootInstancesDefaultDirectory, "log" );
         if ( !pkgRootInstancesDefaultDirectoryLog.mkdirs() )
         {
-            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, pkgRootInstancesDefaultDirectoryLog ) );
+            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY,
+                pkgRootInstancesDefaultDirectoryLog ) );
             log.error( e.getLocalizedMessage() );
             throw new MojoFailureException( e.getMessage() );
         }
         File pkgRootInstancesDefaultDirectoryPartitions = new File( pkgRootInstancesDefaultDirectory, "partitions" );
         if ( !pkgRootInstancesDefaultDirectoryPartitions.mkdirs() )
         {
-            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, pkgRootInstancesDefaultDirectoryPartitions ) );
+            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY,
+                pkgRootInstancesDefaultDirectoryPartitions ) );
             log.error( e.getLocalizedMessage() );
             throw new MojoFailureException( e.getMessage() );
         }
         File pkgRootInstancesDefaultDirectoryRun = new File( pkgRootInstancesDefaultDirectory, "run" );
         if ( !pkgRootInstancesDefaultDirectoryRun.mkdirs() )
         {
-            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, pkgRootInstancesDefaultDirectoryRun ) );
+            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY,
+                pkgRootInstancesDefaultDirectoryRun ) );
             log.error( e.getLocalizedMessage() );
             throw new MojoFailureException( e.getMessage() );
         }
         File pkgRootLibraryLaunchDaemons = new File( pkgRootDirectory, "Library/LaunchDaemons" );
         if ( !pkgRootLibraryLaunchDaemons.mkdirs() )
         {
-            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, pkgRootLibraryLaunchDaemons ) );
+            Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY,
+                pkgRootLibraryLaunchDaemons ) );
             log.error( e.getLocalizedMessage() );
             throw new MojoFailureException( e.getMessage() );
         }
@@ -182,7 +189,8 @@ public class MacOsXPkgInstallerCommand e
             File pkgResourcesEnglishDirectory = new File( targetDirectory, "Resources/en.lproj" );
             if ( !pkgResourcesEnglishDirectory.mkdirs() )
             {
-                Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY, pkgResourcesEnglishDirectory ) );
+                Exception e = new IOException( I18n.err( I18n.ERR_112_COULD_NOT_CREATE_DIRECORY,
+                    pkgResourcesEnglishDirectory ) );
                 log.error( e.getLocalizedMessage() );
                 throw new MojoFailureException( e.getMessage() );
             }

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmInstallerCommand.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmInstallerCommand.java (original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmInstallerCommand.java Tue Jan 24 15:32:28 2012
@@ -139,14 +139,14 @@ public class RpmInstallerCommand extends
 
             // Generating tar.gz file
             MojoHelperUtils.exec( new String[]
-                                    {
-                                        "tar",
-                                        "-zcf",
-                                        "apacheds-" + getVersion() + ".tar.gz",
-                                        "apacheds-" + getVersion()
-                                    },
-                                  new File( getTargetDirectory(), "/SOURCES" ),
-                                  false );
+                {
+                    "tar",
+                    "-zcf",
+                    "apacheds-" + getVersion() + ".tar.gz",
+                    "apacheds-" + getVersion()
+            },
+                new File( getTargetDirectory(), "/SOURCES" ),
+                false );
         }
         catch ( Exception e )
         {
@@ -158,20 +158,20 @@ public class RpmInstallerCommand extends
         log.info( "    Generating Rpm installer" );
 
         MojoHelperUtils.exec( new String[]
-                                {
-                                    mojo.getRpmbuildUtility().getAbsolutePath(),
-                                    "--quiet",
-                                    "-ba",
-                                    "--target",
-                                    target.getOsArch() + "-linux",
-                                    "--define",
-                                    "_topdir " + getTargetDirectory(),
-                                    "--define",
-                                    "_tmppath /tmp",
-                                    "SPECS/apacheds.spec"
-                                },
-                              getTargetDirectory(),
-                              false );
+            {
+                mojo.getRpmbuildUtility().getAbsolutePath(),
+                "--quiet",
+                "-ba",
+                "--target",
+                target.getOsArch() + "-linux",
+                "--define",
+                "_topdir " + getTargetDirectory(),
+                "--define",
+                "_tmppath /tmp",
+                "SPECS/apacheds.spec"
+        },
+            getTargetDirectory(),
+            false );
 
         // Copying the rpm at the final destination
         try

Modified: directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java Tue Jan 24 15:32:28 2012
@@ -74,6 +74,7 @@ public class KeyDerivationInterceptor ex
     /** The service name. */
     private static final String NAME = "keyDerivationService";
 
+
     /**
      * Creates an instance of a KeyDerivationInterceptor.
      */
@@ -81,8 +82,8 @@ public class KeyDerivationInterceptor ex
     {
         super( NAME );
     }
-    
-    
+
+
     /**
      * Intercept the addition of the 'userPassword' and 'krb5PrincipalName' attributes.  Use the 'userPassword'
      * and 'krb5PrincipalName' attributes to derive Kerberos keys for the principal.  If the 'userPassword' is
@@ -100,7 +101,7 @@ public class KeyDerivationInterceptor ex
         {
             log.debug( "Adding the entry '{}' for Dn '{}'.", entry, normName.getName() );
 
-            BinaryValue userPassword = (BinaryValue)entry.get( SchemaConstants.USER_PASSWORD_AT ).get();
+            BinaryValue userPassword = ( BinaryValue ) entry.get( SchemaConstants.USER_PASSWORD_AT ).get();
             String strUserPassword = userPassword.getString();
 
             if ( log.isDebugEnabled() )
@@ -172,14 +173,15 @@ public class KeyDerivationInterceptor ex
      * @param subContext
      * @throws LdapException
      */
-    void detectPasswordModification( ModifyOperationContext modContext, ModifySubContext subContext ) throws LdapException
+    void detectPasswordModification( ModifyOperationContext modContext, ModifySubContext subContext )
+        throws LdapException
     {
         List<Modification> mods = modContext.getModItems();
 
         String operation = null;
 
         // Loop over attributes being modified to pick out 'userPassword' and 'krb5PrincipalName'.
-        for ( Modification mod:mods )
+        for ( Modification mod : mods )
         {
             if ( log.isDebugEnabled() )
             {
@@ -208,18 +210,18 @@ public class KeyDerivationInterceptor ex
 
                 if ( firstValue instanceof StringValue )
                 {
-                    password = ((StringValue)firstValue).getString();
+                    password = ( ( StringValue ) firstValue ).getString();
                     log.debug( "{} Attribute id : 'userPassword',  Values : [ '{}' ]", operation, password );
                 }
                 else if ( firstValue instanceof BinaryValue )
                 {
-                    password = ((BinaryValue)firstValue).getString();
+                    password = ( ( BinaryValue ) firstValue ).getString();
 
                     if ( log.isDebugEnabled() )
                     {
                         StringBuffer sb = new StringBuffer();
                         sb.append( "'" + password + "' ( " );
-                        sb.append( Strings.dumpBytes(((BinaryValue) firstValue).getBytes()).trim() );
+                        sb.append( Strings.dumpBytes( ( ( BinaryValue ) firstValue ).getBytes() ).trim() );
                         sb.append( " )" );
                         log.debug( "{} Attribute id : 'userPassword',  Values : [ {} ]", operation, sb.toString() );
                     }
@@ -245,17 +247,18 @@ public class KeyDerivationInterceptor ex
      * @param subContext
      * @throws LdapException
      */
-    void lookupPrincipalAttributes( ModifyOperationContext modContext, ModifySubContext subContext ) throws LdapException
+    void lookupPrincipalAttributes( ModifyOperationContext modContext, ModifySubContext subContext )
+        throws LdapException
     {
         Dn principalDn = modContext.getDn();
 
         LookupOperationContext lookupContext = modContext.newLookupContext( principalDn );
         lookupContext.setAttrsId( new String[]
             {
-            SchemaConstants.OBJECT_CLASS_AT,
-            KerberosAttribute.KRB5_PRINCIPAL_NAME_AT,
-            KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT
-            } );
+                SchemaConstants.OBJECT_CLASS_AT,
+                KerberosAttribute.KRB5_PRINCIPAL_NAME_AT,
+                KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT
+        } );
 
         Entry userEntry = directoryService.getPartitionNexus().lookup( lookupContext );
 
@@ -264,7 +267,8 @@ public class KeyDerivationInterceptor ex
             throw new LdapAuthenticationException( I18n.err( I18n.ERR_512, principalDn ) );
         }
 
-        Attribute objectClass = ((ClonedServerEntry)userEntry).getOriginalEntry().get( SchemaConstants.OBJECT_CLASS_AT );
+        Attribute objectClass = ( ( ClonedServerEntry ) userEntry ).getOriginalEntry().get(
+            SchemaConstants.OBJECT_CLASS_AT );
 
         if ( !objectClass.contains( SchemaConstants.KRB5_PRINCIPAL_OC ) )
         {
@@ -278,13 +282,15 @@ public class KeyDerivationInterceptor ex
 
         if ( subContext.getPrincipalName() == null )
         {
-            Attribute principalAttribute = ((ClonedServerEntry)userEntry).getOriginalEntry().get( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT );
+            Attribute principalAttribute = ( ( ClonedServerEntry ) userEntry ).getOriginalEntry().get(
+                KerberosAttribute.KRB5_PRINCIPAL_NAME_AT );
             String principalName = principalAttribute.getString();
             subContext.setPrincipalName( principalName );
             log.debug( "Found principal '{}' from lookup.", principalName );
         }
 
-        Attribute keyVersionNumberAttr = ((ClonedServerEntry)userEntry).getOriginalEntry().get( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT );
+        Attribute keyVersionNumberAttr = ( ( ClonedServerEntry ) userEntry ).getOriginalEntry().get(
+            KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT );
 
         if ( keyVersionNumberAttr == null )
         {
@@ -324,7 +330,7 @@ public class KeyDerivationInterceptor ex
         List<Modification> newModsList = new ArrayList<Modification>();
 
         // Make sure we preserve any other modification items.
-        for ( Modification mod:mods )
+        for ( Modification mod : mods )
         {
             newModsList.add( mod );
         }
@@ -356,7 +362,8 @@ public class KeyDerivationInterceptor ex
     }
 
 
-    private Attribute getKeyAttribute( SchemaManager schemaManager, Map<EncryptionType, EncryptionKey> keys ) throws LdapException
+    private Attribute getKeyAttribute( SchemaManager schemaManager, Map<EncryptionType, EncryptionKey> keys )
+        throws LdapException
     {
         Attribute keyAttribute =
             new DefaultAttribute( KerberosAttribute.KRB5_KEY_AT,
@@ -402,7 +409,6 @@ public class KeyDerivationInterceptor ex
         }
     }
 
-
     static class ModifySubContext
     {
         private boolean isPrincipal = false;

Modified: directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java Tue Jan 24 15:32:28 2012
@@ -192,7 +192,7 @@ public class AdministrativePointIntercep
         super( InterceptorEnum.ADMINISTRATIVE_POINT_INTERCEPTOR );
     }
 
-    
+
     /**
      * Get a read-lock on the AP cache.
      * No read operation can be done on the AP cache if this
@@ -348,7 +348,8 @@ public class AdministrativePointIntercep
      * Update the cache clones with the added roles
      */
     private void addRole( String role, Dn dn, String uuid, DnNode<AccessControlAdministrativePoint> acapCache,
-        DnNode<CollectiveAttributeAdministrativePoint> caapCache, DnNode<TriggerExecutionAdministrativePoint> teapCache,
+        DnNode<CollectiveAttributeAdministrativePoint> caapCache,
+        DnNode<TriggerExecutionAdministrativePoint> teapCache,
         DnNode<SubschemaAdministrativePoint> ssapCache ) throws LdapException
     {
         // Deal with Autonomous AP : create the 4 associated SAP/AAP
@@ -436,13 +437,12 @@ public class AdministrativePointIntercep
     }
 
 
-
-
     /**
      * Update the cache clones with the added roles
      */
     private void delRole( String role, Dn dn, String uuid, DnNode<AccessControlAdministrativePoint> acapCache,
-        DnNode<CollectiveAttributeAdministrativePoint> caapCache, DnNode<TriggerExecutionAdministrativePoint> teapCache,
+        DnNode<CollectiveAttributeAdministrativePoint> caapCache,
+        DnNode<TriggerExecutionAdministrativePoint> teapCache,
         DnNode<SubschemaAdministrativePoint> ssapCache ) throws LdapException
     {
         // Deal with Autonomous AP : remove the 4 associated SAP/AAP
@@ -699,7 +699,8 @@ public class AdministrativePointIntercep
                     if ( child.isInner() )
                     {
                         // Ok, we are dead : the IAP will remain with no parent.
-                        String message = "Cannot delete the given role, the " + child.getDn() + " AccessControl IAP will remain orphan";
+                        String message = "Cannot delete the given role, the " + child.getDn()
+                            + " AccessControl IAP will remain orphan";
                         LOG.error( message );
                         throw new LdapUnwillingToPerformException( message );
                     }
@@ -719,7 +720,8 @@ public class AdministrativePointIntercep
                     if ( child.isInner() )
                     {
                         // Ok, we are dead : the IAP will remain with no parent.
-                        String message = "Cannot delete the given role, the " + child.getDn() + " CollectiveAttribute IAP will remain orphan";
+                        String message = "Cannot delete the given role, the " + child.getDn()
+                            + " CollectiveAttribute IAP will remain orphan";
                         LOG.error( message );
                         throw new LdapUnwillingToPerformException( message );
                     }
@@ -739,7 +741,8 @@ public class AdministrativePointIntercep
                     if ( child.isInner() )
                     {
                         // Ok, we are dead : the IAP will remain with no parent.
-                        String message = "Cannot delete the given role, the " + child.getDn() + " TriggerExecution IAP will remain orphan";
+                        String message = "Cannot delete the given role, the " + child.getDn()
+                            + " TriggerExecution IAP will remain orphan";
                         LOG.error( message );
                         throw new LdapUnwillingToPerformException( message );
                     }
@@ -766,7 +769,8 @@ public class AdministrativePointIntercep
         // Search for all the adminstrativePoints in the base
         ExprNode filter = new PresenceNode( ADMINISTRATIVE_ROLE_AT );
 
-        CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( schemaManager, adminDn, AuthenticationLevel.STRONG ),
+        CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( schemaManager, adminDn,
+            AuthenticationLevel.STRONG ),
             directoryService );
 
         SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession, Dn.ROOT_DSE, filter,
@@ -827,7 +831,8 @@ public class AdministrativePointIntercep
     /**
      * Update The Administrative Points cache, removing the given AdminPoint
      */
-    private void deleteAdminPointCache( Attribute adminPoint, DeleteOperationContext deleteContext ) throws LdapException
+    private void deleteAdminPointCache( Attribute adminPoint, DeleteOperationContext deleteContext )
+        throws LdapException
     {
         Dn dn = deleteContext.getDn();
 
@@ -871,7 +876,6 @@ public class AdministrativePointIntercep
                 continue;
             }
 
-
             // Deal with SubSchema AP
             if ( isSubschemaSpecficRole( role ) )
             {
@@ -881,7 +885,7 @@ public class AdministrativePointIntercep
             }
 
             // Deal with TriggerExecution AP
-            if ( isTriggerExecutionSpecificRole( role ) || isTriggerExecutionInnerRole( role ))
+            if ( isTriggerExecutionSpecificRole( role ) || isTriggerExecutionInnerRole( role ) )
             {
                 directoryService.getTriggerExecutionAPCache().remove( dn );
 
@@ -1074,7 +1078,7 @@ public class AdministrativePointIntercep
         {
             DnNode<AccessControlAdministrativePoint> acCache = directoryService.getAccessControlAPCache();
 
-            DnNode<AccessControlAdministrativePoint> parent =  acCache.getNode( dn );
+            DnNode<AccessControlAdministrativePoint> parent = acCache.getNode( dn );
 
             if ( parent == null )
             {
@@ -1102,7 +1106,7 @@ public class AdministrativePointIntercep
         {
             DnNode<TriggerExecutionAdministrativePoint> caCache = directoryService.getTriggerExecutionAPCache();
 
-            DnNode<TriggerExecutionAdministrativePoint> parent =  caCache.getNode( dn );
+            DnNode<TriggerExecutionAdministrativePoint> parent = caCache.getNode( dn );
 
             if ( parent == null )
             {
@@ -1310,7 +1314,8 @@ public class AdministrativePointIntercep
         String uuid = modifyContext.getEntry().get( ENTRY_UUID_AT ).getString();
 
         // Create a clone of the current AdminRole AT
-        Attribute modifiedAdminRole = ((ClonedServerEntry)modifyContext.getEntry() ).getOriginalEntry().get( ADMINISTRATIVE_ROLE_AT );
+        Attribute modifiedAdminRole = ( ( ClonedServerEntry ) modifyContext.getEntry() ).getOriginalEntry().get(
+            ADMINISTRATIVE_ROLE_AT );
 
         if ( modifiedAdminRole == null )
         {
@@ -1324,8 +1329,10 @@ public class AdministrativePointIntercep
 
         // Clone the AP caches before applying modifications to them modify it
         DnNode<AccessControlAdministrativePoint> acapCacheCopy = directoryService.getAccessControlAPCache().clone();
-        DnNode<CollectiveAttributeAdministrativePoint> caapCacheCopy = directoryService.getCollectiveAttributeAPCache().clone();
-        DnNode<TriggerExecutionAdministrativePoint> teapCacheCopy = directoryService.getTriggerExecutionAPCache().clone();
+        DnNode<CollectiveAttributeAdministrativePoint> caapCacheCopy = directoryService.getCollectiveAttributeAPCache()
+            .clone();
+        DnNode<TriggerExecutionAdministrativePoint> teapCacheCopy = directoryService.getTriggerExecutionAPCache()
+            .clone();
         DnNode<SubschemaAdministrativePoint> ssapCacheCopy = directoryService.getSubschemaAPCache().clone();
 
         // Loop on the modification to select the AdministrativeRole and process it :
@@ -1351,7 +1358,8 @@ public class AdministrativePointIntercep
 
                         for ( Value<?> role : attribute )
                         {
-                            addRole( role.getString(), dn, uuid, acapCacheCopy, caapCacheCopy, teapCacheCopy, ssapCacheCopy );
+                            addRole( role.getString(), dn, uuid, acapCacheCopy, caapCacheCopy, teapCacheCopy,
+                                ssapCacheCopy );
 
                             // Add the role to the modified attribute
                             modifiedAdminRole.add( role );
@@ -1375,7 +1383,8 @@ public class AdministrativePointIntercep
                             for ( Value<?> role : modifiedAdminRole )
                             {
                                 //checkDelRole( role, modifiedAdminRole, dn, directoryService.getAdministrativePoints() );
-                                delRole( role.getString(), dn, uuid, acapCacheCopy, caapCacheCopy, teapCacheCopy, ssapCacheCopy );
+                                delRole( role.getString(), dn, uuid, acapCacheCopy, caapCacheCopy, teapCacheCopy,
+                                    ssapCacheCopy );
                             }
 
                             modifiedAdminRole.clear();

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java Tue Jan 24 15:32:28 2012
@@ -47,6 +47,7 @@ import org.apache.directory.shared.util.
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 /**
  * Base class for all Authenticators.
  *
@@ -59,10 +60,11 @@ public abstract class AbstractAuthentica
 
     /** The associated DirectoryService */
     private DirectoryService directoryService;
-    
+
     /** authenticator type */
     private final AuthenticationLevel authenticatorType;
-    
+
+
     /**
      * Creates a new instance.
      *
@@ -82,7 +84,7 @@ public abstract class AbstractAuthentica
     {
         return directoryService;
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -153,25 +155,26 @@ public abstract class AbstractAuthentica
      */
     public void checkPwdPolicy( Entry userEntry ) throws LdapException
     {
-        if( !directoryService.isPwdPolicyEnabled() )
+        if ( !directoryService.isPwdPolicyEnabled() )
         {
             return;
         }
 
-        AuthenticationInterceptor authenticationInterceptor = (AuthenticationInterceptor)directoryService.getInterceptor(
+        AuthenticationInterceptor authenticationInterceptor = ( AuthenticationInterceptor ) directoryService
+            .getInterceptor(
             InterceptorEnum.AUTHENTICATION_INTERCEPTOR.getName() );
         PasswordPolicyConfiguration pPolicyConfig = authenticationInterceptor.getPwdPolicy( userEntry );
-        
+
         // check for locked out account
-        if( pPolicyConfig.isPwdLockout() )
+        if ( pPolicyConfig.isPwdLockout() )
         {
             LOG.debug( "checking if account with the Dn {} is locked", userEntry.getDn() );
-            
+
             Attribute accountLockAttr = userEntry.get( PWD_ACCOUNT_LOCKED_TIME_AT );
-            if( accountLockAttr != null )
+            if ( accountLockAttr != null )
             {
                 String lockedTime = accountLockAttr.getString();
-                if( lockedTime.equals( "000001010000Z" ) )
+                if ( lockedTime.equals( "000001010000Z" ) )
                 {
                     throw new PasswordPolicyException( "account was permanently locked", ACCOUNT_LOCKED.getValue() );
                 }
@@ -180,79 +183,87 @@ public abstract class AbstractAuthentica
                     Date lockedDate = DateUtils.getDate( lockedTime );
                     long time = pPolicyConfig.getPwdLockoutDuration() * 1000;
                     time += lockedDate.getTime();
-                    
+
                     Date unlockedDate = new Date( time );
-                    if( lockedDate.before( unlockedDate ) )
+                    if ( lockedDate.before( unlockedDate ) )
                     {
-                        throw new PasswordPolicyException( "account will remain locked till " + unlockedDate, ACCOUNT_LOCKED.getValue() );
+                        throw new PasswordPolicyException( "account will remain locked till " + unlockedDate,
+                            ACCOUNT_LOCKED.getValue() );
                     }
                     else
                     {
                         // remove pwdAccountLockedTime attribute
-                        Modification pwdAccountLockMod = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,  accountLockAttr );
-                        
+                        Modification pwdAccountLockMod = new DefaultModification(
+                            ModificationOperation.REMOVE_ATTRIBUTE, accountLockAttr );
+
                         // DO NOT bypass the interceptor chain, otherwise the changes can't be replicated
                         directoryService.getAdminSession().modify( userEntry.getDn(), pwdAccountLockMod );
                     }
                 }
             }
         }
-        
+
         Attribute pwdStartTimeAttr = userEntry.get( PWD_START_TIME_AT );
-        if( pwdStartTimeAttr != null )
+        if ( pwdStartTimeAttr != null )
         {
             Date pwdStartTime = DateUtils.getDate( pwdStartTimeAttr.getString() );
-            
-            if( System.currentTimeMillis() < pwdStartTime.getTime() )
+
+            if ( System.currentTimeMillis() < pwdStartTime.getTime() )
             {
-                throw new PasswordPolicyException( "account is locked, will be activated after " + pwdStartTime, ACCOUNT_LOCKED.getValue() );
+                throw new PasswordPolicyException( "account is locked, will be activated after " + pwdStartTime,
+                    ACCOUNT_LOCKED.getValue() );
             }
         }
-        
+
         Attribute pwdEndTimeAttr = userEntry.get( PWD_END_TIME_AT );
-        if( pwdEndTimeAttr != null )
+        if ( pwdEndTimeAttr != null )
         {
             Date pwdEndTime = DateUtils.getDate( pwdEndTimeAttr.getString() );
-            
-            if( System.currentTimeMillis() >= pwdEndTime.getTime() )
+
+            if ( System.currentTimeMillis() >= pwdEndTime.getTime() )
             {
-                throw new PasswordPolicyException( "password end time reached, will be locked till administrator activates it", ACCOUNT_LOCKED.getValue() );
+                throw new PasswordPolicyException(
+                    "password end time reached, will be locked till administrator activates it",
+                    ACCOUNT_LOCKED.getValue() );
             }
         }
-        
-        if( pPolicyConfig.getPwdMaxIdle() > 0 )
+
+        if ( pPolicyConfig.getPwdMaxIdle() > 0 )
         {
             Attribute pwdLastSuccessTimeAttr = userEntry.get( PWD_LAST_SUCCESS_AT );
             long time = pPolicyConfig.getPwdMaxIdle() * 1000;
             time += DateUtils.getDate( pwdLastSuccessTimeAttr.getString() ).getTime();
-            
-            if( System.currentTimeMillis() >= time )
+
+            if ( System.currentTimeMillis() >= time )
             {
-                throw new PasswordPolicyException( "account locked due to the max idle time of the password was exceeded", ACCOUNT_LOCKED.getValue() );
+                throw new PasswordPolicyException(
+                    "account locked due to the max idle time of the password was exceeded", ACCOUNT_LOCKED.getValue() );
             }
         }
-        
+
         if ( pPolicyConfig.getPwdMaxAge() > 0 )
         {
-            if( pPolicyConfig.getPwdGraceAuthNLimit() > 0 )
+            if ( pPolicyConfig.getPwdGraceAuthNLimit() > 0 )
             {
                 Attribute pwdGraceUseAttr = userEntry.get( PWD_GRACE_USE_TIME_AT );
 
                 // check for grace authentication count
-                if( pwdGraceUseAttr != null )
+                if ( pwdGraceUseAttr != null )
                 {
-                    if( pwdGraceUseAttr.size() >= pPolicyConfig.getPwdGraceAuthNLimit() )
+                    if ( pwdGraceUseAttr.size() >= pPolicyConfig.getPwdGraceAuthNLimit() )
                     {
-                        throw new PasswordPolicyException( "paasword expired and max grace logins were used", PASSWORD_EXPIRED.getValue() );
+                        throw new PasswordPolicyException( "paasword expired and max grace logins were used",
+                            PASSWORD_EXPIRED.getValue() );
                     }
                 }
             }
             else
             {
                 Attribute pwdChangeTimeAttr = userEntry.get( PWD_CHANGED_TIME_AT );
-                boolean expired = PasswordUtil.isPwdExpired( pwdChangeTimeAttr.getString(), pPolicyConfig.getPwdMaxAge() );
-                
-                if( expired )
+                boolean expired = PasswordUtil.isPwdExpired( pwdChangeTimeAttr.getString(),
+                    pPolicyConfig.getPwdMaxAge() );
+
+                if ( expired )
                 {
                     throw new PasswordPolicyException( "paasword expired", PASSWORD_EXPIRED.getValue() );
                 }

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java Tue Jan 24 15:32:28 2012
@@ -57,9 +57,9 @@ public class AnonymousAuthenticator exte
         if ( getDirectoryService().isAllowAnonymousAccess() )
         {
             LdapPrincipal principal = getDirectoryService().getAdminSession().getAnonymousPrincipal();
-            
+
             IoSession session = bindContext.getIoSession();
-            
+
             if ( session != null )
             {
                 SocketAddress clientAddress = session.getRemoteAddress();
@@ -67,7 +67,7 @@ public class AnonymousAuthenticator exte
                 SocketAddress serverAddress = session.getServiceAddress();
                 principal.setServerAddress( serverAddress );
             }
-            
+
             return principal;
         }
         else

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Tue Jan 24 15:32:28 2012
@@ -231,7 +231,7 @@ public class AuthenticationInterceptor e
 
         this.authenticators.clear();
 
-        for (Authenticator authenticator : authenticators)
+        for ( Authenticator authenticator : authenticators )
         {
             this.authenticators.add( authenticator );
         }
@@ -312,7 +312,6 @@ public class AuthenticationInterceptor e
 
         Entry entry = addContext.getEntry();
 
-
         if ( !directoryService.isPwdPolicyEnabled() )
         {
             next( addContext );
@@ -342,7 +341,8 @@ public class AuthenticationInterceptor e
                 {
                     PasswordPolicyDecorator responseControl =
                         new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true );
-                    responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.get( e.getErrorCode() ) );
+                    responseControl.getResponse().setPasswordPolicyError(
+                        PasswordPolicyErrorEnum.get( e.getErrorCode() ) );
                     addContext.addResponseControl( responseControl );
                 }
 
@@ -808,8 +808,7 @@ public class AuthenticationInterceptor e
 
         checkAuthenticated( modifyContext );
 
-
-        if ( ! directoryService.isPwdPolicyEnabled() )
+        if ( !directoryService.isPwdPolicyEnabled() )
         {
             next( modifyContext );
             invalidateAuthenticatorCaches( modifyContext.getDn() );
@@ -836,7 +835,8 @@ public class AuthenticationInterceptor e
                     {
                         PasswordPolicyDecorator responseControl =
                             new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true );
-                        responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.CHANGE_AFTER_RESET );
+                        responseControl.getResponse().setPasswordPolicyError(
+                            PasswordPolicyErrorEnum.CHANGE_AFTER_RESET );
                         modifyContext.addResponseControl( responseControl );
                     }
 
@@ -854,7 +854,8 @@ public class AuthenticationInterceptor e
                     {
                         PasswordPolicyDecorator responseControl =
                             new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true );
-                        responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.MUST_SUPPLY_OLD_PASSWORD );
+                        responseControl.getResponse().setPasswordPolicyError(
+                            PasswordPolicyErrorEnum.MUST_SUPPLY_OLD_PASSWORD );
                         modifyContext.addResponseControl( responseControl );
                     }
 
@@ -868,7 +869,8 @@ public class AuthenticationInterceptor e
                 {
                     PasswordPolicyDecorator responseControl =
                         new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true );
-                    responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.PASSWORD_MOD_NOT_ALLOWED );
+                    responseControl.getResponse().setPasswordPolicyError(
+                        PasswordPolicyErrorEnum.PASSWORD_MOD_NOT_ALLOWED );
                     modifyContext.addResponseControl( responseControl );
                 }
 
@@ -908,7 +910,8 @@ public class AuthenticationInterceptor e
                     {
                         PasswordPolicyDecorator responseControl =
                             new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true );
-                        responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.get( e.getErrorCode() ) );
+                        responseControl.getResponse().setPasswordPolicyError(
+                            PasswordPolicyErrorEnum.get( e.getErrorCode() ) );
                         modifyContext.addResponseControl( responseControl );
                     }
 
@@ -933,7 +936,7 @@ public class AuthenticationInterceptor e
 
                 List<PasswordHistory> pwdHistLst = new ArrayList<PasswordHistory>();
 
-                for ( Value<?> value : pwdHistoryAt  )
+                for ( Value<?> value : pwdHistoryAt )
                 {
                     PasswordHistory pwdh = new PasswordHistory( Strings.utf8ToString( value.getBytes() ) );
 
@@ -945,7 +948,8 @@ public class AuthenticationInterceptor e
                         {
                             PasswordPolicyDecorator responseControl =
                                 new PasswordPolicyDecorator( directoryService.getLdapCodecService(), true );
-                            responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.PASSWORD_IN_HISTORY );
+                            responseControl.getResponse().setPasswordPolicyError(
+                                PasswordPolicyErrorEnum.PASSWORD_IN_HISTORY );
                             modifyContext.addResponseControl( responseControl );
                         }
 
@@ -1181,14 +1185,15 @@ public class AuthenticationInterceptor e
 
             AT_PWD_GRACE_USE_TIME = schemaManager.lookupAttributeTypeRegistry( PWD_GRACE_USE_TIME_AT );
             PWD_POLICY_STATE_ATTRIBUTE_TYPES.add( AT_PWD_GRACE_USE_TIME );
-            
+
             PWD_POLICY_STATE_ATTRIBUTE_TYPES.add( schemaManager.lookupAttributeTypeRegistry( PWD_POLICY_SUBENTRY_AT ) );
         }
     }
 
 
     // ---------- private methods ----------------
-    private void check( String username, byte[] password, PasswordPolicyConfiguration policyConfig ) throws LdapException
+    private void check( String username, byte[] password, PasswordPolicyConfiguration policyConfig )
+        throws LdapException
     {
         final int qualityVal = policyConfig.getPwdCheckQuality();
 
@@ -1214,7 +1219,7 @@ public class AuthenticationInterceptor e
             }
         }
 
-        String strPassword = Strings.utf8ToString(password);
+        String strPassword = Strings.utf8ToString( password );
 
         // perform the length validation
         validatePasswordLength( strPassword, policyConfig );
@@ -1226,7 +1231,8 @@ public class AuthenticationInterceptor e
     /**
      * validates the length of the password
      */
-    private void validatePasswordLength( String password, PasswordPolicyConfiguration policyConfig ) throws PasswordPolicyException
+    private void validatePasswordLength( String password, PasswordPolicyConfiguration policyConfig )
+        throws PasswordPolicyException
     {
         int maxLen = policyConfig.getPwdMaxLength();
         int minLen = policyConfig.getPwdMinLength();
@@ -1253,7 +1259,8 @@ public class AuthenticationInterceptor e
     }
 
 
-    private int getPwdTimeBeforeExpiry( Entry userEntry, PasswordPolicyConfiguration policyConfig ) throws LdapException
+    private int getPwdTimeBeforeExpiry( Entry userEntry, PasswordPolicyConfiguration policyConfig )
+        throws LdapException
     {
         if ( policyConfig.getPwdMaxAge() == 0 )
         {
@@ -1268,7 +1275,7 @@ public class AuthenticationInterceptor e
         }
 
         Attribute pwdChangedTimeAt = userEntry.get( PWD_CHANGED_TIME_AT );
-        long changedTime = DateUtils.getDate(pwdChangedTimeAt.getString()).getTime();
+        long changedTime = DateUtils.getDate( pwdChangedTimeAt.getString() ).getTime();
 
         long currentTime = DateUtils.getDate( DateUtils.getGeneralizedTime() ).getTime();
         int pwdAge = ( int ) ( currentTime - changedTime ) / 1000;
@@ -1344,7 +1351,8 @@ public class AuthenticationInterceptor e
     }
 
 
-    private PwdModDetailsHolder getPwdModDetails( ModifyOperationContext modifyContext, PasswordPolicyConfiguration policyConfig ) throws LdapException
+    private PwdModDetailsHolder getPwdModDetails( ModifyOperationContext modifyContext,
+        PasswordPolicyConfiguration policyConfig ) throws LdapException
     {
         PwdModDetailsHolder pwdModDetails = new PwdModDetailsHolder();
 
@@ -1388,7 +1396,7 @@ public class AuthenticationInterceptor e
      */
     private void checkPwdReset( OperationContext opContext ) throws LdapException
     {
-        if ( ! directoryService.isPwdPolicyEnabled() )
+        if ( !directoryService.isPwdPolicyEnabled() )
         {
             CoreSession session = opContext.getSession();
 
@@ -1411,7 +1419,6 @@ public class AuthenticationInterceptor e
         }
     }
 
-
     private static class PwdModDetailsHolder
     {
         private boolean pwdModPresent = false;
@@ -1537,8 +1544,8 @@ public class AuthenticationInterceptor e
     public boolean isPwdPolicyEnabled()
     {
         return ( ( pwdPolicyContainer != null )
-            && ( ( pwdPolicyContainer.getDefaultPolicy() != null )
-                || ( pwdPolicyContainer.hasCustomConfigs() ) ) );
+        && ( ( pwdPolicyContainer.getDefaultPolicy() != null )
+        || ( pwdPolicyContainer.hasCustomConfigs() ) ) );
     }
 
 

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/Authenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/Authenticator.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/Authenticator.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/Authenticator.java Tue Jan 24 15:32:28 2012
@@ -70,7 +70,7 @@ public interface Authenticator
      */
     void destroy();
 
-    
+
     /**
      * Callback used to respond to password changes by invalidating a password
      * cache if implemented.  This is an additional feature of an authenticator
@@ -81,7 +81,7 @@ public interface Authenticator
      */
     void invalidateCache( Dn bindDn );
 
-    
+
     /**
      * Performs authentication and returns the principal if succeeded.
      * 
@@ -89,8 +89,8 @@ public interface Authenticator
      * @exception If the authentication failed
      */
     LdapPrincipal authenticate( BindOperationContext bindContext ) throws Exception;
-    
-    
+
+
     /**
      *  performs checks on the given entry based on the specified password policy configuration
      *
@@ -98,8 +98,7 @@ public interface Authenticator
      * @throws PasswordPolicyException
      */
     void checkPwdPolicy( Entry userEntry ) throws LdapException;
-    
-    
+
     /**
      * Performs an unbind on the given context
      * 

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java Tue Jan 24 15:32:28 2012
@@ -45,13 +45,14 @@ public class DelegatingAuthenticator ext
 {
     /** A speedup for logger in debug mode */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
-    
+
     /** The host in charge of delegated authentication */
     private String delegateHost;
-    
+
     /** The associated port */
     private int delegatePort;
-    
+
+
     /**
      * Creates a new instance.
      * @see AbstractAuthenticator
@@ -113,26 +114,26 @@ public class DelegatingAuthenticator ext
      * {@inheritDoc}
      */
     public LdapPrincipal authenticate( BindOperationContext bindContext )
-            throws Exception
+        throws Exception
     {
         LdapPrincipal principal = null;
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "Authenticating {}", bindContext.getDn() );
         }
-        
+
         // Create a connection on the remote host 
         LdapConnection ldapConnection = LdapConnectionFactory.getNetworkConnection( delegateHost, delegatePort );
-        
+
         try
         {
             // Try to bind
             try
             {
                 ldapConnection.bind( bindContext.getDn(),
-                    Strings.utf8ToString(bindContext.getCredentials()) );
-                
+                    Strings.utf8ToString( bindContext.getCredentials() ) );
+
                 // no need to remain bound to delegate host
                 ldapConnection.unBind();
             }
@@ -142,13 +143,14 @@ public class DelegatingAuthenticator ext
                 LOG.info( message );
                 throw new LdapAuthenticationException( message );
             }
-            
+
             // Create the new principal
-            principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindContext.getDn(), AuthenticationLevel.SIMPLE,
+            principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindContext.getDn(),
+                AuthenticationLevel.SIMPLE,
                 bindContext.getCredentials() );
-            
+
             IoSession session = bindContext.getIoSession();
-            
+
             if ( session != null )
             {
                 SocketAddress clientAddress = session.getRemoteAddress();
@@ -156,7 +158,7 @@ public class DelegatingAuthenticator ext
                 SocketAddress serverAddress = session.getServiceAddress();
                 principal.setServerAddress( serverAddress );
             }
-            
+
             return principal;
 
         }

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/EncryptionMethod.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/EncryptionMethod.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/EncryptionMethod.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/EncryptionMethod.java Tue Jan 24 15:32:28 2012
@@ -51,7 +51,8 @@ public class EncryptionMethod
     private LdapSecurityConstants algorithm;
 
 
-    /** package protected */EncryptionMethod( LdapSecurityConstants algorithm, byte[] salt )
+    /** package protected */
+    EncryptionMethod( LdapSecurityConstants algorithm, byte[] salt )
     {
         this.algorithm = algorithm;
         this.salt = salt;
@@ -70,14 +71,15 @@ public class EncryptionMethod
     }
 
 
-    /** package protected */ void setSalt( byte[] salt )
+    /** package protected */
+    void setSalt( byte[] salt )
     {
         // just to make this class immutable, though we have a setter
         if ( this.salt != null )
         {
             throw new IllegalStateException( "salt will only be allowed to set once" );
         }
-        
+
         this.salt = salt;
     }
 
@@ -85,8 +87,8 @@ public class EncryptionMethod
     @Override
     public String toString()
     {
-        return "EncryptionMethod [algorithm=" + algorithm.getName().toUpperCase() + ", salt=" + Strings.dumpBytes(salt) + "]";
+        return "EncryptionMethod [algorithm=" + algorithm.getName().toUpperCase() + ", salt="
+            + Strings.dumpBytes( salt ) + "]";
     }
-    
-    
+
 }

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/PasswordHistory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/PasswordHistory.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/PasswordHistory.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/PasswordHistory.java Tue Jan 24 15:32:28 2012
@@ -89,7 +89,7 @@ public class PasswordHistory implements 
 
         sb.append( data );
 
-        return Strings.getBytesUtf8(sb.toString());
+        return Strings.getBytesUtf8( sb.toString() );
     }
 
 
@@ -134,7 +134,7 @@ public class PasswordHistory implements 
         PasswordHistory other = ( PasswordHistory ) o;
 
         return this.getTime().equals( other.getTime() ) &&
-               this.data.equals( other.data );
+            this.data.equals( other.data );
     }
 
 

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java Tue Jan 24 15:32:28 2012
@@ -124,10 +124,10 @@ public class PasswordUtil
      */
     public static byte[] createStoragePassword( String credentials, LdapSecurityConstants algorithm )
     {
-        return createStoragePassword( Strings.getBytesUtf8(credentials), algorithm );
+        return createStoragePassword( Strings.getBytesUtf8( credentials ), algorithm );
     }
-    
-    
+
+
     /**
      * create a hashed password in a format that can be stored in the server.
      * If the specified algorithm requires a salt then a random salt of 8 byte size is used
@@ -139,8 +139,8 @@ public class PasswordUtil
     public static byte[] createStoragePassword( byte[] credentials, LdapSecurityConstants algorithm )
     {
         byte[] salt;
-        
-        switch( algorithm )
+
+        switch ( algorithm )
         {
             case HASH_METHOD_SSHA:
             case HASH_METHOD_SSHA256:
@@ -150,21 +150,21 @@ public class PasswordUtil
                 salt = new byte[8]; // we use 8 byte salt always except for "crypt" which needs 2 byte salt
                 new SecureRandom().nextBytes( salt );
                 break;
-                
+
             case HASH_METHOD_CRYPT:
                 salt = new byte[2];
                 SecureRandom sr = new SecureRandom();
                 int i1 = sr.nextInt( 64 );
                 int i2 = sr.nextInt( 64 );
-                
+
                 salt[0] = ( byte ) ( i1 < 12 ? ( i1 + '.' ) : i1 < 38 ? ( i1 + 'A' - 12 ) : ( i1 + 'a' - 38 ) );
                 salt[1] = ( byte ) ( i2 < 12 ? ( i2 + '.' ) : i2 < 38 ? ( i2 + 'A' - 12 ) : ( i2 + 'a' - 38 ) );
                 break;
-                
+
             default:
                 salt = null;
         }
-        
+
         byte[] hashedPassword = encryptPassword( credentials, algorithm, salt );
         StringBuffer sb = new StringBuffer();
 
@@ -174,8 +174,8 @@ public class PasswordUtil
 
             if ( algorithm == LdapSecurityConstants.HASH_METHOD_CRYPT )
             {
-                sb.append( Strings.utf8ToString(salt) );
-                sb.append( Strings.utf8ToString(hashedPassword) );
+                sb.append( Strings.utf8ToString( salt ) );
+                sb.append( Strings.utf8ToString( hashedPassword ) );
             }
             else if ( salt != null )
             {
@@ -185,17 +185,17 @@ public class PasswordUtil
             }
             else
             {
-                sb.append( String.valueOf( Base64.encode(hashedPassword) ) );
+                sb.append( String.valueOf( Base64.encode( hashedPassword ) ) );
             }
         }
         else
         {
-            sb.append( Strings.utf8ToString(hashedPassword) );
+            sb.append( Strings.utf8ToString( hashedPassword ) );
         }
-        
-        return Strings.getBytesUtf8(sb.toString());
+
+        return Strings.getBytesUtf8( sb.toString() );
     }
-    
+
 
     /**
      * 
@@ -242,22 +242,23 @@ public class PasswordUtil
     public static boolean compareCredentials( byte[] receivedCredentials, byte[] storedCredentials )
     {
         LdapSecurityConstants algorithm = findAlgorithm( storedCredentials );
-        
+
         if ( algorithm != null )
         {
             EncryptionMethod encryptionMethod = new EncryptionMethod( algorithm, null );
-            
+
             // Let's get the encrypted part of the stored password
             // We should just keep the password, excluding the algorithm
             // and the salt, if any.
             // But we should also get the algorithm and salt to
             // be able to encrypt the submitted user password in the next step
             byte[] encryptedStored = PasswordUtil.splitCredentials( storedCredentials, encryptionMethod );
-            
+
             // Reuse the saltedPassword informations to construct the encrypted
             // password given by the user.
-            byte[] userPassword = PasswordUtil.encryptPassword( receivedCredentials, encryptionMethod.getAlgorithm(), encryptionMethod.getSalt() );
-            
+            byte[] userPassword = PasswordUtil.encryptPassword( receivedCredentials, encryptionMethod.getAlgorithm(),
+                encryptionMethod.getSalt() );
+
             // Now, compare the two passwords.
             return Arrays.equals( userPassword, encryptedStored );
         }
@@ -266,7 +267,7 @@ public class PasswordUtil
             return Arrays.equals( storedCredentials, receivedCredentials );
         }
     }
-    
+
 
     /**
      * encrypts the given credentials based on the algorithm name and optional salt
@@ -301,11 +302,11 @@ public class PasswordUtil
                 return digest( LdapSecurityConstants.HASH_METHOD_MD5, credentials, salt );
 
             case HASH_METHOD_CRYPT:
-                String saltWithCrypted = UnixCrypt.crypt( Strings.utf8ToString(credentials), Strings
-                    .utf8ToString(salt) );
+                String saltWithCrypted = UnixCrypt.crypt( Strings.utf8ToString( credentials ), Strings
+                    .utf8ToString( salt ) );
                 String crypted = saltWithCrypted.substring( 2 );
 
-                return Strings.getBytesUtf8(crypted);
+                return Strings.getBytesUtf8( crypted );
 
             default:
                 return credentials;
@@ -364,7 +365,7 @@ public class PasswordUtil
         int algoLength = encryptionMethod.getAlgorithm().getName().length() + 2;
 
         int hashLen = 0;
-        
+
         switch ( encryptionMethod.getAlgorithm() )
         {
             case HASH_METHOD_MD5:
@@ -408,28 +409,28 @@ public class PasswordUtil
 
             case HASH_METHOD_SSHA:
                 hashLen = SHA1_LENGTH;
-            
+
             case HASH_METHOD_SHA256:
             case HASH_METHOD_SSHA256:
                 if ( hashLen == 0 )
                 {
                     hashLen = SHA256_LENGTH;
                 }
-            
+
             case HASH_METHOD_SHA384:
             case HASH_METHOD_SSHA384:
                 if ( hashLen == 0 )
                 {
                     hashLen = SHA384_LENGTH;
                 }
-                
+
             case HASH_METHOD_SHA512:
             case HASH_METHOD_SSHA512:
                 if ( hashLen == 0 )
                 {
                     hashLen = SHA512_LENGTH;
                 }
-                
+
                 try
                 {
                     // The password is associated with a salt. Decompose it

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=1235300&r1=1235299&r2=1235300&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java Tue Jan 24 15:32:28 2012
@@ -90,6 +90,7 @@ public class SimpleAuthenticator extends
     /** Declare a default for this cache. 100 entries seems to be enough */
     private static final int DEFAULT_CACHE_SIZE = 100;
 
+
     /**
      * Creates a new instance.
      * @see AbstractAuthenticator
@@ -124,7 +125,7 @@ public class SimpleAuthenticator extends
         LdapPrincipal principal = null;
 
         // use cache only if pwdpolicy is not enabled
-        if( !getDirectoryService().isPwdPolicyEnabled() )
+        if ( !getDirectoryService().isPwdPolicyEnabled() )
         {
             synchronized ( credentialCache )
             {
@@ -150,10 +151,11 @@ public class SimpleAuthenticator extends
             }
 
             // Create the new principal before storing it in the cache
-            principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindContext.getDn(), AuthenticationLevel.SIMPLE, storedPassword );
+            principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindContext.getDn(),
+                AuthenticationLevel.SIMPLE, storedPassword );
 
             // Now, update the local cache ONLY if pwdpolicy is not enabled.
-            if( !getDirectoryService().isPwdPolicyEnabled() )
+            if ( !getDirectoryService().isPwdPolicyEnabled() )
             {
                 synchronized ( credentialCache )
                 {
@@ -186,7 +188,7 @@ public class SimpleAuthenticator extends
         LdapPrincipal principal = getStoredPassword( bindContext );
 
         IoSession session = bindContext.getIoSession();
-        
+
         if ( session != null )
         {
             SocketAddress clientAddress = session.getRemoteAddress();
@@ -194,7 +196,7 @@ public class SimpleAuthenticator extends
             SocketAddress serverAddress = session.getServiceAddress();
             principal.setServerAddress( serverAddress );
         }
-        
+
         // Get the stored password, either from cache or from backend
         byte[] storedPassword = principal.getUserPassword();
 
@@ -243,7 +245,7 @@ public class SimpleAuthenticator extends
             lookupContext.addAttrsId( SchemaConstants.ALL_USER_ATTRIBUTES );
             // OP attributes required for ppolicy
             lookupContext.addAttrsId( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES );
-            
+
             userEntry = getDirectoryService().getPartitionNexus().lookup( lookupContext );
 
             if ( userEntry == null )
@@ -299,7 +301,7 @@ public class SimpleAuthenticator extends
         String result = null;
 
         // Check if password arg is string or byte[]
-        String sPassword = Strings.utf8ToString(password);
+        String sPassword = Strings.utf8ToString( password );
         int rightParen = sPassword.indexOf( '}' );
 
         if ( ( sPassword.length() > 2 ) && ( sPassword.charAt( 0 ) == '{' ) && ( rightParen > -1 ) )
@@ -353,9 +355,9 @@ public class SimpleAuthenticator extends
         {
             if ( LdapSecurityConstants.HASH_METHOD_CRYPT.getName().equalsIgnoreCase( algorithm ) )
             {
-                String saltWithCrypted = UnixCrypt.crypt(Strings.utf8ToString(password), "");
+                String saltWithCrypted = UnixCrypt.crypt( Strings.utf8ToString( password ), "" );
                 String crypted = saltWithCrypted.substring( 2 );
-                return '{' + algorithm + '}' + Arrays.toString( Strings.getBytesUtf8(crypted) );
+                return '{' + algorithm + '}' + Arrays.toString( Strings.getBytesUtf8( crypted ) );
             }
             else
             {
@@ -363,7 +365,7 @@ public class SimpleAuthenticator extends
 
                 // calculate hashed value of password
                 byte[] fingerPrint = digest.digest( password );
-                char[] encoded = Base64.encode(fingerPrint);
+                char[] encoded = Base64.encode( fingerPrint );
 
                 // create return result of form "{alg}bbbbbbb"
                 return '{' + algorithm + '}' + new String( encoded );



Mime
View raw message