Class LdapAuthInfo

  • All Implemented Interfaces:
    ILdapAuthInfo

    public class LdapAuthInfo
    extends java.lang.Object
    implements ILdapAuthInfo
    class for reading ldap authentication info from config store
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
      • mType

        protected int mType
    • Constructor Detail

      • LdapAuthInfo

        public LdapAuthInfo()
        must call init(config) after this constructor.
    • Method Detail

      • getPasswordFromStore

        public java.lang.String getPasswordFromStore​(java.lang.String prompt)
                                              throws EBaseException
        Throws:
        EBaseException
      • init

        public void init​(IConfigStore config)
                  throws EBaseException
        initialize this class from the config store.
        Specified by:
        init in interface ILdapAuthInfo
        Parameters:
        config - The config store from which to initialize.
        Throws:
        EBaseException - Due to failure of the initialization process.
      • init

        public void init​(IConfigStore config,
                         java.lang.String host,
                         int port,
                         boolean secure)
                  throws EBaseException
        initialize this class from the config store, and verify the password.
        Specified by:
        init in interface ILdapAuthInfo
        Parameters:
        host - The host that the directory server is running on. This will be used to verify the password by attempting to connect. If it is null, the password will not be verified.
        port - The port that the directory server is running on.
        config - The config store from which to initialize.
        Throws:
        EBaseException - Due to failure of the initialization process.
      • reset

        public void reset()
        Description copied from interface: ILdapAuthInfo
        Reset the connection to the host
        Specified by:
        reset in interface ILdapAuthInfo
      • getAuthType

        public int getAuthType()
        get authentication type.
        Specified by:
        getAuthType in interface ILdapAuthInfo
        Returns:
        one of:
        LdapAuthInfo.LDAP_AUTHTYPE_BASICAUTH or LdapAuthInfo.LDAP_AUTHTYPE_SSLCLIENTAUTH
      • setPasswordStore

        public void setPasswordStore​(IPasswordStore passwordStore)
      • addPassword

        public void addPassword​(java.lang.String prompt,
                                java.lang.String pw)
        Description copied from interface: ILdapAuthInfo
        Add password to private password data structure.
        Specified by:
        addPassword in interface ILdapAuthInfo
        Parameters:
        prompt - Password prompt.
        pw - Password itself.
      • removePassword

        public void removePassword​(java.lang.String prompt)
        Description copied from interface: ILdapAuthInfo
        Remove password from private password data structure.
        Specified by:
        removePassword in interface ILdapAuthInfo
        Parameters:
        prompt - Identify password to remove with prompt.