directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1771363 [2/2] - in /directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client: api/ api/callback/ api/future/ api/search/ template/ template/exception/
Date Fri, 25 Nov 2016 17:53:21 GMT
Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdifAnonymizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdifAnonymizer.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdifAnonymizer.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdifAnonymizer.java
Fri Nov 25 17:53:20 2016
@@ -115,10 +115,10 @@ import org.apache.directory.api.ldap.sch
 public class LdifAnonymizer
 {
     /** The map that stores the anonymized values associated to the original value */
-    private Map<Value<?>, Value<?>> valueMap = new HashMap<Value<?>,
Value<?>>();
+    private Map<Value<?>, Value<?>> valueMap = new HashMap<>();
     
     /** The set that contains all the values we already have anonymized */
-    private Set<Value<?>> valueSet = new HashSet<Value<?>>();
+    private Set<Value<?>> valueSet = new HashSet<>();
     
     /** The latest anonymized String value Map */
     private Map<Integer, String> latestStringMap;
@@ -127,10 +127,10 @@ public class LdifAnonymizer
     private Map<Integer, byte[]> latestBytesMap;
     
     /** The map of AttributeType'sOID we want to anonymize. They are all associated with
anonymizers */
-    private Map<String, Anonymizer> attributeAnonymizers = new HashMap<String, Anonymizer>();
+    private Map<String, Anonymizer> attributeAnonymizers = new HashMap<>();
     
     /** The list of existing NamingContexts */
-    private Set<Dn> namingContexts = new HashSet<Dn>();
+    private Set<Dn> namingContexts = new HashSet<>();
 
     /** The schemaManager */
     private SchemaManager schemaManager;
@@ -159,6 +159,20 @@ public class LdifAnonymizer
         init( null, null, null, null );
     }
     
+
+    /**
+     * Creates a default instance of LdifAnonymizer. The list of anonymized attribute
+     * is set to a default value.
+     * 
+     * @param schemaManager The SchemaManager instance we will use
+     */
+    public LdifAnonymizer( SchemaManager schemaManager )
+    {
+        this.schemaManager = schemaManager;
+
+        init( null, null, null, null );
+    }
+    
     
     /**
      * Set the PrintStream to use to print information about the processing
@@ -206,20 +220,6 @@ public class LdifAnonymizer
         }
     }
     
-
-    /**
-     * Creates a default instance of LdifAnonymizer. The list of anonymized attribute
-     * is set to a default value.
-     * 
-     * @param schemaManager The SchemaManager instance we will use
-     */
-    public LdifAnonymizer( SchemaManager schemaManager )
-    {
-        this.schemaManager = schemaManager;
-
-        init( null, null, null, null );
-    }
-    
     
     /**
      * Initialize the anonymizer, filling the maps we use.
@@ -407,7 +407,7 @@ public class LdifAnonymizer
         Value<?> value = ava.getValue();
         AttributeType attributeType = ava.getAttributeType();
         Value<?> anonymizedValue = valueMap.get( value );
-        Ava anonymizedAva = null;
+        Ava anonymizedAva;
         
         if ( anonymizedValue == null )
         {
@@ -508,9 +508,7 @@ public class LdifAnonymizer
             rdnPos--;
         }
         
-        Dn anonymizedDn = new Dn( schemaManager, anonymizedRdns );
-        
-        return anonymizedDn;
+        return new Dn( schemaManager, anonymizedRdns );
     }
 
 
@@ -534,8 +532,8 @@ public class LdifAnonymizer
         
         LdifReader ldifReader = new LdifReader( inputFile, schemaManager );
         int count = 0;
-        List<LdifEntry> errors = new ArrayList<LdifEntry>();
-        List<String> errorTexts = new ArrayList<String>();
+        List<LdifEntry> errors = new ArrayList<>();
+        List<String> errorTexts = new ArrayList<>();
 
         try
         {
@@ -597,60 +595,7 @@ public class LdifAnonymizer
                             writer.write( "\n" );
                         }
                     }
-
-                    
-                    /*
-                    Entry entry = ldifEntry.getEntry();
-                    Entry newEntry = new DefaultEntry( schemaManager );
-    
-                    // Process the DN first
-                    Dn entryDn = entry.getDn();
-                    
-                    Dn anonymizedDn = anonymizeDn( entryDn );
                     
-                    if ( anonymizedDn == null )
-                    {
-                        // Wrong entry base DN
-                        continue;
-                    }
-    
-                    // Now, process the entry
-                    for ( Attribute attribute : entry )
-                    {
-                        AttributeType attributeType = attribute.getAttributeType();
-                        
-                        if ( attributeType.getSyntax().getSyntaxChecker() instanceof DnSyntaxChecker
)
-                        {
-                            for ( Value<?> dnValue : attribute )
-                            {
-                                String dnStr = dnValue.getString();
-                                Dn dn = new Dn( schemaManager, dnStr );
-                                Dn newdDn = anonymizeDn( dn );
-                                newEntry.add( attributeType, newdDn.toString() );
-                            }
-                        }
-                        else
-                        {
-                            Anonymizer anonymizer = attributeAnonymizers.get( attribute.getAttributeType().getOid()
);
-        
-                            if ( anonymizer == null )
-                            {
-                                newEntry.add( attribute );
-                            }
-                            else
-                            {
-                                Attribute anonymizedAttribute = anonymizer.anonymize( valueMap,
attribute );
-        
-                                newEntry.add( anonymizedAttribute );
-                            }
-                        }
-                    }
-
-                    newEntry.setDn( anonymizedDn );
-                    writer.write( LdifUtils.convertToLdif( newEntry ) );
-                    writer.write( "\n" );
-                    */
-
                     System.out.print( '.' );
                     
                     if ( count % 100  == 0 )
@@ -675,7 +620,7 @@ public class LdifAnonymizer
 
             println();
             
-            if ( errors.size() != 0 )
+            if ( !errors.isEmpty() )
             {
                 println( "There are " + errors.size() + " bad entries" );
                 int i = 0;
@@ -693,7 +638,7 @@ public class LdifAnonymizer
         {
             println();
 
-            if ( errors.size() != 0 )
+            if ( !errors.isEmpty() )
             {
                 println( "There are " + errors.size() + " bad entries" );
             }
@@ -1126,8 +1071,9 @@ public class LdifAnonymizer
 
         String ldifString = null;
 
-        try ( BufferedReader br = new BufferedReader( new InputStreamReader( new FileInputStream(
args[0] ),
-            Charset.defaultCharset() ) ) )
+        FileInputStream fis = new FileInputStream( args[0] );
+
+        try ( BufferedReader br = new BufferedReader( new InputStreamReader( fis, Charset.defaultCharset()
) ) )
         {
             StringBuilder sb = new StringBuilder();
             String line = br.readLine();
@@ -1141,6 +1087,10 @@ public class LdifAnonymizer
 
             ldifString = sb.toString();
         }
+        finally
+        {
+            fis.close();
+        }
 
         String result = anonymizer.anonymize( ldifString );
 

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LookupLdapConnectionValidator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LookupLdapConnectionValidator.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LookupLdapConnectionValidator.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LookupLdapConnectionValidator.java
Fri Nov 25 17:53:20 2016
@@ -40,6 +40,7 @@ public final class LookupLdapConnectionV
      * @param connection The connection to validate
      * @return True, if the connection is still valid
      */
+    @Override
     public boolean validate( LdapConnection connection )
     {
         try

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/MonitoringLdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/MonitoringLdapConnection.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/MonitoringLdapConnection.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/MonitoringLdapConnection.java
Fri Nov 25 17:53:20 2016
@@ -32,8 +32,7 @@ import org.apache.directory.api.ldap.mod
 
 
 /**
- * 
- * TODO MonitoringLdapConnection.
+ * A class used to monitor the use of a LdapConnection
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/NoVerificationTrustManager.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/NoVerificationTrustManager.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/NoVerificationTrustManager.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/NoVerificationTrustManager.java
Fri Nov 25 17:53:20 2016
@@ -45,6 +45,7 @@ public class NoVerificationTrustManager
     /**
      * {@inheritDoc}
      */
+    @Override
     public void checkClientTrusted( X509Certificate[] x509Certificates, String s ) throws
CertificateException
     {
         LOG.debug( "checkClientTrusted {}", x509Certificates[0] );
@@ -54,6 +55,7 @@ public class NoVerificationTrustManager
     /**
      * {@inheritDoc}
      */
+    @Override
     public void checkServerTrusted( X509Certificate[] x509Certificates, String s ) throws
CertificateException
     {
         LOG.debug( "checkServerTrusted {}", x509Certificates[0] );
@@ -63,6 +65,7 @@ public class NoVerificationTrustManager
     /**
      * {@inheritDoc}
      */
+    @Override
     public X509Certificate[] getAcceptedIssuers()
     {
         return new X509Certificate[0];

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslDigestMd5Request.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslDigestMd5Request.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslDigestMd5Request.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslDigestMd5Request.java
Fri Nov 25 17:53:20 2016
@@ -44,6 +44,7 @@ public class SaslDigestMd5Request extend
      * {@inheritDoc}
      */
     // Overriding the visibility of the method to public
+    @Override
     public void setRealmName( String realmName )
     {
         super.setRealmName( realmName );

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslGssApiRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslGssApiRequest.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslGssApiRequest.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslGssApiRequest.java
Fri Nov 25 17:53:20 2016
@@ -172,6 +172,7 @@ public class SaslGssApiRequest extends S
      * {@inheritDoc}
      */
     // Overriding the visibility of the method to public
+    @Override
     public void setRealmName( String realmName )
     {
         super.setRealmName( realmName );

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslRequest.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslRequest.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SaslRequest.java
Fri Nov 25 17:53:20 2016
@@ -42,7 +42,7 @@ public abstract class SaslRequest
     protected String saslMechanism;
 
     /** The list of controls */
-    protected List<Control> controls = new ArrayList<Control>();
+    protected List<Control> controls = new ArrayList<>();
 
     /** The username */
     protected String username;

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/SearchCursorImpl.java
Fri Nov 25 17:53:20 2016
@@ -102,6 +102,7 @@ public class SearchCursorImpl extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean next() throws LdapException, CursorException
     {
         if ( done )
@@ -150,15 +151,12 @@ public class SearchCursorImpl extends Ab
             throw new LdapConnectionTimeOutException( LdapNetworkConnection.TIME_OUT_ERROR
);
         }
 
-        done = ( response instanceof SearchResultDone );
+        done = response instanceof SearchResultDone;
 
         if ( done )
         {
             searchDoneResp = ( SearchResultDone ) response;
 
-            // Process the response and throw an exception if needed
-            //ResultCodeEnum.processResponse( searchDoneResp );
-
             response = null;
         }
 
@@ -169,6 +167,7 @@ public class SearchCursorImpl extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public Response get() throws InvalidCursorPositionException
     {
         if ( !available() )
@@ -183,6 +182,7 @@ public class SearchCursorImpl extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public SearchResultDone getSearchResultDone()
     {
         return searchDoneResp;
@@ -192,6 +192,7 @@ public class SearchCursorImpl extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean available()
     {
         return response != null;
@@ -252,6 +253,7 @@ public class SearchCursorImpl extends Ab
      * This operation is not supported in SearchCursor.
      * {@inheritDoc}
      */
+    @Override
     public void after( Response element ) throws LdapException, CursorException
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_02014_UNSUPPORTED_OPERATION,
getClass().getName()
@@ -263,6 +265,7 @@ public class SearchCursorImpl extends Ab
      * This operation is not supported in SearchCursor.
      * {@inheritDoc}
      */
+    @Override
     public void afterLast() throws LdapException, CursorException
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_02014_UNSUPPORTED_OPERATION,
getClass().getName()
@@ -274,6 +277,7 @@ public class SearchCursorImpl extends Ab
      * This operation is not supported in SearchCursor.
      * {@inheritDoc}
      */
+    @Override
     public void before( Response element ) throws LdapException, CursorException
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_02014_UNSUPPORTED_OPERATION,
getClass().getName()
@@ -285,6 +289,7 @@ public class SearchCursorImpl extends Ab
      * This operation is not supported in SearchCursor.
      * {@inheritDoc}
      */
+    @Override
     public void beforeFirst() throws LdapException, CursorException
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_02014_UNSUPPORTED_OPERATION,
getClass().getName()
@@ -296,6 +301,7 @@ public class SearchCursorImpl extends Ab
      * This operation is not supported in SearchCursor.
      * {@inheritDoc}
      */
+    @Override
     public boolean first() throws LdapException, CursorException
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_02014_UNSUPPORTED_OPERATION,
getClass().getName()
@@ -307,6 +313,7 @@ public class SearchCursorImpl extends Ab
      * This operation is not supported in SearchCursor.
      * {@inheritDoc}
      */
+    @Override
     public boolean last() throws LdapException, CursorException
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_02014_UNSUPPORTED_OPERATION,
getClass().getName()
@@ -318,6 +325,7 @@ public class SearchCursorImpl extends Ab
      * This operation is not supported in SearchCursor.
      * {@inheritDoc}
      */
+    @Override
     public boolean previous() throws LdapException, CursorException
     {
         throw new UnsupportedOperationException( I18n.err( I18n.ERR_02014_UNSUPPORTED_OPERATION,
getClass().getName()
@@ -328,6 +336,7 @@ public class SearchCursorImpl extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isDone()
     {
         return done;
@@ -337,6 +346,7 @@ public class SearchCursorImpl extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isReferral()
     {
         return response instanceof SearchResultReference;
@@ -346,6 +356,7 @@ public class SearchCursorImpl extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public Referral getReferral() throws LdapException
     {
         if ( isReferral() )
@@ -360,6 +371,7 @@ public class SearchCursorImpl extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isEntry()
     {
         return response instanceof SearchResultEntry;
@@ -369,6 +381,7 @@ public class SearchCursorImpl extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public Entry getEntry() throws LdapException
     {
         if ( isEntry() )
@@ -389,6 +402,7 @@ public class SearchCursorImpl extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isIntermediate()
     {
         return response instanceof IntermediateResponse;
@@ -398,6 +412,7 @@ public class SearchCursorImpl extends Ab
     /**
      * {@inheritDoc}
      */
+    @Override
     public IntermediateResponse getIntermediate() throws LdapException
     {
         if ( isEntry() )

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/ValidatingPoolableLdapConnectionFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/ValidatingPoolableLdapConnectionFactory.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/ValidatingPoolableLdapConnectionFactory.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/ValidatingPoolableLdapConnectionFactory.java
Fri Nov 25 17:53:20 2016
@@ -123,6 +123,7 @@ public class ValidatingPoolableLdapConne
      * 
      * @throws LdapException If unable to connect.
      */
+    @Override
     public MonitoringLdapConnection makeObject() throws LdapException
     {
         LOG.debug( "Creating a LDAP connection" );
@@ -138,6 +139,7 @@ public class ValidatingPoolableLdapConne
      * 
      * @throws LdapException If unable to reconfigure and rebind.
      */
+    @Override
     public void passivateObject( LdapConnection connection ) throws LdapException
     {
         LOG.debug( "Passivating {}", connection );

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/callback/SaslCallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/callback/SaslCallbackHandler.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/callback/SaslCallbackHandler.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/callback/SaslCallbackHandler.java
Fri Nov 25 17:53:20 2016
@@ -66,6 +66,7 @@ public class SaslCallbackHandler impleme
     /**
      * {@inheritDoc}
      */
+    @Override
     public void handle( Callback[] callbacks ) throws IOException, UnsupportedCallbackException
     {
         for ( Callback cb : callbacks )

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/AddFuture.java
Fri Nov 25 17:53:20 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.AddResponse;
 import org.apache.directory.ldap.client.api.LdapConnection;
 
@@ -48,26 +44,9 @@ public class AddFuture extends ResponseF
 
 
     /**
-     * Get the AddResponse, blocking until one is received, or until the
-     * given timeout is reached.
-     * 
-     * @param timeout {@inheritDoc}
-     * @param unit {@inheritDoc}
-     * @return the add response
-     * @throws InterruptedException {@inheritDoc}
-     * @throws ExecutionException {@inheritDoc}
-     * @throws TimeoutException {@inheritDoc}
-     */
-    public AddResponse 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/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/BindFuture.java
Fri Nov 25 17:53:20 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.BindResponse;
 import org.apache.directory.ldap.client.api.LdapConnection;
 
@@ -48,26 +44,9 @@ public class BindFuture extends Response
 
 
     /**
-     * Get the BindResponse, blocking until one is received, or until the
-     * given timeout is reached.
-     * 
-     * @param timeout {@inheritDoc}
-     * @param unit {@inheritDoc}
-     * @return the bind response
-     * @throws InterruptedException {@inheritDoc}
-     * @throws ExecutionException {@inheritDoc}
-     * @throws TimeoutException {@inheritDoc}
-     */
-    public BindResponse 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/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/CompareFuture.java
Fri Nov 25 17:53:20 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/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/DeleteFuture.java
Fri Nov 25 17:53:20 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/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ExtendedFuture.java
Fri Nov 25 17:53:20 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/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyDnFuture.java
Fri Nov 25 17:53:20 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/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ModifyFuture.java
Fri Nov 25 17:53:20 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/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java
Fri Nov 25 17:53:20 2016
@@ -22,11 +22,9 @@ package org.apache.directory.ldap.client
 
 
 import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.LinkedBlockingQueue;
 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;
@@ -64,7 +62,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 +71,7 @@ public class ResponseFuture<R extends Re
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean cancel( boolean mayInterruptIfRunning )
     {
         if ( cancelled )
@@ -101,13 +100,10 @@ public class ResponseFuture<R extends Re
      * {@inheritDoc}
      * @throws InterruptedException if the operation has been cancelled by client
      */
-    public R get() throws InterruptedException, ExecutionException
+    @Override
+    public R get() throws InterruptedException
     {
-        R response = null;
-
-        response = queue.take();
-
-        return response;
+        return queue.take();
     }
 
 
@@ -115,7 +111,7 @@ public class ResponseFuture<R extends Re
      * {@inheritDoc}
      * @throws InterruptedException if the operation has been cancelled by client
      */
-    public void set( R response ) throws InterruptedException, ExecutionException
+    public void set( R response ) throws InterruptedException
     {
         queue.add( response );
     }
@@ -125,17 +121,17 @@ public class ResponseFuture<R extends Re
      * {@inheritDoc}
      * @throws InterruptedException if the operation has been cancelled by client
      */
-    public R get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException,
TimeoutException
+    @Override
+    public R get( long timeout, TimeUnit unit ) throws InterruptedException
     {
-        R response = queue.poll( timeout, unit );
-
-        return response;
+        return queue.poll( timeout, unit );
     }
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isCancelled()
     {
         return cancelled;
@@ -147,6 +143,7 @@ public class ResponseFuture<R extends Re
      * 
      * {@inheritDoc}
      */
+    @Override
     public boolean isDone()
     {
         throw new UnsupportedOperationException( "Operation not supported" );
@@ -186,6 +183,7 @@ public class ResponseFuture<R extends Re
     /**
      * {@inheritDoc}
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/future/SearchFuture.java
Fri Nov 25 17:53:20 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/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/Filter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/Filter.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/Filter.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/Filter.java
Fri Nov 25 17:53:20 2016
@@ -21,8 +21,7 @@ package org.apache.directory.ldap.client
 
 
 /**
- * 
- * TODO Filter.
+ * The Search Filter interface
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SetOfFiltersFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SetOfFiltersFilter.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SetOfFiltersFilter.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SetOfFiltersFilter.java
Fri Nov 25 17:53:20 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/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SubstringFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SubstringFilter.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SubstringFilter.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/SubstringFilter.java
Fri Nov 25 17:53:20 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[]
                     {} );

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/LdapConnectionTemplate.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/LdapConnectionTemplate.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/LdapConnectionTemplate.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/LdapConnectionTemplate.java
Fri Nov 25 17:53:20 2016
@@ -674,7 +674,7 @@ public class LdapConnectionTemplate impl
     public <T> List<T> search( SearchRequest searchRequest,
         EntryMapper<T> entryMapper )
     {
-        List<T> entries = new ArrayList<T>();
+        List<T> entries = new ArrayList<>();
 
         LdapConnection connection = null;
         try

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/exception/LdapRequestUnsuccessfulException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/exception/LdapRequestUnsuccessfulException.java?rev=1771363&r1=1771362&r2=1771363&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/exception/LdapRequestUnsuccessfulException.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/exception/LdapRequestUnsuccessfulException.java
Fri Nov 25 17:53:20 2016
@@ -34,7 +34,7 @@ public class LdapRequestUnsuccessfulExce
 {
     private static final long serialVersionUID = 1982294624076306127L;
 
-    private ResultResponse response;
+    private final transient ResultResponse response;
 
 
     public LdapRequestUnsuccessfulException( ResultResponse response )




Mime
View raw message