Interface LdapClient

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
org.forgerock.openam.ldap.ConnectionFactoryFactoryImpl.FailoverLdapClient, ConnectionPool, LDAPUtils.FailoverLdapClient

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:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Releases any resources associated with this LDAP client.
    io.reactivex.rxjava3.core.Single<LdapClientSocket>
    Returns a Single which connects to a peer each time it is subscribed.
  • Method Details

    • connect

      io.reactivex.rxjava3.core.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