Class LDAPReadWriteConnectionPool

  • All Implemented Interfaces:
    LDAPInterface, java.io.Closeable, java.lang.AutoCloseable

    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class LDAPReadWriteConnectionPool
    extends java.lang.Object
    implements LDAPInterface, java.io.Closeable
    This class provides an implementation of a special type of LDAP connection pool which maintains two separate sets of connections: one for read operations and the other for write operations. The "write" connections will be used for add, delete, modify, and modify DN operations, and the "read" connections will be used for all other processing including bind, compare, and search operations, as well as methods like getEntry(java.lang.String), getRootDSE(), and getSchema(). If the target directory environment does not require separate servers for read and write operations, then it is recommended that the simpler LDAPConnectionPool class be used instead.

    This class is very similar to the LDAPConnectionPool class with the exception that it is possible to explicitly check out and release connections from either the read or write pools, and there is no convenience method for processing multiple requests over the same connection. See the documentation for the LDAPConnectionPool class for additional documentation and for examples demonstrating the use of both connection pool implementations.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LDAPResult add​(AddRequest addRequest)
      Processes the provided add request using a write connection from this connection pool.
      LDAPResult add​(Entry entry)
      Processes an add operation with the provided information using a write connection from this connection pool.
      LDAPResult add​(ReadOnlyAddRequest addRequest)
      Processes the provided add request using a write connection from this connection pool.
      LDAPResult add​(java.lang.String... ldifLines)
      Processes an add operation with the provided information using a write connection from this connection pool.
      LDAPResult add​(java.lang.String dn, Attribute... attributes)
      Processes an add operation with the provided information using a write connection from this connection pool.
      LDAPResult add​(java.lang.String dn, java.util.Collection<Attribute> attributes)
      Processes an add operation with the provided information using a write connection from this connection pool.
      BindResult bind​(BindRequest bindRequest)
      Processes the provided bind request using a read connection from this connection pool.
      BindResult bind​(java.lang.String bindDN, java.lang.String password)
      Processes a simple bind request with the provided DN and password using a read connection from this connection pool.
      void close()
      Closes this connection pool.
      CompareResult compare​(CompareRequest compareRequest)
      Processes the provided compare request using a read connection from this connection pool.
      CompareResult compare​(ReadOnlyCompareRequest compareRequest)
      Processes the provided compare request using a read connection from this connection pool.
      CompareResult compare​(java.lang.String dn, java.lang.String attributeName, java.lang.String assertionValue)
      Processes a compare operation with the provided information using a read connection from this connection pool.
      LDAPResult delete​(DeleteRequest deleteRequest)
      Processes the provided delete request using a write connection from this connection pool.
      LDAPResult delete​(ReadOnlyDeleteRequest deleteRequest)
      Processes the provided delete request using a write connection from this connection pool.
      LDAPResult delete​(java.lang.String dn)
      Deletes the entry with the specified DN using a write connection from this connection pool.
      protected void finalize()
      Closes this connection pool in the event that it becomes unreferenced.
      SearchResultEntry getEntry​(java.lang.String dn)
      Retrieves the entry with the specified DN using a read connection from this connection pool.
      SearchResultEntry getEntry​(java.lang.String dn, java.lang.String... attributes)
      Retrieves the entry with the specified DN using a read connection from this connection pool.
      LDAPConnection getReadConnection()
      Retrieves an LDAP connection from the read pool.
      LDAPConnectionPool getReadPool()
      Retrieves the connection pool that should be used for read operations.
      LDAPConnectionPoolStatistics getReadPoolStatistics()
      Retrieves the set of statistics maintained for the read pool.
      RootDSE getRootDSE()
      Retrieves the directory server root DSE using a read connection from this connection pool.
      Schema getSchema()
      Retrieves the directory server schema definitions using a read connection from this connection pool, using the subschema subentry DN contained in the server's root DSE.
      Schema getSchema​(java.lang.String entryDN)
      Retrieves the directory server schema definitions that govern the specified entry using a read connection from this connection pool.
      LDAPConnection getWriteConnection()
      Retrieves an LDAP connection from the write pool.
      LDAPConnectionPool getWritePool()
      Retrieves the connection pool that should be used for write operations.
      LDAPConnectionPoolStatistics getWritePoolStatistics()
      Retrieves the set of statistics maintained for the write pool.
      boolean isClosed()
      Indicates whether this connection pool has been closed.
      LDAPResult modify​(ModifyRequest modifyRequest)
      Processes the provided modify request using a write connection from this connection pool.
      LDAPResult modify​(ReadOnlyModifyRequest modifyRequest)
      Processes the provided modify request using a write connection from this connection pool.
      LDAPResult modify​(java.lang.String... ldifModificationLines)
      Processes a modify request from the provided LDIF representation of the changes using a write connection from this connection pool.
      LDAPResult modify​(java.lang.String dn, Modification mod)
      Applies the provided modification to the specified entry using a write connection from this connection pool.
      LDAPResult modify​(java.lang.String dn, Modification... mods)
      Applies the provided set of modifications to the specified entry using a write connection from this connection pool.
      LDAPResult modify​(java.lang.String dn, java.util.List<Modification> mods)
      Applies the provided set of modifications to the specified entry using a write connection from this connection pool.
      LDAPResult modifyDN​(ModifyDNRequest modifyDNRequest)
      Processes the provided modify DN request using a write connection from this connection pool.
      LDAPResult modifyDN​(ReadOnlyModifyDNRequest modifyDNRequest)
      Processes the provided modify DN request using a write connection from this connection pool.
      LDAPResult modifyDN​(java.lang.String dn, java.lang.String newRDN, boolean deleteOldRDN)
      Performs a modify DN operation with the provided information using a write connection from this connection pool.
      LDAPResult modifyDN​(java.lang.String dn, java.lang.String newRDN, boolean deleteOldRDN, java.lang.String newSuperiorDN)
      Performs a modify DN operation with the provided information using a write connection from this connection pool.
      void releaseDefunctReadConnection​(LDAPConnection connection)
      Indicates that the provided read connection is no longer in use, but is also no longer fit for use.
      void releaseDefunctWriteConnection​(LDAPConnection connection)
      Indicates that the provided write connection is no longer in use, but is also no longer fit for use.
      void releaseReadConnection​(LDAPConnection connection)
      Releases the provided connection back to the read pool.
      void releaseWriteConnection​(LDAPConnection connection)
      Releases the provided connection back to the write pool.
      SearchResult search​(ReadOnlySearchRequest searchRequest)
      Processes the provided search request using a read connection from this connection pool.
      SearchResult search​(SearchRequest searchRequest)
      Processes the provided search request using a read connection from this connection pool.
      SearchResult search​(SearchResultListener searchResultListener, java.lang.String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, Filter filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResult search​(SearchResultListener searchResultListener, java.lang.String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, java.lang.String filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResult search​(SearchResultListener searchResultListener, java.lang.String baseDN, SearchScope scope, Filter filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResult search​(SearchResultListener searchResultListener, java.lang.String baseDN, SearchScope scope, java.lang.String filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResult search​(java.lang.String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, Filter filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResult search​(java.lang.String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, java.lang.String filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResult search​(java.lang.String baseDN, SearchScope scope, Filter filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResult search​(java.lang.String baseDN, SearchScope scope, java.lang.String filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResultEntry searchForEntry​(ReadOnlySearchRequest searchRequest)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResultEntry searchForEntry​(SearchRequest searchRequest)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResultEntry searchForEntry​(java.lang.String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int timeLimit, boolean typesOnly, Filter filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResultEntry searchForEntry​(java.lang.String baseDN, SearchScope scope, DereferencePolicy derefPolicy, int timeLimit, boolean typesOnly, java.lang.String filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResultEntry searchForEntry​(java.lang.String baseDN, SearchScope scope, Filter filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      SearchResultEntry searchForEntry​(java.lang.String baseDN, SearchScope scope, java.lang.String filter, java.lang.String... attributes)
      Processes a search operation with the provided information using a read connection from this connection pool.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LDAPReadWriteConnectionPool

        public LDAPReadWriteConnectionPool​(@NotNull
                                           LDAPConnection readConnection,
                                           int initialReadConnections,
                                           int maxReadConnections,
                                           @NotNull
                                           LDAPConnection writeConnection,
                                           int initialWriteConnections,
                                           int maxWriteConnections)
                                    throws LDAPException
        Creates a new LDAP read-write connection pool with the provided connections.
        Parameters:
        readConnection - The connection to use to provide the template for other connections to be created for performing read operations. This connection will be included in the pool. It must not be null, and it must be established to the target server. It does not necessarily need to be authenticated if all read connections are to be unauthenticated.
        initialReadConnections - The number of connections to initially establish in the pool that is created for read operations. It must be greater than or equal to one.
        maxReadConnections - The maximum number of connections that should be maintained in the read pool. It must be greater than or equal to the initial number of write connections.
        writeConnection - The connection to use to provide the template for other connections to be created for performing write operations. This connection will be included in the pool. It must not be null, and it must be established to the target server. It does not necessarily need to be authenticated if all write connections are to be unauthenticated.
        initialWriteConnections - The number of connections to initially establish in the pool that is created for write operations. It must be greater than or equal to one.
        maxWriteConnections - The maximum number of connections that should be maintained in the write pool. It must be greater than or equal to the initial number of write connections.
        Throws:
        LDAPException - If either of the provided connections cannot be used to initialize the pool, or if a problem occurs while attempting to establish any of the connections. If this is thrown, then all connections associated with this pool (including the read and write connections provided as arguments) will be closed.
      • LDAPReadWriteConnectionPool

        public LDAPReadWriteConnectionPool​(@NotNull
                                           LDAPConnectionPool readPool,
                                           @NotNull
                                           LDAPConnectionPool writePool)
        Creates a new LDAP read-write connection pool with the provided pools for read and write operations, respectively.
        Parameters:
        readPool - The connection pool to be used for read operations. It must not be null.
        writePool - The connection pool to be used for write operations. It must not be null.
    • Method Detail

      • close

        public void close()
        Closes this connection pool. All read and write connections currently held in the pool that are not in use will be closed, and any outstanding connections will be automatically closed when they are released back to the pool.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • isClosed

        public boolean isClosed()
        Indicates whether this connection pool has been closed.
        Returns:
        true if this connection pool has been closed, or false if not.
      • releaseReadConnection

        public void releaseReadConnection​(@NotNull
                                          LDAPConnection connection)
        Releases the provided connection back to the read pool.
        Parameters:
        connection - The connection to be released back to the read pool.
      • releaseDefunctReadConnection

        public void releaseDefunctReadConnection​(@NotNull
                                                 LDAPConnection connection)
        Indicates that the provided read connection is no longer in use, but is also no longer fit for use. The provided connection will be terminated and a new connection will be created and added to the read pool in its place.
        Parameters:
        connection - The defunct read connection being released.
      • releaseWriteConnection

        public void releaseWriteConnection​(@NotNull
                                           LDAPConnection connection)
        Releases the provided connection back to the write pool.
        Parameters:
        connection - The connection to be released back to the write pool.
      • releaseDefunctWriteConnection

        public void releaseDefunctWriteConnection​(@NotNull
                                                  LDAPConnection connection)
        Indicates that the provided write connection is no longer in use, but is also no longer fit for use. The provided connection will be terminated and a new connection will be created and added to the write pool in its place.
        Parameters:
        connection - The defunct write connection being released.
      • getReadPool

        @NotNull
        public LDAPConnectionPool getReadPool()
        Retrieves the connection pool that should be used for read operations.
        Returns:
        The connection pool that should be used for read operations.
      • getWritePool

        @NotNull
        public LDAPConnectionPool getWritePool()
        Retrieves the connection pool that should be used for write operations.
        Returns:
        The connection pool that should be used for write operations.
      • getRootDSE

        @Nullable
        public RootDSE getRootDSE()
                           throws LDAPException
        Retrieves the directory server root DSE using a read connection from this connection pool.
        Specified by:
        getRootDSE in interface LDAPInterface
        Returns:
        The directory server root DSE, or null if it is not available.
        Throws:
        LDAPException - If a problem occurs while attempting to retrieve the server root DSE.
      • getSchema

        @Nullable
        public Schema getSchema()
                         throws LDAPException
        Retrieves the directory server schema definitions using a read connection from this connection pool, using the subschema subentry DN contained in the server's root DSE. For directory servers containing a single schema, this should be sufficient for all purposes. For servers with multiple schemas, it may be necessary to specify the DN of the target entry for which to obtain the associated schema.
        Specified by:
        getSchema in interface LDAPInterface
        Returns:
        The directory server schema definitions, or null if the schema information could not be retrieved (e.g, the client does not have permission to read the server schema).
        Throws:
        LDAPException - If a problem occurs while attempting to retrieve the server schema.
      • getSchema

        @Nullable
        public Schema getSchema​(@Nullable
                                java.lang.String entryDN)
                         throws LDAPException
        Retrieves the directory server schema definitions that govern the specified entry using a read connection from this connection pool. The subschemaSubentry attribute will be retrieved from the target entry, and then the appropriate schema definitions will be loaded from the entry referenced by that attribute. This may be necessary to ensure correct behavior in servers that support multiple schemas.
        Specified by:
        getSchema in interface LDAPInterface
        Parameters:
        entryDN - The DN of the entry for which to retrieve the associated schema definitions. It may be null or an empty string if the subschemaSubentry attribute should be retrieved from the server's root DSE.
        Returns:
        The directory server schema definitions, or null if the schema information could not be retrieved (e.g, the client does not have permission to read the server schema).
        Throws:
        LDAPException - If a problem occurs while attempting to retrieve the server schema.
      • getEntry

        @Nullable
        public SearchResultEntry getEntry​(@NotNull
                                          java.lang.String dn)
                                   throws LDAPException
        Retrieves the entry with the specified DN using a read connection from this connection pool. All user attributes will be requested in the entry to return.
        Specified by:
        getEntry in interface LDAPInterface
        Parameters:
        dn - The DN of the entry to retrieve. It must not be null.
        Returns:
        The requested entry, or null if the target entry does not exist or no entry was returned (e.g., if the authenticated user does not have permission to read the target entry).
        Throws:
        LDAPException - If a problem occurs while sending the request or reading the response.
      • getEntry

        @Nullable
        public SearchResultEntry getEntry​(@NotNull
                                          java.lang.String dn,
                                          @Nullable
                                          java.lang.String... attributes)
                                   throws LDAPException
        Retrieves the entry with the specified DN using a read connection from this connection pool.
        Specified by:
        getEntry in interface LDAPInterface
        Parameters:
        dn - The DN of the entry to retrieve. It must not be null.
        attributes - The set of attributes to request for the target entry. If it is null, then all user attributes will be requested.
        Returns:
        The requested entry, or null if the target entry does not exist or no entry was returned (e.g., if the authenticated user does not have permission to read the target entry).
        Throws:
        LDAPException - If a problem occurs while sending the request or reading the response.
      • add

        @NotNull
        public LDAPResult add​(@NotNull
                              java.lang.String dn,
                              @NotNull
                              Attribute... attributes)
                       throws LDAPException
        Processes an add operation with the provided information using a write connection from this connection pool.
        Specified by:
        add in interface LDAPInterface
        Parameters:
        dn - The DN of the entry to add. It must not be null.
        attributes - The set of attributes to include in the entry to add. It must not be null.
        Returns:
        The result of processing the add operation.
        Throws:
        LDAPException - If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
      • add

        @NotNull
        public LDAPResult add​(@NotNull
                              java.lang.String dn,
                              @NotNull
                              java.util.Collection<Attribute> attributes)
                       throws LDAPException
        Processes an add operation with the provided information using a write connection from this connection pool.
        Specified by:
        add in interface LDAPInterface
        Parameters:
        dn - The DN of the entry to add. It must not be null.
        attributes - The set of attributes to include in the entry to add. It must not be null.
        Returns:
        The result of processing the add operation.
        Throws:
        LDAPException - If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
      • add

        @NotNull
        public LDAPResult add​(@NotNull
                              Entry entry)
                       throws LDAPException
        Processes an add operation with the provided information using a write connection from this connection pool.
        Specified by:
        add in interface LDAPInterface
        Parameters:
        entry - The entry to add. It must not be null.
        Returns:
        The result of processing the add operation.
        Throws:
        LDAPException - If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
      • add

        @NotNull
        public LDAPResult add​(@NotNull
                              java.lang.String... ldifLines)
                       throws LDIFException,
                              LDAPException
        Processes an add operation with the provided information using a write connection from this connection pool.
        Specified by:
        add in interface LDAPInterface
        Parameters:
        ldifLines - The lines that comprise an LDIF representation of the entry to add. It must not be empty or null.
        Returns:
        The result of processing the add operation.
        Throws:
        LDIFException - If the provided entry lines cannot be decoded as an entry in LDIF form.
        LDAPException - If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
      • add

        @NotNull
        public LDAPResult add​(@NotNull
                              AddRequest addRequest)
                       throws LDAPException
        Processes the provided add request using a write connection from this connection pool.
        Specified by:
        add in interface LDAPInterface
        Parameters:
        addRequest - The add request to be processed. It must not be null.
        Returns:
        The result of processing the add operation.
        Throws:
        LDAPException - If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
      • add

        @NotNull
        public LDAPResult add​(@NotNull
                              ReadOnlyAddRequest addRequest)
                       throws LDAPException
        Processes the provided add request using a write connection from this connection pool.
        Specified by:
        add in interface LDAPInterface
        Parameters:
        addRequest - The add request to be processed. It must not be null.
        Returns:
        The result of processing the add operation.
        Throws:
        LDAPException - If the server rejects the add request, or if a problem is encountered while sending the request or reading the response.
      • bind

        @NotNull
        public BindResult bind​(@Nullable
                               java.lang.String bindDN,
                               @Nullable
                               java.lang.String password)
                        throws LDAPException
        Processes a simple bind request with the provided DN and password using a read connection from this connection pool. Note that this will impact the state of the connection in the pool, and therefore this method should only be used if this connection pool is used exclusively for processing bind operations, or if the retain identity request control (a proprietary control for use with the Ping Identity, UnboundID, or Nokia/Alcatel-Lucent 8661 Directory Server) is included in the bind request to ensure that the authentication state is not impacted.
        Parameters:
        bindDN - The bind DN for the bind operation.
        password - The password for the simple bind operation.
        Returns:
        The result of processing the bind operation.
        Throws:
        LDAPException - If the server rejects the bind request, or if a problem occurs while sending the request or reading the response.
      • bind

        @NotNull
        public BindResult bind​(@NotNull
                               BindRequest bindRequest)
                        throws LDAPException
        Processes the provided bind request using a read connection from this connection pool. Note that this will impact the state of the connection in the pool, and therefore this method should only be used if this connection pool is used exclusively for processing bind operations, or if the retain identity request control (a proprietary control for use with the Ping Identity, UnboundID, or Nokia/Alcatel-Lucent 8661 Directory Server) is included in the bind request to ensure that the authentication state is not impacted.
        Parameters:
        bindRequest - The bind request to be processed. It must not be null.
        Returns:
        The result of processing the bind operation.
        Throws:
        LDAPException - If the server rejects the bind request, or if a problem occurs while sending the request or reading the response.
      • compare

        @NotNull
        public CompareResult compare​(@NotNull
                                     java.lang.String dn,
                                     @NotNull
                                     java.lang.String attributeName,
                                     @NotNull
                                     java.lang.String assertionValue)
                              throws LDAPException
        Processes a compare operation with the provided information using a read connection from this connection pool.
        Specified by:
        compare in interface LDAPInterface
        Parameters:
        dn - The DN of the entry in which to make the comparison. It must not be null.
        attributeName - The attribute name for which to make the comparison. It must not be null.
        assertionValue - The assertion value to verify in the target entry. It must not be null.
        Returns:
        The result of processing the compare operation.
        Throws:
        LDAPException - If the server rejects the compare request, or if a problem is encountered while sending the request or reading the response.
      • compare

        @NotNull
        public CompareResult compare​(@NotNull
                                     CompareRequest compareRequest)
                              throws LDAPException
        Processes the provided compare request using a read connection from this connection pool.
        Specified by:
        compare in interface LDAPInterface
        Parameters:
        compareRequest - The compare request to be processed. It must not be null.
        Returns:
        The result of processing the compare operation.
        Throws:
        LDAPException - If the server rejects the compare request, or if a problem is encountered while sending the request or reading the response.
      • compare

        @NotNull
        public CompareResult compare​(@NotNull
                                     ReadOnlyCompareRequest compareRequest)
                              throws LDAPException
        Processes the provided compare request using a read connection from this connection pool.
        Specified by:
        compare in interface LDAPInterface
        Parameters:
        compareRequest - The compare request to be processed. It must not be null.
        Returns:
        The result of processing the compare operation.
        Throws:
        LDAPException - If the server rejects the compare request, or if a problem is encountered while sending the request or reading the response.
      • delete

        @NotNull
        public LDAPResult delete​(@NotNull
                                 java.lang.String dn)
                          throws LDAPException
        Deletes the entry with the specified DN using a write connection from this connection pool.
        Specified by:
        delete in interface LDAPInterface
        Parameters:
        dn - The DN of the entry to delete. It must not be null.
        Returns:
        The result of processing the delete operation.
        Throws:
        LDAPException - If the server rejects the delete request, or if a problem is encountered while sending the request or reading the response.
      • delete

        @NotNull
        public LDAPResult delete​(@NotNull
                                 DeleteRequest deleteRequest)
                          throws LDAPException
        Processes the provided delete request using a write connection from this connection pool.
        Specified by:
        delete in interface LDAPInterface
        Parameters:
        deleteRequest - The delete request to be processed. It must not be null.
        Returns:
        The result of processing the delete operation.
        Throws:
        LDAPException - If the server rejects the delete request, or if a problem is encountered while sending the request or reading the response.
      • delete

        @NotNull
        public LDAPResult delete​(@NotNull
                                 ReadOnlyDeleteRequest deleteRequest)
                          throws LDAPException
        Processes the provided delete request using a write connection from this connection pool.
        Specified by:
        delete in interface LDAPInterface
        Parameters:
        deleteRequest - The delete request to be processed. It must not be null.
        Returns:
        The result of processing the delete operation.
        Throws:
        LDAPException - If the server rejects the delete request, or if a problem is encountered while sending the request or reading the response.
      • modify

        @NotNull
        public LDAPResult modify​(@NotNull
                                 java.lang.String dn,
                                 @NotNull
                                 Modification mod)
                          throws LDAPException
        Applies the provided modification to the specified entry using a write connection from this connection pool.
        Specified by:
        modify in interface LDAPInterface
        Parameters:
        dn - The DN of the entry to modify. It must not be null.
        mod - The modification to apply to the target entry. It must not be null.
        Returns:
        The result of processing the modify operation.
        Throws:
        LDAPException - If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
      • modify

        @NotNull
        public LDAPResult modify​(@NotNull
                                 java.lang.String dn,
                                 @NotNull
                                 Modification... mods)
                          throws LDAPException
        Applies the provided set of modifications to the specified entry using a write connection from this connection pool.
        Specified by:
        modify in interface LDAPInterface
        Parameters:
        dn - The DN of the entry to modify. It must not be null.
        mods - The set of modifications to apply to the target entry. It must not be null or empty. *
        Returns:
        The result of processing the modify operation.
        Throws:
        LDAPException - If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
      • modify

        @NotNull
        public LDAPResult modify​(@NotNull
                                 java.lang.String dn,
                                 @NotNull
                                 java.util.List<Modification> mods)
                          throws LDAPException
        Applies the provided set of modifications to the specified entry using a write connection from this connection pool.
        Specified by:
        modify in interface LDAPInterface
        Parameters:
        dn - The DN of the entry to modify. It must not be null.
        mods - The set of modifications to apply to the target entry. It must not be null or empty.
        Returns:
        The result of processing the modify operation.
        Throws:
        LDAPException - If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
      • modify

        @NotNull
        public LDAPResult modify​(@NotNull
                                 java.lang.String... ldifModificationLines)
                          throws LDIFException,
                                 LDAPException
        Processes a modify request from the provided LDIF representation of the changes using a write connection from this connection pool.
        Specified by:
        modify in interface LDAPInterface
        Parameters:
        ldifModificationLines - The lines that comprise an LDIF representation of a modify change record. It must not be null or empty.
        Returns:
        The result of processing the modify operation.
        Throws:
        LDIFException - If the provided set of lines cannot be parsed as an LDIF modify change record.
        LDAPException - If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
      • modify

        @NotNull
        public LDAPResult modify​(@NotNull
                                 ModifyRequest modifyRequest)
                          throws LDAPException
        Processes the provided modify request using a write connection from this connection pool.
        Specified by:
        modify in interface LDAPInterface
        Parameters:
        modifyRequest - The modify request to be processed. It must not be null.
        Returns:
        The result of processing the modify operation.
        Throws:
        LDAPException - If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
      • modify

        @NotNull
        public LDAPResult modify​(@NotNull
                                 ReadOnlyModifyRequest modifyRequest)
                          throws LDAPException
        Processes the provided modify request using a write connection from this connection pool.
        Specified by:
        modify in interface LDAPInterface
        Parameters:
        modifyRequest - The modify request to be processed. It must not be null.
        Returns:
        The result of processing the modify operation.
        Throws:
        LDAPException - If the server rejects the modify request, or if a problem is encountered while sending the request or reading the response.
      • modifyDN

        @NotNull
        public LDAPResult modifyDN​(@NotNull
                                   java.lang.String dn,
                                   @NotNull
                                   java.lang.String newRDN,
                                   boolean deleteOldRDN)
                            throws LDAPException
        Performs a modify DN operation with the provided information using a write connection from this connection pool.
        Specified by:
        modifyDN in interface LDAPInterface
        Parameters:
        dn - The current DN for the entry to rename. It must not be null.
        newRDN - The new RDN to use for the entry. It must not be null.
        deleteOldRDN - Indicates whether to delete the current RDN value from the entry.
        Returns:
        The result of processing the modify DN operation.
        Throws:
        LDAPException - If the server rejects the modify DN request, or if a problem is encountered while sending the request or reading the response.
      • modifyDN

        @NotNull
        public LDAPResult modifyDN​(@NotNull
                                   java.lang.String dn,
                                   @NotNull
                                   java.lang.String newRDN,
                                   boolean deleteOldRDN,
                                   @Nullable
                                   java.lang.String newSuperiorDN)
                            throws LDAPException
        Performs a modify DN operation with the provided information using a write connection from this connection pool.
        Specified by:
        modifyDN in interface LDAPInterface
        Parameters:
        dn - The current DN for the entry to rename. It must not be null.
        newRDN - The new RDN to use for the entry. It must not be null.
        deleteOldRDN - Indicates whether to delete the current RDN value from the entry.
        newSuperiorDN - The new superior DN for the entry. It may be null if the entry is not to be moved below a new parent.
        Returns:
        The result of processing the modify DN operation.
        Throws:
        LDAPException - If the server rejects the modify DN request, or if a problem is encountered while sending the request or reading the response.
      • modifyDN

        @NotNull
        public LDAPResult modifyDN​(@NotNull
                                   ModifyDNRequest modifyDNRequest)
                            throws LDAPException
        Processes the provided modify DN request using a write connection from this connection pool.
        Specified by:
        modifyDN in interface LDAPInterface
        Parameters:
        modifyDNRequest - The modify DN request to be processed. It must not be null.
        Returns:
        The result of processing the modify DN operation.
        Throws:
        LDAPException - If the server rejects the modify DN request, or if a problem is encountered while sending the request or reading the response.
      • modifyDN

        @NotNull
        public LDAPResult modifyDN​(@NotNull
                                   ReadOnlyModifyDNRequest modifyDNRequest)
                            throws LDAPException
        Processes the provided modify DN request using a write connection from this connection pool.
        Specified by:
        modifyDN in interface LDAPInterface
        Parameters:
        modifyDNRequest - The modify DN request to be processed. It must not be null.
        Returns:
        The result of processing the modify DN operation.
        Throws:
        LDAPException - If the server rejects the modify DN request, or if a problem is encountered while sending the request or reading the response.
      • search

        @NotNull
        public SearchResult search​(@NotNull
                                   java.lang.String baseDN,
                                   @NotNull
                                   SearchScope scope,
                                   @NotNull
                                   java.lang.String filter,
                                   @Nullable
                                   java.lang.String... attributes)
                            throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool. The search result entries and references will be collected internally and included in the SearchResult object that is returned.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references.
        Specified by:
        search in interface LDAPInterface
        Parameters:
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        filter - The string representation of the filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        A search result object that provides information about the processing of the search, including the set of matching entries and search references returned by the server.
        Throws:
        LDAPSearchException - If the search does not complete successfully, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • search

        @NotNull
        public SearchResult search​(@NotNull
                                   java.lang.String baseDN,
                                   @NotNull
                                   SearchScope scope,
                                   @NotNull
                                   Filter filter,
                                   @Nullable
                                   java.lang.String... attributes)
                            throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool. The search result entries and references will be collected internally and included in the SearchResult object that is returned.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references.
        Specified by:
        search in interface LDAPInterface
        Parameters:
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        filter - The filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        A search result object that provides information about the processing of the search, including the set of matching entries and search references returned by the server.
        Throws:
        LDAPSearchException - If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • search

        @NotNull
        public SearchResult search​(@Nullable
                                   SearchResultListener searchResultListener,
                                   @NotNull
                                   java.lang.String baseDN,
                                   @NotNull
                                   SearchScope scope,
                                   @NotNull
                                   java.lang.String filter,
                                   @Nullable
                                   java.lang.String... attributes)
                            throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through the getSearchEntries and getSearchReferences methods).
        Specified by:
        search in interface LDAPInterface
        Parameters:
        searchResultListener - The search result listener that should be used to return results to the client. It may be null if the search results should be collected internally and returned in the SearchResult object.
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        filter - The string representation of the filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
        Throws:
        LDAPSearchException - If the search does not complete successfully, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • search

        @NotNull
        public SearchResult search​(@Nullable
                                   SearchResultListener searchResultListener,
                                   @NotNull
                                   java.lang.String baseDN,
                                   @NotNull
                                   SearchScope scope,
                                   @NotNull
                                   Filter filter,
                                   @Nullable
                                   java.lang.String... attributes)
                            throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through the getSearchEntries and getSearchReferences methods).
        Specified by:
        search in interface LDAPInterface
        Parameters:
        searchResultListener - The search result listener that should be used to return results to the client. It may be null if the search results should be collected internally and returned in the SearchResult object.
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        filter - The filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
        Throws:
        LDAPSearchException - If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • search

        @NotNull
        public SearchResult search​(@NotNull
                                   java.lang.String baseDN,
                                   @NotNull
                                   SearchScope scope,
                                   @NotNull
                                   DereferencePolicy derefPolicy,
                                   int sizeLimit,
                                   int timeLimit,
                                   boolean typesOnly,
                                   @NotNull
                                   java.lang.String filter,
                                   @Nullable
                                   java.lang.String... attributes)
                            throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool. The search result entries and references will be collected internally and included in the SearchResult object that is returned.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references.
        Specified by:
        search in interface LDAPInterface
        Parameters:
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        derefPolicy - The dereference policy the server should use for any aliases encountered while processing the search.
        sizeLimit - The maximum number of entries that the server should return for the search. A value of zero indicates that there should be no limit.
        timeLimit - The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.
        typesOnly - Indicates whether to return only attribute names in matching entries, or both attribute names and values.
        filter - The string representation of the filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        A search result object that provides information about the processing of the search, including the set of matching entries and search references returned by the server.
        Throws:
        LDAPSearchException - If the search does not complete successfully, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • search

        @NotNull
        public SearchResult search​(@NotNull
                                   java.lang.String baseDN,
                                   @NotNull
                                   SearchScope scope,
                                   @NotNull
                                   DereferencePolicy derefPolicy,
                                   int sizeLimit,
                                   int timeLimit,
                                   boolean typesOnly,
                                   @NotNull
                                   Filter filter,
                                   @Nullable
                                   java.lang.String... attributes)
                            throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool. The search result entries and references will be collected internally and included in the SearchResult object that is returned.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references.
        Specified by:
        search in interface LDAPInterface
        Parameters:
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        derefPolicy - The dereference policy the server should use for any aliases encountered while processing the search.
        sizeLimit - The maximum number of entries that the server should return for the search. A value of zero indicates that there should be no limit.
        timeLimit - The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.
        typesOnly - Indicates whether to return only attribute names in matching entries, or both attribute names and values.
        filter - The filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        A search result object that provides information about the processing of the search, including the set of matching entries and search references returned by the server.
        Throws:
        LDAPSearchException - If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • search

        @NotNull
        public SearchResult search​(@Nullable
                                   SearchResultListener searchResultListener,
                                   @NotNull
                                   java.lang.String baseDN,
                                   @NotNull
                                   SearchScope scope,
                                   @NotNull
                                   DereferencePolicy derefPolicy,
                                   int sizeLimit,
                                   int timeLimit,
                                   boolean typesOnly,
                                   @NotNull
                                   java.lang.String filter,
                                   @Nullable
                                   java.lang.String... attributes)
                            throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through the getSearchEntries and getSearchReferences methods).
        Specified by:
        search in interface LDAPInterface
        Parameters:
        searchResultListener - The search result listener that should be used to return results to the client. It may be null if the search results should be collected internally and returned in the SearchResult object.
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        derefPolicy - The dereference policy the server should use for any aliases encountered while processing the search.
        sizeLimit - The maximum number of entries that the server should return for the search. A value of zero indicates that there should be no limit.
        timeLimit - The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.
        typesOnly - Indicates whether to return only attribute names in matching entries, or both attribute names and values.
        filter - The string representation of the filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
        Throws:
        LDAPSearchException - If the search does not complete successfully, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • search

        @NotNull
        public SearchResult search​(@Nullable
                                   SearchResultListener searchResultListener,
                                   @NotNull
                                   java.lang.String baseDN,
                                   @NotNull
                                   SearchScope scope,
                                   @NotNull
                                   DereferencePolicy derefPolicy,
                                   int sizeLimit,
                                   int timeLimit,
                                   boolean typesOnly,
                                   @NotNull
                                   Filter filter,
                                   @Nullable
                                   java.lang.String... attributes)
                            throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through the getSearchEntries and getSearchReferences methods).
        Specified by:
        search in interface LDAPInterface
        Parameters:
        searchResultListener - The search result listener that should be used to return results to the client. It may be null if the search results should be collected internally and returned in the SearchResult object.
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        derefPolicy - The dereference policy the server should use for any aliases encountered while processing the search.
        sizeLimit - The maximum number of entries that the server should return for the search. A value of zero indicates that there should be no limit.
        timeLimit - The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.
        typesOnly - Indicates whether to return only attribute names in matching entries, or both attribute names and values.
        filter - The filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
        Throws:
        LDAPSearchException - If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • search

        @NotNull
        public SearchResult search​(@NotNull
                                   SearchRequest searchRequest)
                            throws LDAPSearchException
        Processes the provided search request using a read connection from this connection pool.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through the getSearchEntries and getSearchReferences methods).
        Specified by:
        search in interface LDAPInterface
        Parameters:
        searchRequest - The search request to be processed. It must not be null.
        Returns:
        A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
        Throws:
        LDAPSearchException - If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • search

        @NotNull
        public SearchResult search​(@NotNull
                                   ReadOnlySearchRequest searchRequest)
                            throws LDAPSearchException
        Processes the provided search request using a read connection from this connection pool.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references (although if a search result listener was provided, then it will have been used to make any entries and references available, and they will not be available through the getSearchEntries and getSearchReferences methods).
        Specified by:
        search in interface LDAPInterface
        Parameters:
        searchRequest - The search request to be processed. It must not be null.
        Returns:
        A search result object that provides information about the processing of the search, potentially including the set of matching entries and search references returned by the server.
        Throws:
        LDAPSearchException - If the search does not complete successfully, or if a problem is encountered while sending the request or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • searchForEntry

        @Nullable
        public SearchResultEntry searchForEntry​(@NotNull
                                                java.lang.String baseDN,
                                                @NotNull
                                                SearchScope scope,
                                                @NotNull
                                                java.lang.String filter,
                                                @Nullable
                                                java.lang.String... attributes)
                                         throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references.
        Specified by:
        searchForEntry in interface LDAPInterface
        Parameters:
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        filter - The string representation of the filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        The entry that was returned from the search, or null if no entry was returned or the base entry does not exist.
        Throws:
        LDAPSearchException - If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • searchForEntry

        @Nullable
        public SearchResultEntry searchForEntry​(@NotNull
                                                java.lang.String baseDN,
                                                @NotNull
                                                SearchScope scope,
                                                @NotNull
                                                Filter filter,
                                                @Nullable
                                                java.lang.String... attributes)
                                         throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references.
        Specified by:
        searchForEntry in interface LDAPInterface
        Parameters:
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        filter - The string representation of the filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        The entry that was returned from the search, or null if no entry was returned or the base entry does not exist.
        Throws:
        LDAPSearchException - If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • searchForEntry

        @Nullable
        public SearchResultEntry searchForEntry​(@NotNull
                                                java.lang.String baseDN,
                                                @NotNull
                                                SearchScope scope,
                                                @NotNull
                                                DereferencePolicy derefPolicy,
                                                int timeLimit,
                                                boolean typesOnly,
                                                @NotNull
                                                java.lang.String filter,
                                                @Nullable
                                                java.lang.String... attributes)
                                         throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references.
        Specified by:
        searchForEntry in interface LDAPInterface
        Parameters:
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        derefPolicy - The dereference policy the server should use for any aliases encountered while processing the search.
        timeLimit - The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.
        typesOnly - Indicates whether to return only attribute names in matching entries, or both attribute names and values.
        filter - The string representation of the filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        The entry that was returned from the search, or null if no entry was returned or the base entry does not exist.
        Throws:
        LDAPSearchException - If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • searchForEntry

        @Nullable
        public SearchResultEntry searchForEntry​(@NotNull
                                                java.lang.String baseDN,
                                                @NotNull
                                                SearchScope scope,
                                                @NotNull
                                                DereferencePolicy derefPolicy,
                                                int timeLimit,
                                                boolean typesOnly,
                                                @NotNull
                                                Filter filter,
                                                @Nullable
                                                java.lang.String... attributes)
                                         throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references.
        Specified by:
        searchForEntry in interface LDAPInterface
        Parameters:
        baseDN - The base DN for the search request. It must not be null.
        scope - The scope that specifies the range of entries that should be examined for the search.
        derefPolicy - The dereference policy the server should use for any aliases encountered while processing the search.
        timeLimit - The maximum length of time in seconds that the server should spend processing this search request. A value of zero indicates that there should be no limit.
        typesOnly - Indicates whether to return only attribute names in matching entries, or both attribute names and values.
        filter - The filter to use to identify matching entries. It must not be null.
        attributes - The set of attributes that should be returned in matching entries. It may be null or empty if the default attribute set (all user attributes) is to be requested.
        Returns:
        The entry that was returned from the search, or null if no entry was returned or the base entry does not exist.
        Throws:
        LDAPSearchException - If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • searchForEntry

        @Nullable
        public SearchResultEntry searchForEntry​(@NotNull
                                                SearchRequest searchRequest)
                                         throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references.
        Specified by:
        searchForEntry in interface LDAPInterface
        Parameters:
        searchRequest - The search request to be processed. If it is configured with a search result listener or a size limit other than one, then the provided request will be duplicated with the appropriate settings.
        Returns:
        The entry that was returned from the search, or null if no entry was returned or the base entry does not exist.
        Throws:
        LDAPSearchException - If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • searchForEntry

        @Nullable
        public SearchResultEntry searchForEntry​(@NotNull
                                                ReadOnlySearchRequest searchRequest)
                                         throws LDAPSearchException
        Processes a search operation with the provided information using a read connection from this connection pool. It is expected that at most one entry will be returned from the search, and that no additional content from the successful search result (e.g., diagnostic message or response controls) are needed.

        Note that if the search does not complete successfully, an LDAPSearchException will be thrown In some cases, one or more search result entries or references may have been returned before the failure response is received. In this case, the LDAPSearchException methods like getEntryCount, getSearchEntries, getReferenceCount, and getSearchReferences may be used to obtain information about those entries and references.
        Specified by:
        searchForEntry in interface LDAPInterface
        Parameters:
        searchRequest - The search request to be processed. If it is configured with a search result listener or a size limit other than one, then the provided request will be duplicated with the appropriate settings.
        Returns:
        The entry that was returned from the search, or null if no entry was returned or the base entry does not exist.
        Throws:
        LDAPSearchException - If the search does not complete successfully, if more than a single entry is returned, or if a problem is encountered while parsing the provided filter string, sending the request, or reading the response. If one or more entries or references were returned before the failure was encountered, then the LDAPSearchException object may be examined to obtain information about those entries and/or references.
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Closes this connection pool in the event that it becomes unreferenced.
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable - If an unexpected problem occurs.