Interface LdapClient

  • All Superinterfaces:
    AutoCloseable, Closeable
    All Known Subinterfaces:
    ConnectionPool

    public interface LdapClient
    extends Closeable
    An LDAP client provides an interface for obtaining a connection to a Directory Server. LDAP clients can wrap other LDAP clients in order to provide enhanced capabilities in a manner which is transparent to the application. For example:
    • Connection pooling
    • Load balancing
    • Keep alive
    • Transactional connections
    • Connections to LDIF files
    • Data transformations
    • Logging connections
    • Read-only connections
    • Pre-authenticated connections
    • Recording connections, with primitive roll-back functionality
    An application typically obtains a socket from an LDAP client, performs one or more operations, and then closes the socket. Applications should aim to close sockets as soon as possible in order to avoid resource contention.

    LDAP clients can be created using constructors provided by the LdapClients class.

    See Also:
    LdapClients.newLdapClient(String, int), LdapClients
    • Method Detail

      • connect

        Single<LdapClientSocket> connect()
        Returns a Single which connects to a peer each time it is subscribed.
        Returns:
        A Single which connects to a peer each time it is subscribed.
      • close

        void close()
        Releases any resources associated with this LDAP client. Depending on the implementation an LDAP client may:
        • do nothing
        • close underlying LDAP clients (e.g. load-balancers)
        • close pooled connections (e.g. connection pools)
        • shutdown IO event service and related thread pools.
        Calling close on an LDAP client which is already closed has no effect.

        Applications should avoid closing LDAP clients while there are remaining active sockets in use or connection attempts in progress.

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable