directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1748510 [2/2] - in /directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api: ./ callback/ future/ search/
Date Wed, 15 Jun 2016 07:52:35 GMT
Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java?rev=1748510&r1=1748509&r2=1748510&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java
Wed Jun 15 07:52:34 2016
@@ -20,10 +20,6 @@
 package org.apache.directory.ldap.client.api.future;
 
 
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
 import org.apache.directory.api.ldap.model.message.CompareResponse;
 import org.apache.directory.ldap.client.api.LdapConnection;
 
@@ -48,26 +44,9 @@ public class CompareFuture extends Respo
 
 
     /**
-     * Get the CompareResponse, blocking until one is received, or until the
-     * given timeout is reached.
-     * 
-     * @param timeout {@inheritDoc}
-     * @param unit {@inheritDoc}
-     * @return the compare response
-     * @throws InterruptedException {@inheritDoc}
-     * @throws ExecutionException {@inheritDoc}
-     * @throws TimeoutException {@inheritDoc}
-     */
-    public CompareResponse get( long timeout, TimeUnit unit ) throws InterruptedException,
ExecutionException,
-        TimeoutException
-    {
-        return super.get( timeout, unit );
-    }
-
-
-    /**
      * {@inheritDoc}
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java?rev=1748510&r1=1748509&r2=1748510&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java
Wed Jun 15 07:52:34 2016
@@ -20,10 +20,6 @@
 package org.apache.directory.ldap.client.api.future;
 
 
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
 import org.apache.directory.api.ldap.model.message.DeleteResponse;
 import org.apache.directory.ldap.client.api.LdapConnection;
 
@@ -48,26 +44,9 @@ public class DeleteFuture extends Respon
 
 
     /**
-     * Get the DeleteResponse, blocking until one is received, or until the
-     * given timeout is reached.
-     * 
-     * @param timeout {@inheritDoc}
-     * @param unit {@inheritDoc}
-     * @return the delete response
-     * @throws InterruptedException {@inheritDoc}
-     * @throws ExecutionException {@inheritDoc}
-     * @throws TimeoutException {@inheritDoc}
-     */
-    public DeleteResponse get( long timeout, TimeUnit unit ) throws InterruptedException,
ExecutionException,
-        TimeoutException
-    {
-        return super.get( timeout, unit );
-    }
-
-
-    /**
      * {@inheritDoc}
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java?rev=1748510&r1=1748509&r2=1748510&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java
Wed Jun 15 07:52:34 2016
@@ -20,10 +20,6 @@
 package org.apache.directory.ldap.client.api.future;
 
 
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
 import org.apache.directory.api.ldap.model.message.Response;
 import org.apache.directory.ldap.client.api.LdapConnection;
 
@@ -48,26 +44,9 @@ public class ExtendedFuture extends Resp
 
 
     /**
-     * Get the ExtendedResponse, blocking until one is received, or until the
-     * given timeout is reached.
-     *
-     * @param timeout {@inheritDoc}
-     * @param unit {@inheritDoc}
-     * @return the extended response
-     * @throws InterruptedException {@inheritDoc}
-     * @throws ExecutionException {@inheritDoc}
-     * @throws TimeoutException {@inheritDoc}
-     */
-    public Response get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
-        TimeoutException
-    {
-        return super.get( timeout, unit );
-    }
-
-
-    /**
      * {@inheritDoc}
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java?rev=1748510&r1=1748509&r2=1748510&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java
Wed Jun 15 07:52:34 2016
@@ -20,10 +20,6 @@
 package org.apache.directory.ldap.client.api.future;
 
 
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
 import org.apache.directory.api.ldap.model.message.ModifyDnResponse;
 import org.apache.directory.ldap.client.api.LdapConnection;
 
@@ -48,26 +44,9 @@ public class ModifyDnFuture extends Resp
 
 
     /**
-     * Get the ModifyDnResponse, blocking until one is received, or until the
-     * given timeout is reached.
-     * 
-     * @param timeout {@inheritDoc}
-     * @param unit {@inheritDoc}
-     * @return the modify Dn response
-     * @throws InterruptedException {@inheritDoc}
-     * @throws ExecutionException {@inheritDoc}
-     * @throws TimeoutException {@inheritDoc}
-     */
-    public ModifyDnResponse get( long timeout, TimeUnit unit ) throws InterruptedException,
ExecutionException,
-        TimeoutException
-    {
-        return super.get( timeout, unit );
-    }
-
-
-    /**
      * {@inheritDoc}
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java?rev=1748510&r1=1748509&r2=1748510&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java
Wed Jun 15 07:52:34 2016
@@ -20,10 +20,6 @@
 package org.apache.directory.ldap.client.api.future;
 
 
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
 import org.apache.directory.api.ldap.model.message.ModifyResponse;
 import org.apache.directory.ldap.client.api.LdapConnection;
 
@@ -48,26 +44,9 @@ public class ModifyFuture extends Respon
 
 
     /**
-     * Get the ModifyResponse, blocking until one is received, or until the
-     * given timeout is reached.
-     *
-     * @param timeout {@inheritDoc}
-     * @param unit {@inheritDoc}
-     * @return the modify response
-     * @throws InterruptedException {@inheritDoc}
-     * @throws ExecutionException {@inheritDoc}
-     * @throws TimeoutException {@inheritDoc}
-     */
-    public ModifyResponse get( long timeout, TimeUnit unit ) throws InterruptedException,
ExecutionException,
-        TimeoutException
-    {
-        return super.get( timeout, unit );
-    }
-
-
-    /**
      * {@inheritDoc}
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java?rev=1748510&r1=1748509&r2=1748510&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java
Wed Jun 15 07:52:34 2016
@@ -64,7 +64,7 @@ public class ResponseFuture<R extends Re
      */
     public ResponseFuture( LdapConnection connection, int messageId )
     {
-        queue = new LinkedBlockingQueue<R>();
+        queue = new LinkedBlockingQueue<>();
         this.messageId = messageId;
         this.connection = connection;
     }
@@ -73,6 +73,7 @@ public class ResponseFuture<R extends Re
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean cancel( boolean mayInterruptIfRunning )
     {
         if ( cancelled )
@@ -101,13 +102,10 @@ public class ResponseFuture<R extends Re
      * {@inheritDoc}
      * @throws InterruptedException if the operation has been cancelled by client
      */
+    @Override
     public R get() throws InterruptedException, ExecutionException
     {
-        R response = null;
-
-        response = queue.take();
-
-        return response;
+        return queue.take();
     }
 
 
@@ -125,17 +123,17 @@ public class ResponseFuture<R extends Re
      * {@inheritDoc}
      * @throws InterruptedException if the operation has been cancelled by client
      */
+    @Override
     public R get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
TimeoutException
     {
-        R response = queue.poll( timeout, unit );
-
-        return response;
+        return queue.poll( timeout, unit );
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isCancelled()
     {
         return cancelled;
@@ -147,6 +145,7 @@ public class ResponseFuture<R extends Re
      * 
      * {@inheritDoc}
      */
+    @Override
     public boolean isDone()
     {
         throw new UnsupportedOperationException( "Operation not supported" );
@@ -186,6 +185,7 @@ public class ResponseFuture<R extends Re
     /**
      * {@inheritDoc}
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java?rev=1748510&r1=1748509&r2=1748510&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java
Wed Jun 15 07:52:34 2016
@@ -20,10 +20,6 @@
 package org.apache.directory.ldap.client.api.future;
 
 
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
 import org.apache.directory.api.ldap.model.message.Response;
 import org.apache.directory.ldap.client.api.LdapConnection;
 
@@ -48,31 +44,9 @@ public class SearchFuture extends Respon
 
 
     /**
-     * Get the SearchResponse, blocking until one is received, or until the
-     * given timeout is reached. It can be either a SearchResultEntry, 
-     * a SearchResultReference or a SearchResultDone, the last of all 
-     * the search responses.
-     * 
-     * Get the ModifyResponse, blocking until one is received, or until the
-     * given timeout is reached.
-     *
-     * @param timeout {@inheritDoc}
-     * @param unit {@inheritDoc}
-     * @return the response, either a SearchResultEntry, a SearchResultReference, or a SearchResultDone
-     * @throws InterruptedException {@inheritDoc}
-     * @throws ExecutionException {@inheritDoc}
-     * @throws TimeoutException {@inheritDoc}
-     */
-    public Response get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
-        TimeoutException
-    {
-        return super.get( timeout, unit );
-    }
-
-
-    /**
      * {@inheritDoc}
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/Filter.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/Filter.java?rev=1748510&r1=1748509&r2=1748510&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/Filter.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/Filter.java
Wed Jun 15 07:52:34 2016
@@ -21,8 +21,7 @@ package org.apache.directory.ldap.client
 
 
 /**
- * 
- * TODO Filter.
+ * The base interface for the Search Filters
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */

Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SetOfFiltersFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SetOfFiltersFilter.java?rev=1748510&r1=1748509&r2=1748510&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SetOfFiltersFilter.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SetOfFiltersFilter.java
Wed Jun 15 07:52:34 2016
@@ -44,7 +44,7 @@ import java.util.List;
     private SetOfFiltersFilter( FilterOperator operator )
     {
         this.operator = operator;
-        this.filters = new ArrayList<Filter>();
+        this.filters = new ArrayList<>();
     }
 
 

Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SubstringFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SubstringFilter.java?rev=1748510&r1=1748509&r2=1748510&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SubstringFilter.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SubstringFilter.java
Wed Jun 15 07:52:34 2016
@@ -58,7 +58,7 @@ final class SubstringFilter extends Abst
         // We have to filter the 'any' and remove every empty strings
         if ( ( any != null ) && ( any.length != 0 ) )
         {
-            List<String> anyList = new ArrayList<String>();
+            List<String> anyList = new ArrayList<>();
 
             for ( String string : any )
             {
@@ -68,7 +68,7 @@ final class SubstringFilter extends Abst
                 }
             }
 
-            if ( anyList.size() > 0 )
+            if ( !anyList.isEmpty() )
             {
                 this.any = anyList.toArray( new String[]
                     {} );



Mime
View raw message