directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r797806 - in /directory: apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/
Date Sat, 25 Jul 2009 17:57:57 GMT
Author: kayyagari
Date: Sat Jul 25 17:57:57 2009
New Revision: 797806

URL: http://svn.apache.org/viewvc?rev=797806&view=rev
Log:
o added some javadoc and cleaned up some redundant comments
o renamed deleteChildren() to deleteRecursive() to reflect its behaviour and updated the test
case

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

Modified: directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java?rev=797806&r1=797805&r2=797806&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java
(original)
+++ directory/apacheds/trunk/ldap-api-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientDeleteRequestTest.java
Sat Jul 25 17:57:57 2009
@@ -179,7 +179,7 @@
         
         assertTrue( session.exists( dn ) );
 
-        Method deleteChildrenMethod = connection.getClass().getDeclaredMethod( "deleteChildren",
LdapDN.class, Map.class );
+        Method deleteChildrenMethod = connection.getClass().getDeclaredMethod( "deleteRecursive",
LdapDN.class, Map.class );
         deleteChildrenMethod.setAccessible( true );
         
         DeleteResponse response = ( DeleteResponse ) deleteChildrenMethod.invoke( connection,
dn, null );

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=797806&r1=797805&r2=797806&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 17:57:57 2009
@@ -752,14 +752,13 @@
 
     
     //------------------------ The LDAP operations ------------------------//
-    // Abandon operations                                                  //
-    //  The Abandon request just have one parameter : the MessageId to     //
-    // abandon. We also have to allow controls and a client timeout.       //
-    // The abandonRequest is always non-blocking, because no response is   //
-    // expected                                                            //
-    //---------------------------------------------------------------------//
+
     /**
-     * A simple abandon request. 
+     * Abandons a request submitted to the server for performing a particular operation
+     * 
+     * The abandonRequest is always non-blocking, because no response is expected
+     * 
+     * @param messageId the ID of the request message sent to the server 
      */
     public void abandon( int messageId ) throws LdapException
     {
@@ -771,7 +770,12 @@
 
     
     /**
-     * An abandon request with potentially some controls and timeout. 
+     * An abandon request essentially with the request message ID of the operation to be
cancelled
+     * and/or potentially some controls and timeout (the controls and timeout are not mandatory).
+     * 
+     * The abandonRequest is always non-blocking, because no response is expected
+     *  
+     * @param abandonRequest the abandon operation's request
      */
     public void abandon( AbandonRequest abandonRequest ) throws LdapException
     {
@@ -839,9 +843,6 @@
     }
     
     
-    //------------------------ The LDAP operations ------------------------//
-    // Bind operations                                                     //
-    //---------------------------------------------------------------------//
     /**
      * Anonymous Bind on a server. 
      *
@@ -1082,9 +1083,6 @@
     }
     
 
-    //------------------------ The LDAP operations ------------------------//
-    // Search operations                                                   //
-    //---------------------------------------------------------------------//
     /**
      * Do a search, on the base object, using the given filter. The
      * SearchRequest parameters default to :
@@ -1144,7 +1142,8 @@
     
     
     /**
-     * {@inheritDoc}
+     * performs search in a synchronous mode (as if a null search listener is passed) 
+     * @see #search(SearchRequest, SearchListener)
      */
     public Cursor<SearchResponse> search( SearchRequest searchRequest ) throws LdapException
     {
@@ -2004,7 +2003,7 @@
             }
             else
             {
-                return deleteChildren( dn, new HashMap() );
+                return deleteRecursive( dn, new HashMap() );
             }
         }
         else
@@ -2057,7 +2056,7 @@
      * @param map a map to hold the Cursor related to a DN 
      * @throws LdapException
      */
-    private DeleteResponse deleteChildren( LdapDN dn, Map<LdapDN, Cursor<SearchResponse>>
cursorMap ) throws LdapException
+    private DeleteResponse deleteRecursive( LdapDN dn, Map<LdapDN, Cursor<SearchResponse>>
cursorMap ) throws LdapException
     {
         LOG.debug( "searching for {}", dn.getUpName() );
         DeleteResponse delResponse = null;
@@ -2092,7 +2091,7 @@
                     if( searchResp instanceof SearchResultEntry )
                     {
                         SearchResultEntry searchResult = ( SearchResultEntry ) searchResp;
-                        deleteChildren( searchResult.getEntry().getDn(), cursorMap );
+                        deleteRecursive( searchResult.getEntry().getDn(), cursorMap );
                     }
                 }
                 while( cursor.next() );



Mime
View raw message