Class LDAPProfile

java.lang.Object
com.isode.dsapi.util.cfg.LDAPProfile

public class LDAPProfile extends Object
Collects LDAP and SASL related configuration specifying directory location bind credentials and provides directory session.

Works with DataNode configuration sources.

Since:
15.2
Author:
mst
  • Constructor Details

    • LDAPProfile

      public LDAPProfile(com.isode.util.data.DataReaderTrackingListener readerListener)
      Constructs an LDAPProfile.
      Parameters:
      readerListener - which can be used to log configuration changes and to decrypt/decode some values (not null)
  • Method Details

    • configure

      public void configure(com.isode.util.data.DataNode ldapConfigNode) throws com.isode.util.data.DataException, LDAPProfileException
      Read configuration from DataNode.
      Parameters:
      ldapConfigNode - configuration node (null allowed - than all settings will be default)
      Throws:
      com.isode.util.data.DataException - on data access/reading problems
      LDAPProfileException - on bad configuration values
    • open

      public void open() throws DSAPIException, LDAPProfileException
      Tries to open LDAP connection, reads SASL configuration.

      (configure(DataNode) must be called first)

      Throws:
      DSAPIException - on bind problems (should be handled by retrying after a while)
      LDAPProfileException - on configuration problems (should be handled by waiting for configuration change and retry)
    • close

      public void close()
      Unbind and releases directory session (if bound)
    • getDS

      public DirectorySession getDS()
      Returns current directory session.
      Returns:
      current directory session (may be null)
    • getSaslConfiguration

      public SaslConfiguration getSaslConfiguration()
      Returns current SASL configuration. (Should be called after open() which initialises it)
      Returns:
      current SASL configuration (may be null before opening)
    • getSaslMapping

      public SaslMapping getSaslMapping()
      Returns current SASL mapping. (Should be called after open() which initialises it)
      Returns:
      current SASL mapping (may be null before opening)
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable