Class AbstractLdapConnection

java.lang.Object
org.apache.mina.core.service.IoHandlerAdapter
org.apache.directory.ldap.client.api.AbstractLdapConnection
All Implemented Interfaces:
Closeable, AutoCloseable, LdapConnection, org.apache.mina.core.service.IoHandler
Direct Known Subclasses:
LdapNetworkConnection

public abstract class AbstractLdapConnection extends org.apache.mina.core.service.IoHandlerAdapter implements LdapConnection
An abstract LdapConnection class gathering the common behavior of LdapConnection concrete classes.
Author:
Apache Directory Project
  • Field Details

    • schemaManager

      protected org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager
      the schema manager
    • messageId

      protected AtomicInteger messageId
      A Message ID which is incremented for each operation
    • codec

      protected org.apache.directory.api.ldap.codec.api.LdapApiService codec
      the ldap codec service
  • Constructor Details

    • AbstractLdapConnection

      protected AbstractLdapConnection()
      Creates a new instance of an AbstractLdapConnection
    • AbstractLdapConnection

      protected AbstractLdapConnection(org.apache.directory.api.ldap.codec.api.LdapApiService codec)
      Creates a new instance of and AbstractLdapConnection.java, with a LdapApiService instance/
      Parameters:
      codec - The LdapApiService instance to use
  • Method Details

    • bind

      public void bind(org.apache.directory.api.ldap.model.name.Dn name) throws org.apache.directory.api.ldap.model.exception.LdapException
      Unauthenticated authentication bind on a server.
      Specified by:
      bind in interface LdapConnection
      Parameters:
      name - The name used to authenticate the user.
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - if some error occurred
    • bind

      public void bind(String name) throws org.apache.directory.api.ldap.model.exception.LdapException
      Unauthenticated authentication bind on a server.
      Specified by:
      bind in interface LdapConnection
      Parameters:
      name - The name used to authenticate the user. It must be a valid distinguished name.
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - if some error occurred
    • bind

      public void bind(String name, String credentials) throws org.apache.directory.api.ldap.model.exception.LdapException
      Simple bind on a server.
      Specified by:
      bind in interface LdapConnection
      Parameters:
      name - The name used to authenticate the user. It must be a valid distinguished name.
      credentials - The password, it can't be null
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - if some error occurred
    • bind

      public void bind(org.apache.directory.api.ldap.model.name.Dn name, String credentials) throws org.apache.directory.api.ldap.model.exception.LdapException
      Simple bind on a server.
      Specified by:
      bind in interface LdapConnection
      Parameters:
      name - The name used to authenticate the user.
      credentials - The password, it can't be null
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - if some error occurred
    • createBindRequest

      protected org.apache.directory.api.ldap.model.message.BindRequest createBindRequest(String name, byte[] credentials, String saslMechanism, org.apache.directory.api.ldap.model.message.Control... controls)
      Create a complete BindRequest ready to be sent.
      Parameters:
      name - The DN to bind with
      credentials - The user's password
      saslMechanism - The SASL mechanism to use
      controls - The controls to send
      Returns:
      The created BindRequest