java.lang.Object
org.elasticsearch.xpack.security.authc.ldap.support.LdapSession
All Implemented Interfaces:
Closeable, AutoCloseable, Releasable

public class LdapSession extends Object implements Releasable
Represents a LDAP connection with an authenticated/bound user that needs closing.
  • Field Details

    • logger

      protected final org.apache.logging.log4j.Logger logger
    • realm

      protected final RealmConfig realm
    • connection

      protected final com.unboundid.ldap.sdk.LDAPInterface connection
    • userDn

      protected final String userDn
    • groupsResolver

      protected final LdapSession.GroupsResolver groupsResolver
    • timeout

      protected final TimeValue timeout
    • attributes

      protected final Collection<com.unboundid.ldap.sdk.Attribute> attributes
  • Constructor Details

    • LdapSession

      public LdapSession(org.apache.logging.log4j.Logger logger, RealmConfig realm, com.unboundid.ldap.sdk.LDAPInterface connection, String userDn, LdapSession.GroupsResolver groupsResolver, LdapMetadataResolver metadataResolver, TimeValue timeout, Collection<com.unboundid.ldap.sdk.Attribute> attributes)
      This object is intended to be constructed by the LdapConnectionFactory This constructor accepts a logger with which the connection can log. Since this connection can be instantiated very frequently, it's best to have the logger for this connection created outside of and be reused across all connections. We can't keep a static logger in this class since we want the logger to be contextual (i.e. aware of the settings and its environment).
  • Method Details