directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r582462 [10/10] - in /directory: apacheds/branches/bigbang/ apacheds/branches/bigbang/core-unit/src/main/java/org/apache/directory/server/core/unit/ apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/ apached...
Date Sat, 06 Oct 2007 06:48:45 GMT
Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java Fri Oct  5 23:48:35 2007
@@ -60,7 +60,7 @@
 {
     private static final String RDN = "uid=hnelson,ou=users,dc=example,dc=com";
 
-    private DirContext ctx = null;
+    private DirContext ctx;
 
 
     /**
@@ -69,7 +69,7 @@
      */
     public void setUp() throws Exception
     {
-        configuration.setAllowAnonymousAccess( false );
+        apacheDS.setAllowAnonymousAccess( false );
 
         Attributes attrs;
         Set<Partition> partitions = new HashSet<Partition>();
@@ -98,17 +98,20 @@
         partition.setContextEntry( attrs );
 
         partitions.add( partition );
-        configuration.setPartitions( partitions );
+        apacheDS.getDirectoryService().setPartitions( partitions );
 
-        List<Interceptor> list = configuration.getInterceptors();
+        List<Interceptor> list = apacheDS.getDirectoryService().getInterceptors();
 
         list.add( new KeyDerivationService() );
-        configuration.setInterceptors( list );
+        apacheDS.getDirectoryService().setInterceptors( list );
 
-        doDelete( configuration.getWorkingDirectory() );
+        doDelete( apacheDS.getDirectoryService().getWorkingDirectory() );
         port = AvailablePortFinder.getNextAvailable( 1024 );
-        configuration.getLdapConfiguration().setIpPort( port );
-        configuration.setShutdownHookEnabled( false );
+        apacheDS.getLdapConfiguration().setIpPort( port );
+        apacheDS.getDirectoryService().setShutdownHookEnabled( false );
+
+        super.setUp();
+
         setContexts( "uid=admin,ou=system", "secret" );
 
         // -------------------------------------------------------------------
@@ -151,8 +154,8 @@
     /**
      * Tests that the addition of an entry caused keys to be derived and added.
      * 
-     * @throws NamingException
-     * @throws IOException 
+     * @throws NamingException failure to perform LDAP operations
+     * @throws IOException on network errors
      */
     public void testAddDerivedKeys() throws NamingException, IOException
     {
@@ -221,8 +224,8 @@
      * Tests that the modification of an entry caused keys to be derived and modified.  The
      * modify request contains both the 'userPassword' and the 'krb5PrincipalName'.
      * 
-     * @throws NamingException
-     * @throws IOException 
+     * @throws NamingException failure to perform LDAP operations
+     * @throws IOException on network errors
      */
     public void testModifyDerivedKeys() throws NamingException, IOException
     {
@@ -358,8 +361,8 @@
      * modify request contains only the 'userPassword'.  The 'krb5PrincipalName' is to be
      * obtained from the initial add of the user principal entry.
      * 
-     * @throws NamingException
-     * @throws IOException 
+     * @throws NamingException failure to perform LDAP operations
+     * @throws IOException on network errors
      */
     public void testModifyDerivedKeysWithoutPrincipalName() throws NamingException, IOException
     {
@@ -486,9 +489,9 @@
     /**
      * Tests that the addition of an entry caused random keys to be derived and added.
      * 
-     * @throws NamingException 
-     * @throws IOException 
-     * @throws InvalidKeyException 
+     * @throws NamingException failure to perform LDAP operations
+     * @throws IOException on network errors
+     * @throws InvalidKeyException if the incorrect key results
      */
     public void testAddRandomKeys() throws NamingException, IOException, InvalidKeyException
     {
@@ -601,6 +604,13 @@
 
     /**
      * Convenience method for creating a person.
+     *
+     * @param cn the commonName of the person
+     * @param sn the surName of the person
+     * @param uid the unique id of the person
+     * @param userPassword the password of the person
+     * @param principal the kerberos principal name for the person
+     * @return the attributes of the person entry
      */
     protected Attributes getPersonAttributes( String sn, String cn, String uid, String userPassword, String principal )
     {
@@ -625,6 +635,9 @@
 
     /**
      * Convenience method for creating an organizational unit.
+     *
+     * @param ou the organizational unit to create
+     * @return the attributes of the organizationalUnit
      */
     protected Attributes getOrgUnitAttributes( String ou )
     {

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/MiscTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/MiscTest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/MiscTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/MiscTest.java Fri Oct  5 23:48:35 2007
@@ -72,16 +72,16 @@
         if ( this.getName().equals( "testDisableAnonymousBinds" ) ||
              this.getName().equals( "testCompareWithoutAuthentication" ) )
         {
-            configuration.setAllowAnonymousAccess( false );
+            apacheDS.setAllowAnonymousAccess( false );
         }
         else if ( this.getName().equals( "testEnableAnonymousBindsOnRootDSE" ) )
         {
-            configuration.setAllowAnonymousAccess( false );
+            apacheDS.setAllowAnonymousAccess( false );
         }
         else if ( this.getName().equals( "testUserAuthOnMixedCaseSuffix" ) )
         {
             Set<Partition> partitions = new HashSet<Partition>();
-            partitions.addAll( configuration.getPartitions() );
+            partitions.addAll( apacheDS.getDirectoryService().getPartitions() );
             JdbmPartition partition = new JdbmPartition();
             partition.setSuffix( "dc=aPache,dc=org" );
             Attributes entry = new AttributesImpl( "dc", "aPache", true );
@@ -95,16 +95,16 @@
             indexedAttributes.add( new JdbmIndex( "dc" ) );
             partition.setIndexedAttributes( indexedAttributes );
             partitions.add( partition );
-            configuration.setPartitions( partitions );
+            apacheDS.getDirectoryService().setPartitions( partitions );
         }
         else if ( this.getName().equals( "testAnonymousBindsEnabledBaseSearch" ) )
         {
             // allow anonymous access
-            configuration.setAllowAnonymousAccess( true );
+            apacheDS.setAllowAnonymousAccess( true );
 
             // create a partition to search
             Set partitions = new HashSet();
-            partitions.addAll( configuration.getPartitions() );
+            partitions.addAll( apacheDS.getDirectoryService().getPartitions() );
             JdbmPartition partition = new JdbmPartition();
             partition.setSuffix( "dc=apache,dc=org" );
             Attributes entry = new AttributesImpl( "dc", "apache", true );
@@ -118,7 +118,7 @@
             indexedAttributes.add( new JdbmIndex( "dc" ) );
             partition.setIndexedAttributes( indexedAttributes );
             partitions.add( partition );
-            configuration.setPartitions( partitions );
+            apacheDS.getDirectoryService().setPartitions( partitions );
         }
 
         super.setUp();

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NegationOperatorITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NegationOperatorITest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NegationOperatorITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NegationOperatorITest.java Fri Oct  5 23:48:35 2007
@@ -94,7 +94,7 @@
                 NamespaceTools.getRdnValue( PartitionNexus.SYSTEM_PARTITION_SUFFIX ) );
             system.setContextEntry( systemEntry );
             
-            configuration.setSystemPartition( system );
+            apacheDS.getDirectoryService().setSystemPartition( system );
         }
         
         super.setUp();

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NtpITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NtpITest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NtpITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/NtpITest.java Fri Oct  5 23:48:35 2007
@@ -22,6 +22,7 @@
 
 import org.apache.commons.net.ntp.NTPUDPClient;
 import org.apache.commons.net.ntp.TimeInfo;
+import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.Index;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
@@ -52,7 +53,7 @@
  */
 public class NtpITest extends AbstractServerTest
 {
-    private DirContext ctx = null;
+    private DirContext ctx;
 
 
     /**
@@ -60,12 +61,12 @@
      */
     public void setUp() throws Exception
     {
-        configuration.setAllowAnonymousAccess( false );
+        apacheDS.setAllowAnonymousAccess( false );
 
-        LdapConfiguration ldapConfig = configuration.getLdapConfiguration();
+        LdapConfiguration ldapConfig = apacheDS.getLdapConfiguration();
         ldapConfig.setEnabled( false );
 
-        NtpConfiguration ntpConfig = configuration.getNtpConfiguration();
+        NtpConfiguration ntpConfig = apacheDS.getNtpConfiguration();
         ntpConfig.setEnabled( true );
 
         port = AvailablePortFinder.getNextAvailable( 10123 );
@@ -96,14 +97,19 @@
         partition.setContextEntry( attrs );
 
         partitions.add( partition );
-        configuration.setPartitions( partitions );
+        apacheDS.getDirectoryService().setPartitions( partitions );
+
+        doDelete( apacheDS.getDirectoryService().getWorkingDirectory() );
+        apacheDS.getDirectoryService().setShutdownHookEnabled( false );
+        apacheDS.getNtpConfiguration().setEnabled( true );
+        apacheDS.getNtpConfiguration().setIpPort( AvailablePortFinder.getNextAvailable( 1123) );
+        super.setUp();
 
-        doDelete( configuration.getWorkingDirectory() );
-        configuration.setShutdownHookEnabled( false );
         setContexts( "uid=admin,ou=system", "secret" );
 
         // Get a context.
-        Hashtable<String, String> env = new Hashtable<String, String>();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
+        env.put( DirectoryService.JNDI_KEY, apacheDS.getDirectoryService() );
         env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" );
         env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -117,7 +123,7 @@
     /**
      * Tests to make sure NTP works when enabled in the server.
      * 
-     * @throws Exception 
+     * @throws Exception  if there are errors
      */
     public void testNtp() throws Exception
     {
@@ -128,8 +134,7 @@
         NTPUDPClient ntp = new NTPUDPClient();
         ntp.setDefaultTimeout( 5000 );
 
-        TimeInfo timeInfo = ntp.getTime( host, port );
-
+        TimeInfo timeInfo = ntp.getTime( host, apacheDS.getNtpConfiguration().getIpPort() );
         long returnTime = timeInfo.getReturnTime();
         assertTrue( currentTime - returnTime < 1000 );
 

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java Fri Oct  5 23:48:35 2007
@@ -49,8 +49,8 @@
  */
 public class PasswordPolicyServiceITest extends AbstractServerTest
 {
-    private DirContext ctx = null;
-    private DirContext users = null;
+    private DirContext ctx;
+    private DirContext users;
 
 
     /**
@@ -59,7 +59,7 @@
      */
     public void setUp() throws Exception
     {
-        configuration.setAllowAnonymousAccess( false );
+        apacheDS.setAllowAnonymousAccess( false );
 
         Attributes attrs;
         Set<Partition> partitions = new HashSet<Partition>();
@@ -86,12 +86,12 @@
         partition.setContextEntry( attrs );
 
         partitions.add( partition );
-        configuration.setPartitions( partitions );
+        apacheDS.getDirectoryService().setPartitions( partitions );
 
-        List<Interceptor> list = configuration.getInterceptors();
+        List<Interceptor> list = apacheDS.getDirectoryService().getInterceptors();
 
         list.add( new PasswordPolicyService() );
-        configuration.setInterceptors( list );
+        apacheDS.getDirectoryService().setInterceptors( list );
 
         super.setUp();
 

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java Fri Oct  5 23:48:35 2007
@@ -49,7 +49,7 @@
  */
 public class SaslBindITest extends AbstractServerTest
 {
-    private DirContext ctx = null;
+    private DirContext ctx;
 
 
     /**
@@ -58,26 +58,21 @@
      */
     public void setUp() throws Exception
     {
-        configuration.setAllowAnonymousAccess( false );
-        configuration.getLdapConfiguration().setSaslHost( "localhost" );
+        apacheDS.setAllowAnonymousAccess( false );
+        apacheDS.getLdapConfiguration().setSaslHost( "localhost" );
 
-        Attributes attrs;
         Set<Partition> partitions = new HashSet<Partition>();
-
-        JdbmPartition pcfg;
-
-        // Add partition 'example'
-        pcfg = new JdbmPartition();
-        pcfg.setId( "example" );
-        pcfg.setSuffix( "dc=example,dc=com" );
+        JdbmPartition partition = new JdbmPartition();
+        partition.setId( "example" );
+        partition.setSuffix( "dc=example,dc=com" );
 
         Set<Index> indexedAttrs = new HashSet<Index>();
         indexedAttrs.add( new JdbmIndex( "ou" ) );
         indexedAttrs.add( new JdbmIndex( "dc" ) );
         indexedAttrs.add( new JdbmIndex( "objectClass" ) );
-        pcfg.setIndexedAttributes( indexedAttrs );
+        partition.setIndexedAttributes( indexedAttrs );
 
-        attrs = new AttributesImpl( true );
+        Attributes attrs = new AttributesImpl( true );
         Attribute attr = new AttributeImpl( "objectClass" );
         attr.add( "top" );
         attr.add( "domain" );
@@ -85,10 +80,10 @@
         attr = new AttributeImpl( "dc" );
         attr.add( "example" );
         attrs.put( attr );
-        pcfg.setContextEntry( attrs );
+        partition.setContextEntry( attrs );
 
-        partitions.add( pcfg );
-        configuration.setPartitions( partitions );
+        partitions.add( partition );
+        apacheDS.getDirectoryService().setPartitions( partitions );
         super.setUp();
 
         Hashtable<String, String> env = new Hashtable<String, String>();
@@ -322,44 +317,37 @@
     /**
      * Tests to make sure DIGEST-MD5 binds below the RootDSE work.
      */
-    public void testSaslDigestMd5Bind()
+    public void testSaslDigestMd5Bind() throws Exception
     {
-        try
-        {
-            Hashtable<String, String> env = new Hashtable<String, String>();
-            env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
-            env.put( Context.PROVIDER_URL, "ldap://localhost:" + port );
-
-            env.put( Context.SECURITY_AUTHENTICATION, "DIGEST-MD5" );
-            env.put( Context.SECURITY_PRINCIPAL, "hnelson" );
-            env.put( Context.SECURITY_CREDENTIALS, "secret" );
+        Hashtable<String, String> env = new Hashtable<String, String>();
+        env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( Context.PROVIDER_URL, "ldap://localhost:" + port );
 
-            // Specify realm
-            env.put( "java.naming.security.sasl.realm", "example.com" );
+        env.put( Context.SECURITY_AUTHENTICATION, "DIGEST-MD5" );
+        env.put( Context.SECURITY_PRINCIPAL, "hnelson" );
+        env.put( Context.SECURITY_CREDENTIALS, "secret" );
 
-            // Request privacy protection
-            env.put( "javax.security.sasl.qop", "auth-conf" );
+        // Specify realm
+        env.put( "java.naming.security.sasl.realm", "example.com" );
 
-            DirContext ctx = new InitialDirContext( env );
+        // Request privacy protection
+        env.put( "javax.security.sasl.qop", "auth-conf" );
 
-            String[] attrIDs =
-                { "uid" };
+        DirContext ctx = new InitialDirContext( env );
 
-            Attributes attrs = ctx.getAttributes( "uid=hnelson,ou=users,dc=example,dc=com", attrIDs );
+        String[] attrIDs =
+            { "uid" };
 
-            String uid = null;
+        Attributes attrs = ctx.getAttributes( "uid=hnelson,ou=users,dc=example,dc=com", attrIDs );
 
-            if ( attrs.get( "uid" ) != null )
-            {
-                uid = ( String ) attrs.get( "uid" ).get();
-            }
+        String uid = null;
 
-            assertEquals( uid, "hnelson" );
-        }
-        catch ( NamingException e )
+        if ( attrs.get( "uid" ) != null )
         {
-            fail( "Should not have caught exception." );
+            uid = ( String ) attrs.get( "uid" ).get();
         }
+
+        assertEquals( uid, "hnelson" );
     }
 
 

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslGssapiBindITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslGssapiBindITest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslGssapiBindITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SaslGssapiBindITest.java Fri Oct  5 23:48:35 2007
@@ -20,6 +20,7 @@
 package org.apache.directory.server;
 
 
+import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.interceptor.Interceptor;
 import org.apache.directory.server.core.kerberos.KeyDerivationService;
 import org.apache.directory.server.core.partition.Partition;
@@ -58,7 +59,7 @@
  */
 public class SaslGssapiBindITest extends AbstractServerTest
 {
-    private DirContext ctx = null;
+    private DirContext ctx;
 
 
     /**
@@ -78,13 +79,13 @@
      */
     public void setUp() throws Exception
     {
-        configuration.setAllowAnonymousAccess( false );
+        apacheDS.setAllowAnonymousAccess( false );
 
-        LdapConfiguration ldapConfig = configuration.getLdapConfiguration();
+        LdapConfiguration ldapConfig = apacheDS.getLdapConfiguration();
         ldapConfig.setSaslHost( "localhost" );
         ldapConfig.setSaslPrincipal( "ldap/localhost@EXAMPLE.COM" );
 
-        KdcConfiguration kdcConfig = configuration.getKdcConfiguration();
+        KdcConfiguration kdcConfig = apacheDS.getKdcConfiguration();
         kdcConfig.setEnabled( true );
         kdcConfig.setSearchBaseDn( "ou=users,dc=example,dc=com" );
         kdcConfig.setSecurityAuthentication( "simple" );
@@ -116,17 +117,20 @@
         partition.setContextEntry( attrs );
 
         partitions.add( partition );
-        configuration.setPartitions( partitions );
-
-        List<Interceptor> list = configuration.getInterceptors();
+        apacheDS.getDirectoryService().setPartitions( partitions );
 
+        List<Interceptor> list = apacheDS.getDirectoryService().getInterceptors();
         list.add( new KeyDerivationService() );
-        configuration.setInterceptors( list );
+        apacheDS.getDirectoryService().setInterceptors( list );
 
-        doDelete( configuration.getWorkingDirectory() );
+        doDelete( apacheDS.getDirectoryService().getWorkingDirectory() );
         port = AvailablePortFinder.getNextAvailable( 1024 );
         ldapConfig.setIpPort( port );
-        configuration.setShutdownHookEnabled( false );
+        apacheDS.getDirectoryService().setShutdownHookEnabled( false );
+
+        super.setUp();
+
+
         setContexts( "uid=admin,ou=system", "secret" );
 
         // -------------------------------------------------------------------
@@ -151,7 +155,8 @@
         }
 
         // Get a context, create the ou=users subcontext, then create the 3 principals.
-        Hashtable<String, String> env = new Hashtable<String, String>();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
+        env.put( DirectoryService.JNDI_KEY, apacheDS.getDirectoryService() );
         env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" );
         env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
@@ -176,6 +181,12 @@
 
     /**
      * Convenience method for creating principals.
+     * @param cn the commonName of the person
+     * @param principal the kerberos principal name for the person
+     * @param sn the surName of the person
+     * @param uid the unique identifier for the person
+     * @param userPassword the credentials of the person
+     * @return the attributes of the person principal
      */
     protected Attributes getPrincipalAttributes( String sn, String cn, String uid, String userPassword, String principal )
     {
@@ -200,6 +211,8 @@
 
     /**
      * Convenience method for creating an organizational unit.
+     * @param ou the ou of the organizationalUnit
+     * @return the attributes of the organizationalUnit
      */
     protected Attributes getOrgUnitAttributes( String ou )
     {
@@ -220,76 +233,8 @@
     public void testSaslGssapiBind()
     {
         assertTrue( true );
-	return;
-/*	
-        // Use our custom configuration to avoid reliance on external config
-        Configuration.setConfiguration( new Krb5LoginConfiguration() );
-
-        // 1. Authenticate to Kerberos.
-        LoginContext lc = null;
-        try
-        {
-            lc = new LoginContext( SaslGssapiBindITest.class.getName(), new CallbackHandlerBean( "hnelson", "secret" ) );
-            lc.login();
-        }
-        catch ( LoginException le )
-        {
-            // Bad username:  Client not found in Kerberos database
-            // Bad password:  Integrity check on decrypted field failed
-            fail( "Authentication failed:  " + le.getMessage() );
-        }
-
-        // 2. Perform JNDI work as authenticated Subject.
-        Subject.doAs( lc.getSubject(), new PrivilegedAction()
-        {
-            public Object run()
-            {
-                try
-                {
-                    // Create the initial context
-                    Hashtable<String, String> env = new Hashtable<String, String>();
-                    env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
-                    env.put( Context.PROVIDER_URL, "ldap://localhost:" + port );
-
-                    // Request the use of the "GSSAPI" SASL mechanism
-                    // Authenticate by using already established Kerberos credentials
-                    env.put( Context.SECURITY_AUTHENTICATION, "GSSAPI" );
-
-                    // Request privacy protection
-                    env.put( "javax.security.sasl.qop", "auth-conf" );
-
-                    // Request mutual authentication
-                    env.put( "javax.security.sasl.server.authentication", "true" );
-
-                    // Request high-strength cryptographic protection
-                    env.put( "javax.security.sasl.strength", "high" );
-
-                    DirContext ctx = new InitialDirContext( env );
-
-                    String[] attrIDs =
-                        { "uid" };
-
-                    Attributes attrs = ctx.getAttributes( "uid=hnelson,ou=users,dc=example,dc=com", attrIDs );
-
-                    String uid = null;
-
-                    if ( attrs.get( "uid" ) != null )
-                    {
-                        uid = ( String ) attrs.get( "uid" ).get();
-                    }
-
-                    assertEquals( uid, "hnelson" );
-                }
-                catch ( NamingException e )
-                {
-                    fail( "Should not have caught exception:  " + e.getMessage() );
-                }
-
-                return null;
-            }
-        } );
-*/
     }
+
 
     /**
      * Tear down.

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SearchTest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SearchTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/SearchTest.java Fri Oct  5 23:48:35 2007
@@ -55,15 +55,15 @@
  */
 public class SearchTest extends AbstractServerTest
 {
-    private LdapContext ctx = null;
+    private LdapContext ctx;
     public static final String RDN = "cn=Tori Amos";
     public static final String RDN2 = "cn=Rolling-Stones";
     public static final String PERSON_DESCRIPTION = "an American singer-songwriter";
     private static final String HEATHER_RDN = "cn=Heather Graham";
-    private static final String filter = "(objectclass=*)";
+    private static final String FILTER = "(objectclass=*)";
 
 
-    private static final byte[] jpeg = new byte[]
+    private static final byte[] JPEG = new byte[]
         {
             (byte)0xff, (byte)0xd8, (byte)0xff, (byte)0xe0, 0x00, 0x10, 0x4a, 0x46, 
             0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x48,
@@ -125,18 +125,17 @@
         attributes.put( attribute );
         attributes.put( "cn", cn );
         attributes.put( "sn", sn );
-        attributes.put( "jpegPhoto", jpeg );
+        attributes.put( "jpegPhoto", JPEG );
 
         return attributes;
     }
-    
+
+
     protected void checkForAttributes( Attributes attrs, String[] attrNames )
     {
-        for ( int i = 0; i < attrNames.length; i++ )
+        for ( String attrName : attrNames )
         {
-            String attrName = attrNames[i];
-
-            assertNotNull( "Check if attr " + attrName + " is present", attrs.get( attrNames[i] ) );
+            assertNotNull( "Check if attr " + attrName + " is present", attrs.get( attrName ) );
         }
     }
 
@@ -178,8 +177,6 @@
         heather.put( "sn", "Nova" );
 
         ctx.createSubcontext( HEATHER_RDN, heather );
-
-        
     }
 
 
@@ -262,7 +259,7 @@
 
         SearchControls sctls = new SearchControls();
         sctls.setSearchScope( SearchControls.OBJECT_SCOPE );
-        String filter = "(cn=Bryan Ferry)";
+        String FILTER = "(cn=Bryan Ferry)";
 
         // sn=Ferry with BEROctetString values
         String base = "2.5.4.4=#4665727279";
@@ -270,7 +267,7 @@
         try
         {
             // Check entry
-            NamingEnumeration enm = ctx.search( base, filter, sctls );
+            NamingEnumeration enm = ctx.search( base, FILTER, sctls );
             assertTrue( enm.hasMore() );
             while ( enm.hasMore() )
             {
@@ -444,7 +441,7 @@
     
     /**
      * Tests for <a href="http://issues.apache.org/jira/browse/DIRSERVER-645">
-     * DIRSERVER-645<\a>: Wrong search filter evaluation with AND 
+     * DIRSERVER-645<\a>: Wrong search FILTER evaluation with AND
      * operator and undefined operands.
      */
     public void testUndefinedAvaInBranchFilters() throws Exception
@@ -458,7 +455,7 @@
         assertEquals( "returned size of results", 1, results.size() );
         assertTrue( "contains cn=Kate Bush", results.contains( "cn=Kate Bush" ) );
 
-        // if numberOfOctaves is undefined then this whole filter is undefined
+        // if numberOfOctaves is undefined then this whole FILTER is undefined
         results = search( "(&(sn=Bush)(numberOfOctaves=4))" );
         assertEquals( "returned size of results", 0, results.size() );
     }
@@ -735,7 +732,7 @@
                 {
                     byte[] jpegVal = (byte[])attr.get();
                     
-                    assertTrue( Arrays.equals( jpegVal, jpeg ) );
+                    assertTrue( Arrays.equals( jpegVal, JPEG ) );
                 }
             }
         }
@@ -1054,7 +1051,7 @@
         ctls.setReturningAttributes( new String[]
             { "+" } );
 
-        NamingEnumeration result = ctx.search( HEATHER_RDN, filter, ctls );
+        NamingEnumeration result = ctx.search( HEATHER_RDN, FILTER, ctls );
 
         if ( result.hasMore() )
         {
@@ -1084,7 +1081,7 @@
         ctls.setReturningAttributes( new String[]
             { "*" } );
 
-        NamingEnumeration result = ctx.search( HEATHER_RDN, filter, ctls );
+        NamingEnumeration result = ctx.search( HEATHER_RDN, FILTER, ctls );
 
         if ( result.hasMore() )
         {
@@ -1120,7 +1117,7 @@
         String[] opAttrNames =
             { "creatorsName", "createTimestamp" };
 
-        NamingEnumeration result = ctx.search( HEATHER_RDN, filter, ctls );
+        NamingEnumeration result = ctx.search( HEATHER_RDN, FILTER, ctls );
 
         if ( result.hasMore() )
         {
@@ -1142,7 +1139,7 @@
         ctls.setReturningAttributes( new String[]
             { "*", "+" } );
 
-        result = ctx.search( HEATHER_RDN, filter, ctls );
+        result = ctx.search( HEATHER_RDN, FILTER, ctls );
 
         if ( result.hasMore() )
         {

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/StoredProcedureExecutionITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/StoredProcedureExecutionITest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/StoredProcedureExecutionITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/StoredProcedureExecutionITest.java Fri Oct  5 23:48:35 2007
@@ -46,8 +46,8 @@
  */
 public class StoredProcedureExecutionITest extends AbstractServerTest
 {
-    private LdapContext ctx = null;
-    private LdapContext spCtx = null;
+    private LdapContext ctx;
+    private LdapContext spCtx;
 
     
     public void setUp() throws Exception
@@ -55,7 +55,7 @@
         /////////////////////////////////////////////////////////
         // Enable the Stored Procedure Extended Operation Handler
         /////////////////////////////////////////////////////////
-        LdapConfiguration ldapCfg = super.configuration.getLdapConfiguration();
+        LdapConfiguration ldapCfg = super.apacheDS.getLdapConfiguration();
         Set<ExtendedOperationHandler> handlers = new HashSet<ExtendedOperationHandler>( ldapCfg.getExtendedOperationHandlers() );
         handlers.add( new StoredProcedureExtendedOperationHandler() );
         ldapCfg.setExtendedOperationHandlers( handlers );

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java Fri Oct  5 23:48:35 2007
@@ -20,6 +20,7 @@
 package org.apache.directory.server.jndi;
 
 
+import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.Index;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
@@ -128,7 +129,7 @@
 
         partitions.add( partition );
 
-        configuration.setPartitions( partitions );
+        service.setPartitions( partitions );
 
         super.setUp();
     }
@@ -167,115 +168,84 @@
     public void testSetupTeardown() throws NamingException
     {
         assertNotNull( sysRoot );
-
         Attributes attributes = sysRoot.getAttributes( "" );
-
         assertNotNull( attributes );
-
         assertEquals( "system", attributes.get( "ou" ).get() );
-
         Attribute attribute = attributes.get( "objectClass" );
-
         assertNotNull( attribute );
-
         assertTrue( attribute.contains( "top" ) );
-
         assertTrue( attribute.contains( "organizationalUnit" ) );
     }
 
 
     public void testAppPartitionExample() throws NamingException
     {
-        Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
+        Hashtable<String,Object> env = new Hashtable<String,Object>();
 
         env.put( Context.PROVIDER_URL, "dc=example" );
+        env.put( DirectoryService.JNDI_KEY, service );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
         env.put( Context.SECURITY_AUTHENTICATION, "simple" );
-        env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.jndi.ServerContextFactory" );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" );
 
         InitialContext initialContext = new InitialContext( env );
-
         DirContext appRoot = ( DirContext ) initialContext.lookup( "" );
-
         assertNotNull( appRoot );
-
         Attributes attributes = appRoot.getAttributes( "" );
-
         assertNotNull( attributes );
-
         assertEquals( "example", attributes.get( "dc" ).get() );
-
         Attribute attribute = attributes.get( "objectClass" );
-
         assertNotNull( attribute );
-
         assertTrue( attribute.contains( "top" ) );
-
         assertTrue( attribute.contains( "domain" ) );
     }
 
 
     public void testAppPartitionTesting() throws NamingException
     {
-        Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
+        Hashtable<String,Object> env = new Hashtable<String,Object>();
 
         env.put( Context.PROVIDER_URL, "ou=testing" );
+        env.put( DirectoryService.JNDI_KEY, service );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
         env.put( Context.SECURITY_AUTHENTICATION, "simple" );
-        env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.jndi.ServerContextFactory" );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" );
 
         InitialContext initialContext = new InitialContext( env );
-
         DirContext appRoot = ( DirContext ) initialContext.lookup( "" );
-
         assertNotNull( appRoot );
-
         Attributes attributes = appRoot.getAttributes( "" );
-
         assertNotNull( attributes );
-
         assertEquals( "testing", attributes.get( "ou" ).get() );
-
         Attribute attribute = attributes.get( "objectClass" );
-
         assertNotNull( attribute );
-
         assertTrue( attribute.contains( "top" ) );
-
         assertTrue( attribute.contains( "organizationalUnit" ) );
     }
 
 
     public void testAppPartitionMixedCase() throws NamingException
     {
-        Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
+        Hashtable<String,Object> env = new Hashtable<String,Object>();
 
         env.put( Context.PROVIDER_URL, "dc=MixedCase" );
+        env.put( DirectoryService.JNDI_KEY, service );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
         env.put( Context.SECURITY_AUTHENTICATION, "simple" );
-        env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.jndi.ServerContextFactory" );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" );
 
         InitialContext initialContext = new InitialContext( env );
-
         DirContext appRoot = ( DirContext ) initialContext.lookup( "" );
-
         assertNotNull( appRoot );
-
         Attributes attributes = appRoot.getAttributes( "" );
-
         assertNotNull( attributes );
-
         assertEquals( "MixedCase", attributes.get( "dc" ).get() );
-
         Attribute attribute = attributes.get( "objectClass" );
-
         assertNotNull( attribute );
-
         assertTrue( attribute.contains( "top" ) );
-
         assertTrue( attribute.contains( "domain" ) );
     }
 }

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/ssl/LdapsITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/ssl/LdapsITest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/ssl/LdapsITest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/ssl/LdapsITest.java Fri Oct  5 23:48:35 2007
@@ -49,7 +49,7 @@
 {
     private static final String RDN = "cn=The Person";
 
-    private DirContext ctx = null;
+    private DirContext ctx;
 
 
     /**
@@ -57,11 +57,11 @@
      */
     public void setUp() throws Exception
     {
-        doDelete( configuration.getWorkingDirectory() );
+        doDelete( apacheDS.getDirectoryService().getWorkingDirectory() );
 
         int ldapsPort = AvailablePortFinder.getNextAvailable( 8192 );
         
-        LdapConfiguration ldapsCfg = configuration.getLdapsConfiguration();
+        LdapConfiguration ldapsCfg = apacheDS.getLdapsConfiguration();
         ldapsCfg.setEnableLdaps( true );
         ldapsCfg.setLdapsCertificatePassword( "boguspw" );
         ldapsCfg.setIpPort( ldapsPort );
@@ -115,7 +115,7 @@
     /**
      * Just a little test to check if the connection is made successfully.
      * 
-     * @throws NamingException
+     * @throws NamingException cannot create person
      */
     public void testSetUpTearDown() throws NamingException
     {

Modified: directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java (original)
+++ directory/apacheds/branches/bigbang/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java Fri Oct  5 23:48:35 2007
@@ -16,25 +16,23 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
-
 package org.apache.directory.server;
 
-import java.io.File;
-import java.util.Properties;
-import java.net.URL;
+import org.apache.directory.server.configuration.ApacheDS;
+import org.apache.directory.server.jndi.ServerContextFactory;
+import org.apache.xbean.spring.context.FileSystemXmlApplicationContext;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
 
 import javax.naming.Context;
 import javax.naming.directory.InitialDirContext;
+import java.io.File;
+import java.net.URL;
+import java.util.Hashtable;
 
-import org.junit.Test;
-import org.apache.xbean.spring.context.FileSystemXmlApplicationContext;
-import org.apache.directory.server.configuration.MutableServerStartupConfiguration;
-import org.apache.directory.server.jndi.ServerContextFactory;
-import org.springframework.context.ApplicationContext;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class SpringServerTest
 {
@@ -45,18 +43,17 @@
         ClassLoader classLoader = this.getClass().getClassLoader();
         URL configURL = classLoader.getResource( "server.xml" );
 
-        File configF = new File(configURL.toURI());
-        ApplicationContext factory = new FileSystemXmlApplicationContext(configF.toURL().toString());
-        MutableServerStartupConfiguration cfg = (MutableServerStartupConfiguration) factory.getBean("configuration");
-        Properties env = (Properties) factory.getBean("environment");
-        env.setProperty( Context.PROVIDER_URL, providerURL);
-        env.setProperty(Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName());
-
-        File workingDirFile = new File(configF.getParentFile(), "work");
-        cfg.setWorkingDirectory(workingDirFile);
-
-        env.putAll(cfg.toJndiEnvironment());
-        new InitialDirContext(env);
-
+        File configF = new File( configURL.toURI() );
+        ApplicationContext factory = new FileSystemXmlApplicationContext( configF.toURL().toString() );
+        ApacheDS apacheDS = ( ApacheDS ) factory.getBean( "apacheDS" );
+        //noinspection unchecked
+        Hashtable<String,Object> env = ( Hashtable ) factory.getBean( "environment" );
+        env.put( ApacheDS.JNDI_KEY, apacheDS );
+        env.put( Context.PROVIDER_URL, providerURL );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );
+
+        File workingDirFile = new File( configF.getParentFile(), "work" );
+        apacheDS.getDirectoryService().setWorkingDirectory( workingDirFile );
+        new InitialDirContext( env );
     }
 }

Modified: directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
URL: http://svn.apache.org/viewvc/directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java (original)
+++ directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java Fri Oct  5 23:48:35 2007
@@ -22,19 +22,17 @@
 
 import org.apache.directory.daemon.DaemonApplication;
 import org.apache.directory.daemon.InstallationLayout;
-import org.apache.directory.server.configuration.MutableServerStartupConfiguration;
-import org.apache.directory.server.core.configuration.ShutdownConfiguration;
-import org.apache.directory.server.core.configuration.SyncConfiguration;
+import org.apache.directory.server.configuration.ApacheDS;
 import org.apache.directory.server.jndi.ServerContextFactory;
-import org.apache.xbean.spring.context.FileSystemXmlApplicationContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 import javax.naming.Context;
 import javax.naming.directory.InitialDirContext;
 import java.io.File;
-import java.util.Properties;
+import java.util.Hashtable;
 
 
 /**
@@ -45,12 +43,10 @@
  */
 public class Service implements DaemonApplication
 {
-    private static final Logger log = LoggerFactory.getLogger( Service.class );
-    private Properties env;
-    private Thread workerThread = null;
+    private static final Logger LOG = LoggerFactory.getLogger( Service.class );
+    private Thread workerThread;
     private SynchWorker worker = new SynchWorker();
-    private MutableServerStartupConfiguration cfg;
-    private boolean startNoWait = false;
+    private ApacheDS apacheDS;
 
 
     public void init( InstallationLayout install, String[] args ) throws Exception
@@ -58,56 +54,48 @@
         printBanner();
         long startTime = System.currentTimeMillis();
 
-//        if ( install != null )
-//        {
-//            log.info( "server: loading settings from ", install.getConfigurationFile() );
-//            ApplicationContext factory = null;
-//            factory = new FileSystemXmlApplicationContext( install.getConfigurationFile().toURL().toString() );
-//            cfg = ( MutableServerStartupConfiguration ) factory.getBean( "configuration" );
-//            env = ( Properties ) factory.getBean( "environment" );
-//        }
-//        else if ( args.length > 0 && new File( args[0] ).exists() ) // hack that takes server.xml file argument
+        Hashtable<String, Object> env;
         if ( args.length > 0 && new File( args[0] ).exists() ) // hack that takes server.xml file argument
         {
-            log.info( "server: loading settings from ", args[0] );
-            ApplicationContext factory = new FileSystemXmlApplicationContext( new File( args[0] ).toURI().toURL().toString() );
-            cfg = ( MutableServerStartupConfiguration ) factory.getBean( "configuration" );
-            env = ( Properties ) factory.getBean( "environment" );
+            LOG.info( "server: loading settings from ", args[0] );
+            ApplicationContext factory = new ClassPathXmlApplicationContext( new File( args[0] ).toURI().toURL().toString() );
+            apacheDS = ( ApacheDS ) factory.getBean( "apacheDS" );
+            //noinspection unchecked
+            env = ( Hashtable ) factory.getBean( "environment" );
         }
         else
         {
-            log.info( "server: using default settings ..." );
-            env = new Properties();
-            cfg = new MutableServerStartupConfiguration();
+            LOG.info( "server: using default settings ..." );
+            env = new Hashtable<String,Object>();
+            apacheDS = new ApacheDS();
         }
 
-        env.setProperty( Context.PROVIDER_URL, "ou=system" );
-        env.setProperty( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );
+        env.put( ApacheDS.JNDI_KEY, apacheDS );
+        env.put( Context.PROVIDER_URL, "ou=system" );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );
 
         if ( install != null )
         {
-            cfg.setWorkingDirectory( install.getPartitionsDirectory() );
+            apacheDS.getDirectoryService().setWorkingDirectory( install.getPartitionsDirectory() );
         }
 
-        env.putAll( cfg.toJndiEnvironment() );
         new InitialDirContext( env );
 
-        if ( cfg.getSynchPeriodMillis() > 0 )
+        if ( apacheDS.getSynchPeriodMillis() > 0 )
         {
             workerThread = new Thread( worker, "SynchWorkerThread" );
         }
         
-        if ( log.isInfoEnabled() )
+        if ( LOG.isInfoEnabled() )
         {
-            log.info( "server: started in {} milliseconds", ( System.currentTimeMillis() - startTime ) + "" );
+            LOG.info( "server: started in {} milliseconds", ( System.currentTimeMillis() - startTime ) + "" );
         }
     }
 
 
     public void synch() throws Exception
     {
-        env.putAll( new SyncConfiguration().toJndiEnvironment() );
-        new InitialDirContext( env );
+        apacheDS.getDirectoryService().sync();
     }
 
 
@@ -117,7 +105,6 @@
         {
             workerThread.start();
         }
-        return;
     }
 
 
@@ -131,15 +118,14 @@
                 worker.lock.notify();
             }
     
-            while ( startNoWait && workerThread.isAlive() )
+            while ( workerThread.isAlive() )
             {
-                log.info( "Waiting for SynchWorkerThread to die." );
+                LOG.info( "Waiting for SynchWorkerThread to die." );
                 workerThread.join( 500 );
             }
         }
 
-        env.putAll( new ShutdownConfiguration().toJndiEnvironment() );
-        new InitialDirContext( env );
+        apacheDS.shutdown();
     }
 
 
@@ -150,8 +136,8 @@
     
     class SynchWorker implements Runnable
     {
-        Object lock = new Object();
-        boolean stop = false;
+        final Object lock = new Object();
+        boolean stop;
 
 
         public void run()
@@ -162,11 +148,11 @@
                 {
                     try
                     {
-                        lock.wait( cfg.getSynchPeriodMillis() );
+                        lock.wait( apacheDS.getSynchPeriodMillis() );
                     }
                     catch ( InterruptedException e )
                     {
-                        log.warn( "SynchWorker failed to wait on lock.", e );
+                        LOG.warn( "SynchWorker failed to wait on lock.", e );
                     }
                 }
 
@@ -176,7 +162,7 @@
                 }
                 catch ( Exception e )
                 {
-                    log.error( "SynchWorker failed to synch directory.", e );
+                    LOG.error( "SynchWorker failed to synch directory.", e );
                 }
             }
         }

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java Fri Oct  5 23:48:35 2007
@@ -153,7 +153,7 @@
 public class LdifReader implements Iterator<Entry>
 {
     /** A logger */
-    private static final Logger log = LoggerFactory.getLogger( LdifReader.class );
+    private static final Logger LOG = LoggerFactory.getLogger( LdifReader.class );
 
     /** A private class to track the current position in a line */
     private class Position
@@ -263,13 +263,13 @@
 
         if ( inf.exists() == false )
         {
-            log.error( "File {} cannot be found", inf.getAbsoluteFile() );
+            LOG.error( "File {} cannot be found", inf.getAbsoluteFile() );
             throw new NamingException( "Cannot find file " + inf.getAbsoluteFile() );
         }
 
         if ( inf.canRead() == false )
         {
-            log.error( "File {} cannot be read", inf.getName() );
+            LOG.error( "File {} cannot be read", inf.getName() );
             throw new NamingException( "Cannot read file " + inf.getName() );
         }
 
@@ -279,7 +279,7 @@
         }
         catch (FileNotFoundException fnfe)
         {
-            log.error( "File {} cannot be found", inf.getAbsoluteFile() );
+            LOG.error( "File {} cannot be found", inf.getAbsoluteFile() );
             throw new NamingException( "Cannot find file " + inf.getAbsoluteFile() );
         }
     }
@@ -335,13 +335,13 @@
     {
         if ( in.exists() == false )
         {
-            log.error( "File {} cannot be found", in.getAbsoluteFile() );
+            LOG.error( "File {} cannot be found", in.getAbsoluteFile() );
             throw new NamingException( "Cannot find file " + in.getAbsoluteFile() );
         }
 
         if ( in.canRead() == false )
         {
-            log.error( "File {} cannot be read", in.getName() );
+            LOG.error( "File {} cannot be read", in.getName() );
             throw new NamingException( "Cannot read file " + in.getName() );
         }
 
@@ -351,7 +351,7 @@
         }
         catch (FileNotFoundException fnfe)
         {
-            log.error( "File {} cannot be found", in.getAbsoluteFile() );
+            LOG.error( "File {} cannot be found", in.getAbsoluteFile() );
             throw new NamingException( "Cannot find file " + in.getAbsoluteFile() );
         }
     }
@@ -487,7 +487,7 @@
             if ( length == 3 )
             {
                 // The DN is empty : error
-                log.error( "A ldif entry must have a non empty DN" );
+                LOG.error( "A ldif entry must have a non empty DN" );
                 throw new NamingException( "No DN for entry" );
             }
             else if ( line.charAt( 3 ) == ':' )
@@ -504,14 +504,14 @@
                     catch (UnsupportedEncodingException uee)
                     {
                         // The DN is not base 64 encoded
-                        log.error( "The ldif entry is supposed to have a base 64 encoded DN" );
+                        LOG.error( "The ldif entry is supposed to have a base 64 encoded DN" );
                         throw new NamingException( "Invalid base 64 encoded DN" );
                     }
                 }
                 else
                 {
                     // The DN is empty : error
-                    log.error( "A ldif entry must have a non empty DN" );
+                    LOG.error( "A ldif entry must have a non empty DN" );
                     throw new NamingException( "No DN for entry" );
                 }
             }
@@ -522,7 +522,7 @@
         }
         else
         {
-            log.error( "A ldif entry must start with a DN" );
+            LOG.error( "A ldif entry must start with a DN" );
             throw new NamingException( "No DN for entry" );
         }
 
@@ -533,7 +533,7 @@
         }
         catch (InvalidNameException ine)
         {
-            log.error( "The DN {} is not valid" );
+            LOG.error( "The DN {} is not valid" );
             throw ine;
         }
 
@@ -611,7 +611,7 @@
 
                         if ( file.exists() == false )
                         {
-                            log.error( "File {} not found", fileName );
+                            LOG.error( "File {} not found", fileName );
                             throw new NamingException( "Bad URL, file not found" );
                         }
                         else
@@ -620,7 +620,7 @@
 
                             if ( length > sizeLimit )
                             {
-                                log.error( "File {} is too big", fileName );
+                                LOG.error( "File {} is too big", fileName );
                                 throw new NamingException( "File too big" );
                             }
                             else
@@ -640,12 +640,12 @@
                                     // We can't reach this point, the file
                                     // existence has already been
                                     // checked
-                                    log.error( "File {} not found", fileName );
+                                    LOG.error( "File {} not found", fileName );
                                     throw new NamingException( "Bad URL, file not found" );
                                 }
                                 catch (IOException ioe)
                                 {
-                                    log.error( "File {} error reading", fileName );
+                                    LOG.error( "File {} error reading", fileName );
                                     throw new NamingException( "Bad URL, file can't be read" );
                                 }
                                 finally
@@ -658,7 +658,7 @@
                                         }
                                         catch ( IOException ioe )
                                         {
-                                            log.error( "Error while closing the stream : {}", ioe.getMessage() );
+                                            LOG.error( "Error while closing the stream : {}", ioe.getMessage() );
                                             // Just do nothing ...
                                         }
                                     }
@@ -668,13 +668,13 @@
                     }
                     else
                     {
-                        log.error( "Protocols other than file: are not supported" );
+                        LOG.error( "Protocols other than file: are not supported" );
                         throw new NamingException( "Unsupported URL protocol" );
                     }
                 }
                 catch (MalformedURLException mue)
                 {
-                    log.error( "Bad URL {}", urlName );
+                    LOG.error( "Bad URL {}", urlName );
                     throw new NamingException( "Bad URL" );
                 }
             }
@@ -715,7 +715,7 @@
         if ( pos > length )
         {
             // No OID : error !
-            log.error( "The control does not have an OID" );
+            LOG.error( "The control does not have an OID" );
             throw new NamingException( "Bad control, no oid" );
         }
 
@@ -729,7 +729,7 @@
         if ( pos == initPos )
         {
             // Not a valid OID !
-            log.error( "The control does not have an OID" );
+            LOG.error( "The control does not have an OID" );
             throw new NamingException( "Bad control, no oid" );
         }
 
@@ -744,7 +744,7 @@
         }
         catch (DecoderException de)
         {
-            log.error( "The OID {} is not valid", oidString );
+            LOG.error( "The OID {} is not valid", oidString );
             throw new NamingException( "Bad control oid" );
         }
 
@@ -783,7 +783,7 @@
         {
             // If we have a criticality, it should be either "true" or "false",
             // nothing else
-            log.error( "The control muts have a valid criticality" );
+            LOG.error( "The control muts have a valid criticality" );
             throw new NamingException( "Bad control criticality" );
         }
 
@@ -862,7 +862,7 @@
         // We should *not* have a DN twice
         if ( attributeType.equals( "dn" ) )
         {
-            log.error( "An entry must not have two DNs" );
+            LOG.error( "An entry must not have two DNs" );
             throw new NamingException( "A ldif entry should not have two DN" );
         }
 
@@ -900,14 +900,14 @@
             }
             else
             {
-                log.error( "A modrdn operation must start with a \"newrdn:\"" );
+                LOG.error( "A modrdn operation must start with a \"newrdn:\"" );
                 throw new NamingException( "Bad modrdn operation" );
             }
 
         }
         else
         {
-            log.error( "A modrdn operation must start with a \"newrdn:\"" );
+            LOG.error( "A modrdn operation must start with a \"newrdn:\"" );
             throw new NamingException( "Bad modrdn operation, no newrdn" );
         }
 
@@ -924,13 +924,13 @@
             }
             else
             {
-                log.error( "A modrdn operation must contains a \"deleteoldrdn:\"" );
+                LOG.error( "A modrdn operation must contains a \"deleteoldrdn:\"" );
                 throw new NamingException( "Bad modrdn operation, no deleteoldrdn" );
             }
         }
         else
         {
-            log.error( "A modrdn operation must contains a \"deleteoldrdn:\"" );
+            LOG.error( "A modrdn operation must contains a \"deleteoldrdn:\"" );
             throw new NamingException( "Bad modrdn operation, no deleteoldrdn" );
         }
 
@@ -971,7 +971,7 @@
             {
                 if ( state != ATTRVAL_SPEC_OR_SEP )
                 {
-                    log.error( "Bad state : we should have come from an ATTRVAL_SPEC" );
+                    LOG.error( "Bad state : we should have come from an ATTRVAL_SPEC" );
                     throw new NamingException( "Bad modify separator" );
                 }
                 else
@@ -991,7 +991,7 @@
             {
                 if ( ( state != MOD_SPEC ) && ( state != ATTRVAL_SPEC ) )
                 {
-                    log.error( "Bad state : we should have come from a MOD_SPEC or an ATTRVAL_SPEC" );
+                    LOG.error( "Bad state : we should have come from a MOD_SPEC or an ATTRVAL_SPEC" );
                     throw new NamingException( "Bad modify state" );
                 }
 
@@ -1004,7 +1004,7 @@
             {
                 if ( ( state != MOD_SPEC ) && ( state != ATTRVAL_SPEC ) )
                 {
-                    log.error( "Bad state : we should have come from a MOD_SPEC or an ATTRVAL_SPEC" );
+                    LOG.error( "Bad state : we should have come from a MOD_SPEC or an ATTRVAL_SPEC" );
                     throw new NamingException( "Bad modify state" );
                 }
 
@@ -1017,7 +1017,7 @@
             {
                 if ( ( state != MOD_SPEC ) && ( state != ATTRVAL_SPEC ) )
                 {
-                    log.error( "Bad state : we should have come from a MOD_SPEC or an ATTRVAL_SPEC" );
+                    LOG.error( "Bad state : we should have come from a MOD_SPEC or an ATTRVAL_SPEC" );
                     throw new NamingException( "Bad modify state" );
                 }
 
@@ -1030,7 +1030,7 @@
             {
                 if ( ( state != ATTRVAL_SPEC ) && ( state != ATTRVAL_SPEC_OR_SEP ) )
                 {
-                    log.error( "Bad state : we should have come from an ATTRVAL_SPEC" );
+                    LOG.error( "Bad state : we should have come from an ATTRVAL_SPEC" );
                     throw new NamingException( "Bad modify state" );
                 }
 
@@ -1041,14 +1041,14 @@
 
                 if ( attributeType.equalsIgnoreCase( modified ) == false )
                 {
-                    log.error( "The modified attribute and the attribute value spec must be equal" );
+                    LOG.error( "The modified attribute and the attribute value spec must be equal" );
                     throw new NamingException( "Bad modify attribute" );
                 }
 
                 // We should *not* have a DN twice
                 if ( attributeType.equalsIgnoreCase( "dn" ) )
                 {
-                    log.error( "An entry must not have two DNs" );
+                    LOG.error( "An entry must not have two DNs" );
                     throw new NamingException( "A ldif entry should not have two DN" );
                 }
 
@@ -1143,7 +1143,7 @@
                     {
                         if ( operation == ChangeType.ModDn )
                         {
-                            log.error( "A moddn operation must contains a \"newsuperior:\"" );
+                            LOG.error( "A moddn operation must contains a \"newsuperior:\"" );
                             throw new NamingException( "Bad moddn operation, no newsuperior" );
                         }
                     }
@@ -1152,7 +1152,7 @@
                 {
                     if ( operation == ChangeType.ModDn )
                     {
-                        log.error( "A moddn operation must contains a \"newsuperior:\"" );
+                        LOG.error( "A moddn operation must contains a \"newsuperior:\"" );
                         throw new NamingException( "Bad moddn operation, no newsuperior" );
                     }
                 }
@@ -1161,7 +1161,7 @@
 
             default:
                 // This is an error
-                log.error( "Unknown operation" );
+                LOG.error( "Unknown operation" );
                 throw new NamingException( "Bad operation" );
         }
     }
@@ -1180,7 +1180,7 @@
     {
         if ( ( lines == null ) || ( lines.size() == 0 ) )
         {
-            log.debug( "The entry is empty : end of ldif file" );
+            LOG.debug( "The entry is empty : end of ldif file" );
             return null;
         }
 
@@ -1229,7 +1229,7 @@
             {
                 if ( containsEntries )
                 {
-                    log.error( "We cannot have changes when reading a file which already contains entries" );
+                    LOG.error( "We cannot have changes when reading a file which already contains entries" );
                     throw new NamingException( "No changes withing entries" );
                 }
 
@@ -1237,7 +1237,7 @@
 
                 if ( controlSeen )
                 {
-                    log.error( "We already have had a control" );
+                    LOG.error( "We already have had a control" );
                     throw new NamingException( "Control misplaced" );
                 }
 
@@ -1249,7 +1249,7 @@
             {
                 if ( containsEntries )
                 {
-                    log.error( "We cannot have changes when reading a file which already contains entries" );
+                    LOG.error( "We cannot have changes when reading a file which already contains entries" );
                     throw new NamingException( "No changes withing entries" );
                 }
 
@@ -1257,7 +1257,7 @@
 
                 if ( changeTypeSeen )
                 {
-                    log.error( "We already have had a changeType" );
+                    LOG.error( "We already have had a changeType" );
                     throw new NamingException( "ChangeType misplaced" );
                 }
 
@@ -1275,7 +1275,7 @@
             {
                 if ( containsChanges )
                 {
-                    log.error( "We cannot have entries when reading a file which already contains changes" );
+                    LOG.error( "We cannot have entries when reading a file which already contains changes" );
                     throw new NamingException( "No entries within changes" );
                 }
 
@@ -1283,7 +1283,7 @@
 
                 if ( controlSeen || changeTypeSeen )
                 {
-                    log.error( "We can't have a Attribute/Value pair after a control or a changeType" );
+                    LOG.error( "We can't have a Attribute/Value pair after a control or a changeType" );
                     throw new NamingException( "AttributeType misplaced" );
                 }
 
@@ -1293,23 +1293,23 @@
             else
             {
                 // Invalid attribute Value
-                log.error( "Expecting an attribute type" );
+                LOG.error( "Expecting an attribute type" );
                 throw new NamingException( "Bad attribute" );
             }
         }
 
         if ( type == ENTRY )
         {
-            log.debug( "Read an entry : {}", entry );
+            LOG.debug( "Read an entry : {}", entry );
         }
         else if ( type == CHANGE )
         {
             entry.setChangeType( operation );
-            log.debug( "Read a modification : {}", entry );
+            LOG.debug( "Read a modification : {}", entry );
         }
         else
         {
-            log.error( "Unknown entry type" );
+            LOG.error( "Unknown entry type" );
             throw new NamingException( "Unknown entry" );
         }
 
@@ -1319,12 +1319,10 @@
     /**
      * Parse the version from the ldif input.
      * 
-     * @param in
-     *            The input which contains the ldif data
      * @return A number representing the version (default to 1)
      * @throws NamingException
      *             If the version is incorrect
-     * @throws IOException
+     * @throws NamingException
      *             If the input is incorrect
      */
     private int parseVersion() throws NamingException
@@ -1336,7 +1334,7 @@
 
         if ( lines.size() == 0 )
         {
-            log.warn( "The ldif file is empty" );
+            LOG.warn( "The ldif file is empty" );
             return ver;
         }
 
@@ -1358,7 +1356,7 @@
             // We should not have any other chars after the number
             if ( position.pos != document.length )
             {
-                log.error( "The version is not a number" );
+                LOG.error( "The version is not a number" );
                 throw new NamingException( "Ldif parsing error" );
             }
 
@@ -1368,11 +1366,11 @@
             }
             catch (NumberFormatException nfe)
             {
-                log.error( "The version is not a number" );
+                LOG.error( "The version is not a number" );
                 throw new NamingException( "Ldif parsing error" );
             }
 
-            log.debug( "Ldif version : {}", versionNumber );
+            LOG.debug( "Ldif version : {}", versionNumber );
 
             // We have found the version, just discard the line from the list
             lines.remove( 0 );
@@ -1385,7 +1383,7 @@
         }
         else
         {
-            log.warn( "No version information : assuming version: 1" );
+            LOG.warn( "No version information : assuming version: 1" );
         }
 
         return ver;
@@ -1397,10 +1395,7 @@
      * 
      * The lines represent *one* entry.
      * 
-     * @param in
-     *            The buffer
-     * @throws NamingException
-     *             If something went wrong
+     * @throws NamingException If something went wrong
      */
     private void readLines() throws NamingException
     {
@@ -1445,7 +1440,7 @@
                         }
                         else if ( sb.length() == 0 )
                         {
-                            log.error( "Cannot have an empty continuation line" );
+                            LOG.error( "Cannot have an empty continuation line" );
                             throw new NamingException( "Ldif Parsing error" );
                         }
                         else
@@ -1515,7 +1510,7 @@
     {
         if ( StringTools.isEmpty( fileName ) )
         {
-            log.error( "Cannot parse an empty file name !" );
+            LOG.error( "Cannot parse an empty file name !" );
             throw new NamingException( "Empty filename" );
         }
 
@@ -1523,7 +1518,7 @@
 
         if ( file.exists() == false )
         {
-            log.error( "Cannot parse the file {}, it does not exist", fileName );
+            LOG.error( "Cannot parse the file {}, it does not exist", fileName );
             throw new NamingException( "Filename " + fileName + " not found." );
         }
 
@@ -1536,7 +1531,7 @@
         }
         catch (FileNotFoundException fnfe)
         {
-            log.error( "Cannot find file {}", fileName );
+            LOG.error( "Cannot find file {}", fileName );
             throw new NamingException( "Filename " + fileName + " not found." );
         }
 
@@ -1554,7 +1549,7 @@
      */
     public List<Entry> parseLdif( String ldif ) throws NamingException
     {
-        log.debug( "Starts parsing ldif buffer" );
+        LOG.debug( "Starts parsing ldif buffer" );
 
         if ( StringTools.isEmpty( ldif ) )
         {
@@ -1568,16 +1563,16 @@
         {
             List<Entry> entries = parseLdif( inf );
 
-            if ( log.isDebugEnabled() )
+            if ( LOG.isDebugEnabled() )
             {
-                log.debug( "Parsed {} entries.", ( entries == null ? Integer.valueOf( 0 ) : Integer.valueOf( entries.size() ) ) );
+                LOG.debug( "Parsed {} entries.", ( entries == null ? Integer.valueOf( 0 ) : Integer.valueOf( entries.size() ) ) );
             }
 
             return entries;
         }
         catch (NamingException ne)
         {
-            log.error( "Cannot parse the ldif buffer : {}", ne.getMessage() );
+            LOG.error( "Cannot parse the ldif buffer : {}", ne.getMessage() );
             throw new NamingException( "Error while parsing the ldif buffer" );
         }
     }
@@ -1595,7 +1590,7 @@
     {
         try
         {
-            log.debug( "next(): -- called" );
+            LOG.debug( "next(): -- called" );
 
             Entry entry = prefetched;
             readLines();
@@ -1609,13 +1604,13 @@
                 error = ne;
             }
 
-            log.debug( "next(): -- returning ldif {}\n", entry );
+            LOG.debug( "next(): -- returning ldif {}\n", entry );
 
             return entry;
         }
         catch (NamingException ne)
         {
-            log.error( "Premature termination of LDIF iterator" );
+            LOG.error( "Premature termination of LDIF iterator" );
             error = ne;
             return null;
         }
@@ -1628,7 +1623,7 @@
      */
     public boolean hasNext()
     {
-        log.debug( "hasNext(): -- returning {}", ( prefetched != null ) ? Boolean.TRUE : Boolean.FALSE );
+        LOG.debug( "hasNext(): -- returning {}", ( prefetched != null ) ? Boolean.TRUE : Boolean.FALSE );
 
         return null != prefetched;
     }

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java Fri Oct  5 23:48:35 2007
@@ -53,7 +53,7 @@
      * @return the resultant entry after the modifications have taken place
      * @throws NamingException if there are problems accessing attributes
      */
-    public static Attributes getTargetEntry( List<ModificationItem> mods, Attributes entry ) throws NamingException
+    public static Attributes getTargetEntry( List<? extends ModificationItem> mods, Attributes entry ) throws NamingException
     {
         Attributes targetEntry = ( Attributes ) entry.clone();
         

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java?rev=582462&r1=582461&r2=582462&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java Fri Oct  5 23:48:35 2007
@@ -20,23 +20,23 @@
 package org.apache.directory.shared.ldap.util;
 
 
-import java.text.ParseException;
-import java.util.Arrays;
-import java.util.List;
-
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.NoOpNormalizer;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.ModificationItem;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.List;
 
 
 /**
@@ -310,7 +310,7 @@
      * @param type the attributeType spec of the Attribute to extract
      * @return the modification item on the attributeType specified
      */
-    public final static ModificationItem getModificationItem( List<ModificationItem> mods, AttributeType type )
+    public final static ModificationItem getModificationItem( List<ModificationItemImpl> mods, AttributeType type )
     {
         // optimization bypass to avoid cost of the loop below
         if ( type.getNames().length == 1 )
@@ -376,7 +376,7 @@
      * @param type the attributeType spec of the Attribute to extract
      * @return the extract Attribute or null if no such attribute exists
      */
-    public final static Attribute getAttribute( List<ModificationItem> mods, AttributeType type )
+    public final static Attribute getAttribute( List<ModificationItemImpl> mods, AttributeType type )
     {
         ModificationItem mod = getModificationItem( mods, type );
         
@@ -1042,7 +1042,7 @@
      * keychar = 'a'-z' | 'A'-'Z' / '0'-'9' / '-'
      * number = '0'-'9' / ( '1'-'9' 1*'0'-'9' )
      *
-     * @param attr The parsed attribute,
+     * @param str The parsed attribute,
      * @param pos The position of the attribute in the current string
      * @return The parsed attribute if valid
      */



Mime
View raw message