Interface ConnectionHandler

    • Method Detail

      • getConnectionRetryExceptions

        java.lang.Class<?>[] getConnectionRetryExceptions()
        This returns the exception types to retry connections on.
        Returns:
        Class[]
      • setConnectionRetryExceptions

        void setConnectionRetryExceptions​(java.lang.Class<?>[] exceptions)
        This sets the exception types to retry connections on.
        Parameters:
        exceptions - Class[]
      • getLdapConfig

        LdapConfig getLdapConfig()
        Returns the ldap configuration.
        Returns:
        ldap config
      • setLdapConfig

        void setLdapConfig​(LdapConfig lc)
        Sets the ldap configuration.
        Parameters:
        lc - ldap config
      • connect

        void connect​(java.lang.String dn,
                     java.lang.Object credential)
              throws javax.naming.NamingException
        Open a connection to an LDAP.
        Parameters:
        dn - to attempt bind with
        credential - to attempt bind with
        Throws:
        javax.naming.NamingException - if an LDAP error occurs
      • isConnected

        boolean isConnected()
        Returns whether the underlying context has been established.
        Returns:
        whether a connection has been made
      • getLdapContext

        javax.naming.ldap.LdapContext getLdapContext()
                                              throws javax.naming.NamingException
        Returns an ldap context to use for ldap operations. connect(String, Object) must be called prior to invoking this.
        Returns:
        ldap context
        Throws:
        javax.naming.NamingException - if an LDAP error occurs
      • close

        void close()
            throws javax.naming.NamingException
        Close a connection to an LDAP.
        Throws:
        javax.naming.NamingException - if an LDAP error occurs
      • newInstance

        ConnectionHandler newInstance()
        Returns a separate instance of this connection handler with the same underlying ldap configuration.
        Returns:
        connection handler