directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r541123 [25/25] - in /directory/apacheds/branches/apacheds-sasl-branch: ./ benchmarks/ bootstrap-extract/ bootstrap-extract/src/ bootstrap-extract/src/main/ bootstrap-extract/src/main/java/ bootstrap-extract/src/main/java/org/ bootstrap-ext...
Date Thu, 24 May 2007 00:27:07 GMT
Modified: directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-jndi/pom.xml Wed May 23 17:26:40 2007
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>build</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
+    <version>1.5.1-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-jndi</artifactId>
   <name>ApacheDS Server JNDI</name>

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java Wed May 23 17:26:40 2007
@@ -56,10 +56,12 @@
 import org.apache.directory.server.ntp.NtpConfiguration;
 import org.apache.directory.server.ntp.NtpServer;
 import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
+import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.mina.common.DefaultIoFilterChainBuilder;
 import org.apache.mina.common.ExecutorThreadModel;
 import org.apache.mina.common.IoAcceptor;
@@ -89,6 +91,7 @@
  */
 public class ServerContextFactory extends CoreContextFactory
 {
+	/** Logger for this class */
     private static final Logger log = LoggerFactory.getLogger( ServerContextFactory.class.getName() );
     private static final String LDIF_FILES_DN = "ou=loadedLdifFiles,ou=configuration,ou=system";
 
@@ -108,7 +111,12 @@
     private static DnsServer udpDnsServer;
     private DirectoryService directoryService;
 
-
+    /**
+     * Initialize the SocketAcceptor so that the server can accept
+     * incomming requests.
+     * 
+     * We will start N threads, spreaded on the available CPUs.
+     */
     public void beforeStartup( DirectoryService service )
     {
         int maxThreads = service.getConfiguration().getStartupConfiguration().getMaxThreads();
@@ -117,7 +125,8 @@
         threadModel.setExecutor( threadPoolExecutor );
 
         udpAcceptor = new DatagramAcceptor();
-        tcpAcceptor = new SocketAcceptor();
+        tcpAcceptor = new SocketAcceptor(
+            Runtime.getRuntime().availableProcessors(), threadPoolExecutor );
 
         this.directoryService = service;
     }
@@ -146,60 +155,72 @@
         if ( tcpKdcServer != null )
         {
             tcpKdcServer.destroy();
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of KRB5 Service (TCP) complete: " + tcpKdcServer );
             }
+            
             tcpKdcServer = null;
         }
 
         if ( udpKdcServer != null )
         {
             udpKdcServer.destroy();
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of KRB5 Service (UDP) complete: " + udpKdcServer );
             }
+            
             udpKdcServer = null;
         }
 
         if ( tcpChangePasswordServer != null )
         {
             tcpChangePasswordServer.destroy();
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of Change Password Service (TCP) complete: " + tcpChangePasswordServer );
             }
+            
             tcpChangePasswordServer = null;
         }
 
         if ( udpChangePasswordServer != null )
         {
             udpChangePasswordServer.destroy();
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of Change Password Service (UDP) complete: " + udpChangePasswordServer );
             }
+            
             udpChangePasswordServer = null;
         }
 
         if ( tcpNtpServer != null )
         {
             tcpNtpServer.destroy();
+    
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of NTP Service (TCP) complete: " + tcpNtpServer );
             }
+            
             tcpNtpServer = null;
         }
 
         if ( udpNtpServer != null )
         {
             udpNtpServer.destroy();
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of NTP Service complete: " + udpNtpServer );
             }
+            
             udpNtpServer = null;
         }
 
@@ -245,9 +266,10 @@
 
     private void ensureLdifFileBase( DirContext root )
     {
-        Attributes entry = new AttributesImpl( "ou", "loadedLdifFiles", true );
-        entry.put( "objectClass", "top" );
-        entry.get( "objectClass" ).add( "organizationalUnit" );
+        Attributes entry = new AttributesImpl( SchemaConstants.OU_AT, "loadedLdifFiles", true );
+        entry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
+        
         try
         {
             root.createSubcontext( LDIF_FILES_DN, entry );
@@ -264,39 +286,39 @@
     private final static String WINDOWSFILE_OC = "windowsFile";
     private final static String UNIXFILE_OC = "unixFile";
 
-
-    private void addFileEntry( DirContext root, File ldif ) throws NamingException
+    private String buildProtectedFileEntry( File ldif )
     {
-        String rdnAttr = File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR;
-        String oc = File.separatorChar == '\\' ? WINDOWSFILE_OC : UNIXFILE_OC;
         StringBuffer buf = new StringBuffer();
-        buf.append( rdnAttr );
+
+        buf.append( File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR );
         buf.append( "=" );
-        buf.append( getCanonical( ldif ) );
+        
+        buf.append( StringTools.dumpHexPairs( StringTools.getBytesUtf8( getCanonical( ldif ) ) ) );
+        
         buf.append( "," );
         buf.append( LDIF_FILES_DN );
 
+        return buf.toString();
+    }
+
+    private void addFileEntry( DirContext root, File ldif ) throws NamingException
+    {
+		String rdnAttr = File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR;    
+        String oc = File.separatorChar == '\\' ? WINDOWSFILE_OC : UNIXFILE_OC;
+
         Attributes entry = new AttributesImpl( rdnAttr, getCanonical( ldif ), true );
-        entry.put( "objectClass", "top" );
-        entry.get( "objectClass" ).add( oc );
-        root.createSubcontext( buf.toString(), entry );
+        entry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( oc );
+        root.createSubcontext( buildProtectedFileEntry( ldif ), entry );
     }
 
 
     private Attributes getLdifFileEntry( DirContext root, File ldif )
     {
-        String rdnAttr = File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR;
-        StringBuffer buf = new StringBuffer();
-        buf.append( rdnAttr );
-        buf.append( "=" );
-        buf.append( getCanonical( ldif ) );
-        buf.append( "," );
-        buf.append( LDIF_FILES_DN );
-
         try
         {
-            return root.getAttributes( buf.toString(), new String[]
-                { "createTimestamp" } );
+            return root.getAttributes( buildProtectedFileEntry( ldif ), new String[]
+                { SchemaConstants.CREATE_TIMESTAMP_AT } );
         }
         catch ( NamingException e )
         {
@@ -308,6 +330,7 @@
     private String getCanonical( File file )
     {
         String canonical = null;
+        
         try
         {
             canonical = file.getCanonicalPath();
@@ -353,16 +376,27 @@
         // if ldif directory is a file try to load it
         if ( !cfg.getLdifDirectory().isDirectory() )
         {
-            log.info( "LDIF load directory '" + getCanonical( cfg.getLdifDirectory() )
-                + "' is a file.  Will attempt to load as LDIF." );
+            if ( log.isInfoEnabled() )
+            {
+                log.info( "LDIF load directory '" + getCanonical( cfg.getLdifDirectory() )
+                    + "' is a file.  Will attempt to load as LDIF." );
+            }
+            
             Attributes fileEntry = getLdifFileEntry( root, cfg.getLdifDirectory() );
+            
             if ( fileEntry != null )
             {
-                String time = ( String ) fileEntry.get( "createTimestamp" ).get();
-                log.info( "Load of LDIF file '" + getCanonical( cfg.getLdifDirectory() )
-                    + "' skipped.  It has already been loaded on " + time + "." );
+                String time = ( String ) fileEntry.get( SchemaConstants.CREATE_TIMESTAMP_AT ).get();
+                
+                if ( log.isInfoEnabled() )
+                {
+                    log.info( "Load of LDIF file '" + getCanonical( cfg.getLdifDirectory() )
+                        + "' skipped.  It has already been loaded on " + time + "." );
+                }
+                
                 return;
             }
+            
             LdifFileLoader loader = new LdifFileLoader( root, cfg.getLdifDirectory(), cfg.getLdifFilters() );
             loader.execute();
 
@@ -394,7 +428,7 @@
             Attributes fileEntry = getLdifFileEntry( root, ldifFiles[ii] );
             if ( fileEntry != null )
             {
-                String time = ( String ) fileEntry.get( "createTimestamp" ).get();
+                String time = ( String ) fileEntry.get( SchemaConstants.CREATE_TIMESTAMP_AT ).get();
                 log.info( "Load of LDIF file '" + getCanonical( ldifFiles[ii] )
                     + "' skipped.  It has already been loaded on " + time + "." );
                 continue;
@@ -626,6 +660,7 @@
             // is not bound - this is ok because the GracefulShutdown has already
             // sent notices to to the existing active sessions
             List sessions = null;
+        
             try
             {
                 sessions = new ArrayList( tcpAcceptor.getManagedSessions( new InetSocketAddress( port ) ) );
@@ -637,6 +672,7 @@
             }
 
             tcpAcceptor.unbind( new InetSocketAddress( port ) );
+            
             if ( log.isInfoEnabled() )
             {
                 log.info( "Unbind of an LDAP service (" + port + ") is complete." );
@@ -655,6 +691,7 @@
 
             // And close the connections when the NoDs are sent.
             Iterator sessionIt = sessions.iterator();
+            
             for ( Iterator i = writeFutures.iterator(); i.hasNext(); )
             {
                 WriteFuture future = ( WriteFuture ) i.next();

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-main/apacheds.sh
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-main/apacheds.sh?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-main/apacheds.sh (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-main/apacheds.sh Wed May 23 17:26:40 2007
@@ -1,9 +1,9 @@
 #!/bin/sh
-if [ -e target/apacheds-server-main-1.5.0-SNAPSHOT-app.jar ] ; then
+if [ -e target/apacheds-server-main-1.5.1-SNAPSHOT-app.jar ] ; then
   echo uber jar exists
 else
   echo uber jar not found need to build it
   mvn clean assembly:assembly
 fi
 
-java -Dlog4j.configuration=file://$(pwd)/log4j.properties -jar target/apacheds-server-main-1.5.0-SNAPSHOT-app.jar server.xml 
+java -Dlog4j.configuration=file://$(pwd)/log4j.properties -jar target/apacheds-server-main-1.5.1-SNAPSHOT-app.jar server.xml 

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-main/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-main/pom.xml?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-main/pom.xml (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-main/pom.xml Wed May 23 17:26:40 2007
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>build</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
+    <version>1.5.1-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-main</artifactId>
   <name>ApacheDS Server Main</name>
@@ -18,7 +18,7 @@
     <dependency>
       <groupId>org.apache.directory.daemon</groupId>
       <artifactId>daemon-bootstrappers</artifactId>
-      <version>1.0.0</version>
+      <version>1.1.1-SNAPSHOT</version>
     </dependency>  
     <dependency>
       <groupId>org.slf4j</groupId>

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-main/server.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-main/server.xml?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-main/server.xml (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-main/server.xml Wed May 23 17:26:40 2007
@@ -269,7 +269,13 @@
             <bean class="org.apache.directory.mitosis.service.ReplicationService">
               <property name="configuration">
                 <bean class="org.apache.directory.mitosis.configuration.ReplicationConfiguration">
-                  <property name="replicaId" value="instance_a" />
+                  <property name="replicaId">
+                    <bean class="org.apache.directory.mitosis.common.ReplicaId">
+                      <constructor-arg>
+                        <value>instance_a</value>
+                      </constructor-arg>
+                    </bean>
+                  </property>
                   <property name="serverPort" value="10390" />
                   <property name="peerReplicas" value="instance_b@localhost:10392" />
                 </bean>

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-replication/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-replication/pom.xml?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-replication/pom.xml (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-replication/pom.xml Wed May 23 17:26:40 2007
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>build</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
+    <version>1.5.1-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-replication</artifactId>
   <name>ApacheDS Server Replication Service</name>

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-sar/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-sar/pom.xml?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-sar/pom.xml (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-sar/pom.xml Wed May 23 17:26:40 2007
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>build</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
+    <version>1.5.1-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-sar</artifactId>
   <name>ApacheDS Server Sar (JBoss 3.x)</name>

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-tools/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-tools/pom.xml?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-tools/pom.xml (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-tools/pom.xml Wed May 23 17:26:40 2007
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>build</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
+    <version>1.5.1-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-tools</artifactId>
   <name>ApacheDS Server Tools</name>

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java Wed May 23 17:26:40 2007
@@ -34,6 +34,7 @@
 import org.apache.commons.cli.Options;
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.directory.daemon.AvailablePortFinder;
+import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
@@ -89,11 +90,11 @@
         }
 
         Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port );
+        env.put( JndiPropertyConstants.JNDI_FACTORY_INITIAL, "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( JndiPropertyConstants.JNDI_PROVIDER_URL, "ldap://" + host + ":" + port );
         env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", password );
-        env.put( "java.naming.security.authentication", "simple" );
+        env.put( JndiPropertyConstants.JNDI_SECURITY_CREDENTIALS, password );
+        env.put( JndiPropertyConstants.JNDI_SECURITY_AUTHENTICATION, "simple" );
 
         LdapContext ctx = new InitialLdapContext( env, null );
 

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java Wed May 23 17:26:40 2007
@@ -34,6 +34,7 @@
 import org.apache.directory.server.tools.execution.BaseToolCommandExecutor;
 import org.apache.directory.server.tools.util.ListenerParameter;
 import org.apache.directory.server.tools.util.Parameter;
+import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.message.extended.LaunchDiagnosticUiRequest;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.FileSystemXmlApplicationContext;
@@ -105,11 +106,11 @@
         }
 
         Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port );
+        env.put( JndiPropertyConstants.JNDI_FACTORY_INITIAL, "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( JndiPropertyConstants.JNDI_PROVIDER_URL, "ldap://" + host + ":" + port );
         env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", password );
-        env.put( "java.naming.security.authentication", "simple" );
+        env.put( JndiPropertyConstants.JNDI_SECURITY_CREDENTIALS, password );
+        env.put( JndiPropertyConstants.JNDI_SECURITY_AUTHENTICATION, "simple" );
 
         LdapContext ctx = new InitialLdapContext( env, null );
         if ( isDebugEnabled() )

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java Wed May 23 17:26:40 2007
@@ -41,6 +41,7 @@
 import org.apache.directory.server.tools.execution.BaseToolCommandExecutor;
 import org.apache.directory.server.tools.util.ListenerParameter;
 import org.apache.directory.server.tools.util.Parameter;
+import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.message.extended.GracefulDisconnect;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
 import org.springframework.context.ApplicationContext;
@@ -117,11 +118,11 @@
     private void execute() throws Exception
     {
         Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port );
+        env.put( JndiPropertyConstants.JNDI_FACTORY_INITIAL, "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( JndiPropertyConstants.JNDI_PROVIDER_URL, "ldap://" + host + ":" + port );
         env.put( "java.naming.security.principal", bindDN );
-        env.put( "java.naming.security.credentials", password );
-        env.put( "java.naming.security.authentication", "simple" );
+        env.put( JndiPropertyConstants.JNDI_SECURITY_CREDENTIALS, password );
+        env.put( JndiPropertyConstants.JNDI_SECURITY_AUTHENTICATION, "simple" );
 
         LdapContext ctx = new InitialLdapContext( env, null );
         ctx = ctx.newInstance( null );

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java Wed May 23 17:26:40 2007
@@ -23,7 +23,6 @@
 import java.io.File;
 import java.io.FileWriter;
 import java.io.PrintWriter;
-import java.math.BigInteger;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
@@ -325,7 +324,7 @@
         while ( list.hasMore() )
         {
             Tuple tuple = ( Tuple ) list.next();
-            BigInteger id = ( BigInteger ) tuple.getKey();
+            Long id = ( Long ) tuple.getKey();
             String dn = ( String ) idIndex.reverseLookup( id );
             Attributes entry = ( Attributes ) tuple.getValue();
 

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java Wed May 23 17:26:40 2007
@@ -36,6 +36,7 @@
 import org.apache.directory.server.tools.util.ListenerParameter;
 import org.apache.directory.server.tools.util.Parameter;
 import org.apache.directory.server.tools.util.ToolCommandException;
+import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.message.extended.GracefulShutdownRequest;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.FileSystemXmlApplicationContext;
@@ -128,11 +129,11 @@
         }
 
         Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port );
+        env.put( JndiPropertyConstants.JNDI_FACTORY_INITIAL, "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( JndiPropertyConstants.JNDI_PROVIDER_URL, "ldap://" + host + ":" + port );
         env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", password );
-        env.put( "java.naming.security.authentication", "simple" );
+        env.put( JndiPropertyConstants.JNDI_SECURITY_CREDENTIALS, password );
+        env.put( JndiPropertyConstants.JNDI_SECURITY_AUTHENTICATION, "simple" );
 
         LdapContext ctx = new InitialLdapContext( env, null );
         if ( !isQuietEnabled() )

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java Wed May 23 17:26:40 2007
@@ -33,6 +33,7 @@
 import org.apache.directory.server.tools.execution.BaseToolCommandExecutor;
 import org.apache.directory.server.tools.util.ListenerParameter;
 import org.apache.directory.server.tools.util.Parameter;
+import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.message.extended.StoredProcedureRequest;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.FileSystemXmlApplicationContext;
@@ -103,11 +104,11 @@
         }
 
         Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port );
+        env.put( JndiPropertyConstants.JNDI_FACTORY_INITIAL, "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( JndiPropertyConstants.JNDI_PROVIDER_URL, "ldap://" + host + ":" + port );
         env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", password );
-        env.put( "java.naming.security.authentication", "simple" );
+        env.put( JndiPropertyConstants.JNDI_SECURITY_CREDENTIALS, password );
+        env.put( JndiPropertyConstants.JNDI_SECURITY_AUTHENTICATION, "simple" );
 
         LdapContext ctx = new InitialLdapContext( env, null );
         if ( !isQuietEnabled() )

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/manifest/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/manifest/MANIFEST.MF?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/manifest/MANIFEST.MF (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-tools/src/main/manifest/MANIFEST.MF Wed May 23 17:26:40 2007
@@ -2,28 +2,28 @@
 Main-Class: org.apache.directory.server.tools.ApachedsTools
 Class-Path: logger.jar daemon.jar bootstrapper.jar 
  ../lib/antlr-2.7.4.jar 
- ../lib/apacheds-kerberos-shared-1.5.0-SNAPSHOT.jar 
- ../lib/apacheds-protocol-changepw-1.5.0-SNAPSHOT.jar 
- ../lib/apacheds-protocol-shared-1.5.0-SNAPSHOT.jar 
- ../lib/apacheds-protocol-kerberos-1.5.0-SNAPSHOT.jar 
- ../lib/apacheds-protocol-ldap-1.5.0-SNAPSHOT.jar 
- ../lib/apacheds-protocol-ntp-1.5.0-SNAPSHOT.jar 
- ../lib/apacheds-core-1.5.0-SNAPSHOT.jar 
- ../lib/apacheds-core-shared-1.5.0-SNAPSHOT.jar 
- ../lib/apacheds-server-jndi-1.5.0-SNAPSHOT.jar 
- ../lib/apacheds-server-main-1.5.0-SNAPSHOT.jar 
+ ../lib/apacheds-kerberos-shared-1.5.1-SNAPSHOT.jar 
+ ../lib/apacheds-protocol-changepw-1.5.1-SNAPSHOT.jar 
+ ../lib/apacheds-protocol-shared-1.5.1-SNAPSHOT.jar 
+ ../lib/apacheds-protocol-kerberos-1.5.1-SNAPSHOT.jar 
+ ../lib/apacheds-protocol-ldap-1.5.1-SNAPSHOT.jar 
+ ../lib/apacheds-protocol-ntp-1.5.1-SNAPSHOT.jar 
+ ../lib/apacheds-core-1.5.1-SNAPSHOT.jar 
+ ../lib/apacheds-core-shared-1.5.1-SNAPSHOT.jar 
+ ../lib/apacheds-server-jndi-1.5.1-SNAPSHOT.jar 
+ ../lib/apacheds-server-main-1.5.1-SNAPSHOT.jar 
  ../lib/commons-collections-3.0.jar 
- ../lib/commons-lang-2.0.jar 
+ ../lib/commons-lang-2.1.jar 
  ../lib/commons-logging-1.0.4.jar 
  ../lib/commons-cli-1.0.jar 
  ../lib/jdbm-1.0.jar 
  ../lib/lcrypto-jdk14-131.jar 
  ../lib/mina-core-1.0.0.jar 
- ../lib/shared-asn1-codec-0.9.6-SNAPSHOT.jar 
+ ../lib/shared-asn1-codec-0.9.7-SNAPSHOT.jar 
  ../lib/mina-filter-ssl-1.0.0.jar 
  ../lib/oro-2.0.8.jar 
- ../lib/shared-asn1-0.9.6-SNAPSHOT.jar 
- ../lib/shared-ldap-0.9.6-SNAPSHOT.jar 
+ ../lib/shared-asn1-0.9.7-SNAPSHOT.jar 
+ ../lib/shared-ldap-0.9.7-SNAPSHOT.jar 
  ../lib/spring-beans-1.2.8.jar 
  ../lib/spring-context-1.2.8.jar 
  ../lib/spring-core-1.2.8.jar 

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-unit/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-unit/pom.xml?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-unit/pom.xml (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-unit/pom.xml Wed May 23 17:26:40 2007
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>build</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
+    <version>1.5.1-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-unit</artifactId>
   <name>ApacheDS Server Unit</name>
@@ -27,6 +27,7 @@
       <groupId>ldapsdk</groupId>
       <artifactId>ldapsdk</artifactId>
       <version>4.1</version>
+      <scope>test</scope>
     </dependency>  
     <dependency>
       <groupId>org.apache.directory.server</groupId>

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/AbstractServerTriggerServiceTest.java Wed May 23 17:26:40 2007
@@ -34,6 +34,7 @@
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 
@@ -158,7 +159,7 @@
         Attribute objectClass = new AttributeImpl( "objectClass" );
         subentry.put( objectClass );
         objectClass.add( "top" );
-        objectClass.add( "subentry" );
+        objectClass.add( SchemaConstants.SUBENTRY_OC );
         objectClass.add( "triggerExecutionSubentry" );
         subentry.put( "subtreeSpecification", subtree );
         subentry.put( "prescriptiveTriggerSpecification", triggerSpec );

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java Wed May 23 17:26:40 2007
@@ -33,9 +33,13 @@
 
 import org.apache.directory.server.ldap.LdapConfiguration;
 import org.apache.directory.server.ldap.support.extended.StoredProcedureExtendedOperationHandler;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.sp.JavaStoredProcedureUtils;
+import org.apache.directory.shared.ldap.util.AttributeUtils;
 
 
 /**
@@ -74,10 +78,65 @@
         super.tearDown();
     }
     
+    public void testAfterAddSubscribeUserToSomeGroups() throws NamingException
+    {
+        // Load the stored procedure unit which has the stored procedure to be triggered.
+        JavaStoredProcedureUtils.loadStoredProcedureClass( ctx, ListUtilsSP.class );
+        
+        // Create a group to be subscribed to.
+        Attributes staffGroupEntry = new AttributesImpl( SchemaConstants.CN_AT, "staff", true );
+        Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
+        staffGroupEntry.put( objectClass );
+        objectClass.add( SchemaConstants.TOP_OC );
+        objectClass.add( SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC );
+        staffGroupEntry.put( SchemaConstants.UNIQUE_MEMBER_AT , "cn=dummy" );
+        Rdn staffRdn = new Rdn(SchemaConstants.CN_AT + "=" + "staff" );
+        sysRoot.createSubcontext( staffRdn.getUpName(), staffGroupEntry );
+        
+        // Create another group to be subscribed to.
+        Attributes teachersGroupEntry = new AttributesImpl( SchemaConstants.CN_AT, "teachers", true );
+        objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
+        teachersGroupEntry.put( objectClass );
+        objectClass.add( SchemaConstants.TOP_OC );
+        objectClass.add( SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC );
+        teachersGroupEntry.put( SchemaConstants.UNIQUE_MEMBER_AT , "cn=dummy" );
+        Rdn teachersRdn = new Rdn( SchemaConstants.CN_AT + "=" + "teachers" );
+        sysRoot.createSubcontext( teachersRdn.getUpName(), teachersGroupEntry );
+        
+        // Create the Triger Specification within a Trigger Subentry.
+        String staffDN = staffRdn.getUpName() + "," + sysRoot.getNameInNamespace();
+        String teachersDN = teachersRdn.getUpName() + "," + sysRoot.getNameInNamespace();
+        createTriggerSubentry( ctx, "triggerSubentry1",
+            "AFTER Add " +
+            "CALL \"" + ListUtilsSP.class.getName() + ".subscribeToGroup\" ( $entry , $ldapContext \"" + staffDN + "\" ); " +
+            "CALL \"" + ListUtilsSP.class.getName() + ".subscribeToGroup\" ( $entry , $ldapContext \"" + teachersDN + "\" );" );
+        
+        // Create a test entry which is selected by the Trigger Subentry.
+        Attributes testEntry = new AttributesImpl( SchemaConstants.CN_AT, "The Teacher of All Times", true );
+        objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
+        testEntry.put( objectClass );
+        objectClass.add( SchemaConstants.TOP_OC );
+        objectClass.add( SchemaConstants.INET_ORG_PERSON_OC );
+        testEntry.put( SchemaConstants.SN_AT, "The Teacher" );
+        Rdn testEntryRdn = new Rdn( SchemaConstants.CN_AT + "=" + "The Teacher of All Times" );
+        sysRoot.createSubcontext( testEntryRdn.getUpName(), testEntry );
+                
+        // ------------------------------------------
+        // The trigger should be fired at this point.
+        // ------------------------------------------
+        
+        // Check if the Trigger really worked (subscribed the user to give grpups).
+        Attributes staff = sysRoot.getAttributes( "cn=staff" );
+        Attributes teachers = sysRoot.getAttributes( "cn=teachers" );
+        String testEntryName = ( ( LdapContext )sysRoot.lookup( testEntryRdn.getUpName() ) ).getNameInNamespace();
+        assertTrue( AttributeUtils.containsValueCaseIgnore( staff.get(SchemaConstants.UNIQUE_MEMBER_AT), testEntryName ) );
+        assertTrue( AttributeUtils.containsValueCaseIgnore( teachers.get(SchemaConstants.UNIQUE_MEMBER_AT), testEntryName ) );
+    }
+    
     public void testAfterDeleteBackupDeletedEntry() throws NamingException
     {
         // Load the stored procedure unit which has the stored procedure to be triggered.
-        JavaStoredProcedureUtils.loadStoredProcedureClass( ctx, BackupUtilities.class );
+        JavaStoredProcedureUtils.loadStoredProcedureClass( ctx, BackupUtilitiesSP.class );
         
         // Create a container for backing up deleted entries.
         Attributes backupContext = new AttributesImpl( "ou", "backupContext", true );
@@ -89,7 +148,7 @@
         
         // Create the Triger Specification within a Trigger Subentry.
         createTriggerSubentry( ctx, "triggerSubentry1",
-            "AFTER Delete CALL \"" + BackupUtilities.class.getName() + ".backupDeleted\" ( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry )" );
+            "AFTER Delete CALL \"" + BackupUtilitiesSP.class.getName() + ".backupDeleted\" ( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry );" );
         
         // Create a test entry which is selected by the Trigger Subentry.
         Attributes testEntry = new AttributesImpl( "ou", "testou", true );

Copied: directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java (from r540837, directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java?view=diff&rev=541123&p1=directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java&r1=540837&p2=directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java&r2=541123
==============================================================================
--- directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java Wed May 23 17:26:40 2007
@@ -116,7 +116,7 @@
 
         doDelete( configuration.getWorkingDirectory() );
         port = AvailablePortFinder.getNextAvailable( 1024 );
-        configuration.setLdapPort( port );
+        configuration.getLdapConfiguration().setIpPort( port );
         configuration.setShutdownHookEnabled( false );
         setContexts( "uid=admin,ou=system", "secret" );
 

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java Wed May 23 17:26:40 2007
@@ -51,7 +51,7 @@
     public static final String PERSON_CN = "Tori Amos";
     public static final String PERSON_SN = "Amos";
     public static final String PERSON_RDN = "cn=" + PERSON_CN;
-    public static final String PERSON_TELEPHONE = "1234567890abc";
+    public static final String PERSON_TELEPHONE = "1234567890";
     public static final String PERSON_PWD = "Secret1!";
 
     public static final String GROUP_CN = "Artists";

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/ModifyRdnTest.java Wed May 23 17:26:40 2007
@@ -150,6 +150,52 @@
         ctx.unbind( newRdn );
     }
 
+    /**
+     * Modify Rdn of an entry, without deleting its old rdn value.
+     * 
+     * The JNDI property is set with 'False'
+     * 
+     * @throws NamingException
+     */
+    public void testModifyRdnAndDontDeleteOldFalse() throws NamingException
+    {
+        // Create a person, cn value is rdn
+        String oldCn = "Myra Ellen Amos";
+        String oldRdn = "cn=" + oldCn;
+        Attributes attributes = this.getPersonAttributes( "Amos", oldCn );
+        ctx.createSubcontext( oldRdn, attributes );
+
+        // modify Rdn
+        String newCn = "Tori Amos";
+        String newRdn = "cn=" + newCn;
+        ctx.addToEnvironment( "java.naming.ldap.deleteRDN", "False" );
+        ctx.rename( oldRdn, newRdn );
+
+        // Check, whether old Entry does not exists
+        try
+        {
+            ctx.lookup( oldRdn );
+            fail( "Entry must not exist" );
+        }
+        catch ( NameNotFoundException ignored )
+        {
+            // expected behaviour
+            assertTrue( true );
+        }
+
+        // Check, whether new Entry exists
+        DirContext tori = ( DirContext ) ctx.lookup( newRdn );
+        assertNotNull( tori );
+
+        // Check values of cn
+        Attribute cn = tori.getAttributes( "" ).get( "cn" );
+        assertTrue( cn.contains( newCn ) );
+        assertTrue( cn.contains( oldCn ) ); // old value is gone
+        assertEquals( 2, cn.size() );
+
+        // Remove entry (use new rdn)
+        ctx.unbind( newRdn );
+    }
 
     /**
      * Modify Rdn of an entry, keep its old rdn value.

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SaslGssapiBindITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SaslGssapiBindITest.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SaslGssapiBindITest.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SaslGssapiBindITest.java Wed May 23 17:26:40 2007
@@ -23,6 +23,7 @@
 import java.security.PrivilegedAction;
 import java.util.HashSet;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Set;
 
 import javax.naming.Context;
@@ -32,15 +33,16 @@
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
 import javax.security.auth.Subject;
-import javax.security.auth.kerberos.KerberosKey;
-import javax.security.auth.kerberos.KerberosPrincipal;
 import javax.security.auth.login.Configuration;
 import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
 
+import org.apache.directory.server.core.configuration.InterceptorConfiguration;
+import org.apache.directory.server.core.configuration.MutableInterceptorConfiguration;
 import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.kerberos.kdc.KdcConfiguration;
+import org.apache.directory.server.kerberos.shared.interceptors.KeyDerivationService;
 import org.apache.directory.server.kerberos.shared.jaas.CallbackHandlerBean;
 import org.apache.directory.server.kerberos.shared.jaas.Krb5LoginConfiguration;
 import org.apache.directory.server.kerberos.shared.store.KerberosAttribute;
@@ -126,6 +128,14 @@
         pcfgs.add( pcfg );
         configuration.setPartitionConfigurations( pcfgs );
 
+        MutableInterceptorConfiguration interceptorCfg = new MutableInterceptorConfiguration();
+        List<InterceptorConfiguration> list = configuration.getInterceptorConfigurations();
+
+        interceptorCfg.setName( KeyDerivationService.NAME );
+        interceptorCfg.setInterceptor( new KeyDerivationService() );
+        list.add( interceptorCfg );
+        configuration.setInterceptorConfigurations( list );
+
         doDelete( configuration.getWorkingDirectory() );
         port = AvailablePortFinder.getNextAvailable( 1024 );
         ldapConfig.setIpPort( port );
@@ -194,15 +204,8 @@
         attrs.put( "sn", sn );
         attrs.put( "uid", uid );
         attrs.put( "userPassword", userPassword );
-
-        KerberosPrincipal servicePrincipal = new KerberosPrincipal( principal );
-        char[] password = new String( userPassword ).toCharArray();
-        KerberosKey serviceKey = new KerberosKey( servicePrincipal, password, "DES" );
-
-        attrs.put( KerberosAttribute.PRINCIPAL, servicePrincipal.getName() );
-        attrs.put( KerberosAttribute.VERSION, Integer.toString( serviceKey.getVersionNumber() ) );
-        attrs.put( KerberosAttribute.KEY, serviceKey.getEncoded() );
-        attrs.put( KerberosAttribute.TYPE, Integer.toString( serviceKey.getKeyType() ) );
+        attrs.put( KerberosAttribute.PRINCIPAL, principal );
+        attrs.put( KerberosAttribute.VERSION, "0" );
 
         return attrs;
     }

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SearchTest.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SearchTest.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SearchTest.java Wed May 23 17:26:40 2007
@@ -39,6 +39,7 @@
 
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.SubentriesControl;
@@ -523,7 +524,7 @@
         Attribute objectClass = new AttributeImpl( "objectClass" );
         subentry.put( objectClass );
         objectClass.add( "top" );
-        objectClass.add( "subentry" );
+        objectClass.add( SchemaConstants.SUBENTRY_OC );
         objectClass.add( "accessControlSubentry" );
         subentry.put( "subtreeSpecification", subtree );
         subentry.put( "prescriptiveACI", aciItem );
@@ -888,7 +889,7 @@
         Attributes subentry = new AttributesImpl();
         Attribute objectClass = new AttributeImpl( "objectClass" );
         objectClass.add( "top" );
-        objectClass.add( "subentry" );
+        objectClass.add( SchemaConstants.SUBENTRY_OC );
         objectClass.add( "collectiveAttributeSubentry" );
         subentry.put( objectClass );
         subentry.put( "c-l", "Munich" );

Modified: directory/apacheds/branches/apacheds-sasl-branch/utils/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/utils/pom.xml?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/utils/pom.xml (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/utils/pom.xml Wed May 23 17:26:40 2007
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>build</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
+    <version>1.5.1-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-utils</artifactId>
   <name>ApacheDS Utils</name>

Modified: directory/apacheds/branches/apacheds-sasl-branch/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/utils/src/main/java/org/apache/directory/server/utils/AttributesFactory.java Wed May 23 17:26:40 2007
@@ -29,6 +29,7 @@
 import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.constants.SystemSchemaConstants;
 import org.apache.directory.server.schema.bootstrap.Schema;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -95,11 +96,11 @@
     
     public Attributes getAttributes( Schema schema )
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_SCHEMA_OC );
-        entry.put( SystemSchemaConstants.CN_AT, schema.getSchemaName() );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_SCHEMA_OC );
+        entry.put( SchemaConstants.CN_AT, schema.getSchemaName() );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         
         if ( schema.isDisabled() )
         {
@@ -123,23 +124,23 @@
     
     public Attributes getAttributes( SyntaxChecker syntaxChecker, Schema schema )
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_SYNTAX_CHECKER_OC );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_SYNTAX_CHECKER_OC );
         entry.put( MetaSchemaConstants.M_OID_AT, syntaxChecker.getSyntaxOid() );
         entry.put( MetaSchemaConstants.M_FQCN_AT, syntaxChecker.getClass().getName() );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         return entry;
     }
 
     
     public Attributes getAttributes( Syntax syntax, Schema schema )
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_SYNTAX_OC );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_SYNTAX_OC );
         entry.put( MetaSchemaConstants.X_HUMAN_READIBLE_AT, getBoolean( syntax.isHumanReadible() ) );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         injectCommon( syntax, entry );
         return entry;
     }
@@ -147,24 +148,24 @@
     
     public Attributes getAttributes( String oid, Normalizer normalizer, Schema schema )
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_NORMALIZER_OC );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_NORMALIZER_OC );
         entry.put( MetaSchemaConstants.M_OID_AT, oid );
         entry.put( MetaSchemaConstants.M_FQCN_AT, normalizer.getClass().getName() );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         return entry;
     }
 
     
     public Attributes getAttributes( String oid, Comparator comparator, Schema schema )
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_COMPARATOR_OC );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_COMPARATOR_OC );
         entry.put( MetaSchemaConstants.M_OID_AT, oid );
         entry.put( MetaSchemaConstants.M_FQCN_AT, comparator.getClass().getName() );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         return entry;
     }
 
@@ -177,11 +178,11 @@
      */
     public Attributes getAttributes( MatchingRule matchingRule, Schema schema ) throws NamingException
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_MATCHING_RULE_OC );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_MATCHING_RULE_OC );
         entry.put( MetaSchemaConstants.M_SYNTAX_AT, matchingRule.getSyntax().getOid() );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         injectCommon( matchingRule, entry );
         return entry;
     }
@@ -189,40 +190,40 @@
     
     public Attributes getAttributes( MatchingRuleUse matchingRuleUse, Schema schema )
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( "" );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( "" );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         return entry;
     }
 
     
     public Attributes getAttributes( DITStructureRule dITStructureRule, Schema schema )
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( "" );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( "" );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         return entry;
     }
 
     
     public Attributes getAttributes( DITContentRule dITContentRule, Schema schema )
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( "" );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( "" );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         return entry;
     }
 
     
     public Attributes getAttributes( NameForm nameForm, Schema schema )
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( "" );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( "" );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         return entry;
     }
 
@@ -247,15 +248,15 @@
      */
     public Attributes getAttributes( AttributeType attributeType, Schema schema ) throws NamingException
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC );
         entry.put( MetaSchemaConstants.M_SYNTAX_AT, attributeType.getSyntax().getOid() );
         entry.put( MetaSchemaConstants.M_COLLECTIVE_AT, getBoolean( attributeType.isCollective() ) );
         entry.put( MetaSchemaConstants.M_NO_USER_MODIFICATION_AT, getBoolean( ! attributeType.isCanUserModify() ) );
         entry.put( MetaSchemaConstants.M_SINGLE_VALUE_AT, getBoolean( attributeType.isSingleValue() ) );
         entry.put( MetaSchemaConstants.M_USAGE_AT, attributeType.getUsage().toString() );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
 
         injectCommon( attributeType, entry );
         
@@ -332,11 +333,11 @@
      */
     public Attributes getAttributes( ObjectClass objectClass, Schema schema ) throws NamingException
     {
-        Attributes entry = new AttributesImpl( SystemSchemaConstants.OBJECT_CLASS_AT, "top", true );
-        entry.get( SystemSchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_OBJECT_CLASS_OC );
+        Attributes entry = new AttributesImpl( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, true );
+        entry.get( SchemaConstants.OBJECT_CLASS_AT ).add( MetaSchemaConstants.META_OBJECT_CLASS_OC );
         entry.put( MetaSchemaConstants.M_TYPE_OBJECT_CLASS_AT, objectClass.getType().toString() );
-        entry.put( SystemSchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
-        entry.put( SystemSchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
+        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         
         injectCommon( objectClass, entry );
 



Mime
View raw message