Package org.ldaptive

Interface Connection

    • Method Detail

      • getConnectionConfig

        ConnectionConfig getConnectionConfig()
        Returns the connection config for this connection. The config may be read-only.
        Returns:
        connection config
      • open

        Response<Void> open​(BindRequest request)
                     throws LdapException
        This will establish a connection to the LDAP using the supplied bind request. This connection should be closed using close().
        Parameters:
        request - containing bind information
        Returns:
        response associated with the bind operation
        Throws:
        IllegalStateException - if the connection is already open
        LdapException - if the LDAP cannot be reached
      • isOpen

        boolean isOpen()
        Returns whether open(BindRequest) was successfully invoked on this connection and close() has not been invoked. This method does not indicate the viability of this connection for use.
        Returns:
        whether this connection is open
      • getProviderConnection

        ProviderConnection getProviderConnection()
        Returns the provider connection to invoke the provider specific implementation. Must be called after a successful call to open().
        Returns:
        provider connection
      • close

        void close()
        This will close the connection to the LDAP.
        Specified by:
        close in interface AutoCloseable
      • close

        void close​(RequestControl[] controls)
        This will close the connection to the LDAP using the supplied controls.
        Parameters:
        controls - request controls
      • reopen

        Response<Void> reopen()
                       throws LdapException
        This will close an existing connection to the LDAP and establish a new connection to the LDAP.
        Returns:
        response associated with the ConnectionInitializer or an empty response if no connection initializer was configured
        Throws:
        LdapException - if the LDAP cannot be reached
      • reopen

        Response<Void> reopen​(BindRequest request)
                       throws LdapException
        This will close an existing connection to the LDAP and establish a new connection to the LDAP using the supplied bind request.
        Parameters:
        request - containing bind information
        Returns:
        response associated with the bind operation
        Throws:
        LdapException - if the LDAP cannot be reached