Interface FullLDAPInterface

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable, LDAPInterface
    All Known Implementing Classes:
    AbstractConnectionPool, InMemoryDirectoryServer, LDAPConnection, LDAPConnectionPool, LDAPThreadLocalConnectionPool, MockableLDAPConnection

    @NotExtensible
    @ThreadSafety(level=INTERFACE_NOT_THREADSAFE)
    public interface FullLDAPInterface
    extends LDAPInterface, java.io.Closeable
    This interface defines a set of methods that are available for objects that may be used to communicate with an LDAP directory server (or something that simulates an LDAP directory server). This can be used to facilitate development of methods which can be used for either a single LDAP connection or an LDAP pool. This interface extends the basic LDAPInterface interface to also include support for bind and extended operations, although those operations should be used with care because they may alter the state of the associated connection (or connection-like object), and in some cases (like a connection pool with multiple connections, where it may not be possible to guarantee that successive operations are processed on the same underlying connection), this may result in unexpected behavior.

    This interface also extends the Closeable interface so that the underlying connection (or connection-like object) may be closed. After it has been closed, no attempt should be made to re-use the object to perform LDAP (or LDAP-like) communication.
    • Method Detail

      • close

        void close()
        Closes the associated interface and frees any resources associated with it. This method may be safely called multiple times, but the associated interface should not be used after it has been closed.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • bind

        @NotNull
        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.
        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
        BindResult bind​(@NotNull
                        BindRequest bindRequest)
                 throws LDAPException
        Processes the provided bind request.
        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.
      • processExtendedOperation

        @NotNull
        ExtendedResult processExtendedOperation​(@NotNull
                                                java.lang.String requestOID)
                                         throws LDAPException
        Processes an extended operation with the provided request OID and no value.
        Parameters:
        requestOID - The OID for the extended request to process. It must not be null.
        Returns:
        The extended result object that provides information about the result of the request processing.
        Throws:
        LDAPException - If a problem occurs while sending the request or reading the response.
      • processExtendedOperation

        @NotNull
        ExtendedResult processExtendedOperation​(@NotNull
                                                java.lang.String requestOID,
                                                @Nullable
                                                ASN1OctetString requestValue)
                                         throws LDAPException
        Processes an extended operation with the provided request OID and value.
        Parameters:
        requestOID - The OID for the extended request to process. It must not be null.
        requestValue - The encoded value for the extended request to process. It may be null if there does not need to be a value for the requested operation.
        Returns:
        The extended result object that provides information about the result of the request processing.
        Throws:
        LDAPException - If a problem occurs while sending the request or reading the response.