directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r797719 - /directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
Date Sat, 25 Jul 2009 08:04:45 GMT
Author: kayyagari
Date: Sat Jul 25 08:04:44 2009
New Revision: 797719

URL: http://svn.apache.org/viewvc?rev=797719&view=rev
Log:
o added support for treeDelete control (used for those server's which support this control)
o removed an unused import

Modified:
    directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java

Modified: directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java?rev=797719&r1=797718&r2=797719&view=diff
==============================================================================
--- directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
(original)
+++ directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
Sat Jul 25 08:04:44 2009
@@ -38,6 +38,7 @@
 import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.naming.InvalidNameException;
+import javax.naming.ldap.BasicControl;
 import javax.naming.ldap.Control;
 import javax.net.ssl.SSLContext;
 
@@ -129,7 +130,6 @@
 import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFilter;
 import org.apache.mina.filter.executor.ExecutorFilter;
-import org.apache.mina.filter.executor.OrderedThreadPoolExecutor;
 import org.apache.mina.filter.executor.UnorderedThreadPoolExecutor;
 import org.apache.mina.filter.ssl.SslFilter;
 import org.apache.mina.transport.socket.nio.NioSocketConnector;
@@ -1992,20 +1992,27 @@
      */
     public DeleteResponse delete( LdapDN dn, boolean deleteChildren, DeleteListener listener
)  throws LdapException
     {
+        DeleteRequest delRequest = null;
+        
         if( deleteChildren )
         {
-            // TODO replace with a constant name, after adding support for treedelete control
in core
-            if( isControlSupported( "1.2.840.113556.1.4.805" ) ) 
+            String treeDeleteOid = "1.2.840.113556.1.4.805";
+            if( isControlSupported( treeDeleteOid ) ) 
             {
-                //delRequest.add( new TreeDeleteControl() );
+                delRequest = new DeleteRequest( dn );
+                delRequest.add( new BasicControl( treeDeleteOid ) );
             }
             else
             {
                 return deleteChildren( dn, new HashMap() );
             }
         }
+        else
+        {
+            delRequest = new DeleteRequest( dn );
+        }
         
-        return delete( new DeleteRequest( dn ), listener ); 
+        return delete( delRequest, listener ); 
     }
     
     



Mime
View raw message