directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r664436 - /directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/NewAddHandler.java
Date Sun, 08 Jun 2008 04:23:27 GMT
Author: akarasulu
Date: Sat Jun  7 21:23:26 2008
New Revision: 664436

URL: http://svn.apache.org/viewvc?rev=664436&view=rev
Log:
cleaned up AddHandler thanks to changes to CoreSession to support operations with AddRequest
objects

Modified:
    directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/NewAddHandler.java

Modified: directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/NewAddHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/NewAddHandler.java?rev=664436&r1=664435&r2=664436&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/NewAddHandler.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-newldap/src/main/java/org/apache/directory/server/newldap/handlers/NewAddHandler.java
Sat Jun  7 21:23:26 2008
@@ -23,9 +23,7 @@
 import javax.naming.NamingException;
 import javax.naming.ReferralException;
 
-import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
-import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.ReferralHandlingMode;
 import org.apache.directory.server.newldap.LdapSession;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.message.AddRequest;
@@ -34,11 +32,10 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.apache.directory.server.newldap.LdapProtocolUtils.*;
-
 
 /**
  * An LDAP add operation {@link AddRequest} handler.
@@ -62,12 +59,7 @@
 
         try
         {
-            ServerEntry entry = ServerEntryUtils.toServerEntry( request.getAttributes(),
request.getEntry(), 
-                session.getCoreSession().getDirectoryService().getRegistries() );
-            AddOperationContext opContext = new AddOperationContext( session.getCoreSession(),
entry );
-            setRequestControls( opContext, request );
-            session.getCoreSession().getDirectoryService().getOperationManager().add( opContext
);
-            setResponseControls( opContext, request.getResultResponse() );
+            session.getCoreSession().add( request, ReferralHandlingMode.THROW );
         }
         catch( ReferralException e )
         {
@@ -129,11 +121,6 @@
                         result.setMatchedDn( ( LdapDN ) ne.getResolvedName() );
                     }
                 }
-                else
-                {
-                    // TODO - add ability to get the matched DN from the core via the session
-//                  coreSession.getMatchedDn( request.getEntry() );
-                }
             }
 
             session.getIoSession().write( request.getResultResponse() );



Mime
View raw message