You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2007/04/12 15:05:44 UTC

svn commit: r527922 - in /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support: ModifyDnHandler.java SearchHandler.java

Author: elecharny
Date: Thu Apr 12 06:05:43 2007
New Revision: 527922

URL: http://svn.apache.org/viewvc?view=rev&rev=527922
Log:
Modifed the code to use the newly created JndiPropertyConstants class

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java?view=diff&rev=527922&r1=527921&r2=527922
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java Thu Apr 12 06:05:43 2007
@@ -27,6 +27,7 @@
 
 import org.apache.directory.server.core.configuration.StartupConfiguration;
 import org.apache.directory.server.ldap.SessionRegistry;
+import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.message.Control;
 import org.apache.directory.shared.ldap.message.LdapResult;
@@ -57,6 +58,22 @@
     /** Speedup for logs */
     private static final boolean IS_DEBUG = log.isDebugEnabled();
 
+    /**
+     * Deal with a ModifyDN request received from a client.
+     * 
+     * A ModifyDN operation has more than one semantic, depending on its parameters.
+     * 
+     * In any case, the first argument is the DN entry to be changed. We then
+     * have the new relative DN for this entry.
+     * 
+     * Two other arguments can be provided :
+     * - deleteOldRdn : if the old RDN attributes should be removed from the
+     * new entry or not (for instance, if the old RDN was cn=acme, and the new 
+     * one is sn=acme, then we may have to remove the cn: acme from the attributes
+     * list)
+     * - newSuperior : this is a move operation. The entry is removed from its
+     * current location, and created in the new one.
+     */
     public void messageReceived( IoSession session, Object request ) throws Exception
     {
         ModifyDnRequest req = ( ModifyDnRequest ) request;
@@ -92,7 +109,7 @@
                 
                 ctx.setRequestControls( req.getControls().values().toArray( EMPTY_CONTROLS ) );
                 String deleteRDN = String.valueOf( req.getDeleteOldRdn() );
-                ctx.addToEnvironment( "java.naming.ldap.deleteRDN", deleteRDN );
+                ctx.addToEnvironment( JndiPropertyConstants.JNDI_LDAP_DELETE_RDN, deleteRDN );
 
                 if ( req.isMove() )
                 {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java?view=diff&rev=527922&r1=527921&r2=527922
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java Thu Apr 12 06:05:43 2007
@@ -37,6 +37,7 @@
 import org.apache.directory.server.core.jndi.ServerLdapContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.ldap.SessionRegistry;
+import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.OperationAbandonedException;
@@ -74,7 +75,7 @@
     //TM private static Object lock = new Object();
 
     private static final Logger log = LoggerFactory.getLogger( SearchHandler.class );
-    private static final String DEREFALIASES_KEY = "java.naming.ldap.derefAliases";
+    private static final String DEREFALIASES_KEY = JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES;
     private StartupConfiguration cfg;
 
     /** Speedup for logs */