Package org.ldaptive

Class BindConnectionInitializer

  • All Implemented Interfaces:
    ConnectionInitializer

    public class BindConnectionInitializer
    extends Object
    implements ConnectionInitializer
    Initializes a connection by performing a bind operation. Useful if you need all connections to bind as the same principal.
    • Field Detail

      • logger

        protected final Logger logger
        Logger for this class.
      • bindDn

        private String bindDn
        DN to bind as before performing operations.
      • bindCredential

        private Credential bindCredential
        Credential for the bind DN.
      • bindSaslConfig

        private SaslConfig bindSaslConfig
        Configuration for bind SASL authentication.
    • Constructor Detail

      • BindConnectionInitializer

        public BindConnectionInitializer()
        Default constructor.
      • BindConnectionInitializer

        public BindConnectionInitializer​(String dn,
                                         String credential)
        Creates a new bind connection initializer.
        Parameters:
        dn - bind dn
        credential - bind credential
      • BindConnectionInitializer

        public BindConnectionInitializer​(String dn,
                                         Credential credential)
        Creates a new bind connection initializer.
        Parameters:
        dn - bind dn
        credential - bind credential
    • Method Detail

      • getBindDn

        public String getBindDn()
        Returns the bind DN.
        Returns:
        DN to bind as
      • setBindDn

        public void setBindDn​(String dn)
        Sets the bind DN to authenticate as before performing operations.
        Parameters:
        dn - to bind as
      • getBindCredential

        public Credential getBindCredential()
        Returns the credential used with the bind DN.
        Returns:
        bind DN credential
      • setBindCredential

        public void setBindCredential​(Credential credential)
        Sets the credential of the bind DN.
        Parameters:
        credential - to use with bind DN
      • getBindSaslConfig

        public SaslConfig getBindSaslConfig()
        Returns the bind sasl config.
        Returns:
        sasl config
      • setBindSaslConfig

        public void setBindSaslConfig​(SaslConfig config)
        Sets the bind sasl config.
        Parameters:
        config - sasl config
      • getBindControls

        public RequestControl[] getBindControls()
        Returns the bind controls.
        Returns:
        controls
      • setBindControls

        public void setBindControls​(RequestControl... cntrls)
        Sets the bind controls.
        Parameters:
        cntrls - controls to set
      • isEmpty

        public boolean isEmpty()
        Returns whether this connection initializer contains any configuration data.
        Returns:
        whether all properties are null