Class MonitoringLdapConnection

java.lang.Object
org.apache.directory.ldap.client.api.LdapConnectionWrapper
org.apache.directory.ldap.client.api.MonitoringLdapConnection
All Implemented Interfaces:
Closeable, AutoCloseable, LdapConnection, Wrapper<LdapConnection>

public final class MonitoringLdapConnection extends LdapConnectionWrapper
A class used to monitor the use of a LdapConnection
Author:
Apache Directory Project
  • Method Details

    • bindCalled

      public boolean bindCalled()
      Tells if a Bind has been issued
      Returns:
      true if a Bind has been issued
    • resetMonitors

      public void resetMonitors()
      Reset the Bind and StartTLS flags
    • startTlsCalled

      public boolean startTlsCalled()
      Tells if the StarTLS extended operation has been called
      Returns:
      true if the StarTLS extended operation has been called
    • bind

      public void bind() throws org.apache.directory.api.ldap.model.exception.LdapException
      Bind on a server, using the LdapConnectionConfig information of this connection.
      Specified by:
      bind in interface LdapConnection
      Overrides:
      bind in class LdapConnectionWrapper
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - if some error occurred
    • anonymousBind

      public void anonymousBind() throws org.apache.directory.api.ldap.model.exception.LdapException
      Anonymous bind on a server.
      Specified by:
      anonymousBind in interface LdapConnection
      Overrides:
      anonymousBind in class LdapConnectionWrapper
      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
      Overrides:
      bind in class LdapConnectionWrapper
      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
      Overrides:
      bind in class LdapConnectionWrapper
      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) throws org.apache.directory.api.ldap.model.exception.LdapException
      Unauthenticated authentication bind on a server.
      Specified by:
      bind in interface LdapConnection
      Overrides:
      bind in class LdapConnectionWrapper
      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(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
      Overrides:
      bind in class LdapConnectionWrapper
      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
    • bind

      public org.apache.directory.api.ldap.model.message.BindResponse bind(org.apache.directory.api.ldap.model.message.BindRequest bindRequest) throws org.apache.directory.api.ldap.model.exception.LdapException
      Bind to the server using a bind request object.
      Specified by:
      bind in interface LdapConnection
      Overrides:
      bind in class LdapConnectionWrapper
      Parameters:
      bindRequest - The bind request object containing all the needed parameters
      Returns:
      A BindResponse containing the result
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - if some error occurred
    • extended

      public org.apache.directory.api.ldap.model.message.ExtendedResponse extended(String oid) throws org.apache.directory.api.ldap.model.exception.LdapException
      Sends a extended operation request to the server with the given OID and no value.
      Specified by:
      extended in interface LdapConnection
      Overrides:
      extended in class LdapConnectionWrapper
      Parameters:
      oid - the object identifier of the extended operation
      Returns:
      extended operation's response
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - if some error occurred
      See Also:
    • extended

      public org.apache.directory.api.ldap.model.message.ExtendedResponse extended(String oid, byte[] value) throws org.apache.directory.api.ldap.model.exception.LdapException
      Sends a extended operation request to the server with the given OID and value.
      Specified by:
      extended in interface LdapConnection
      Overrides:
      extended in class LdapConnectionWrapper
      Parameters:
      oid - the object identifier of the extended operation
      value - value to be used by the extended operation, can be a null value
      Returns:
      extended operation's response
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - if some error occurred
      See Also:
    • extended

      public org.apache.directory.api.ldap.model.message.ExtendedResponse extended(org.apache.directory.api.asn1.util.Oid oid) throws org.apache.directory.api.ldap.model.exception.LdapException
      Sends a extended operation request to the server with the given OID and no value.
      Specified by:
      extended in interface LdapConnection
      Overrides:
      extended in class LdapConnectionWrapper
      Parameters:
      oid - the object identifier of the extended operation
      Returns:
      extended operation's response
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - if some error occurred
      See Also:
    • extended

      public org.apache.directory.api.ldap.model.message.ExtendedResponse extended(org.apache.directory.api.asn1.util.Oid oid, byte[] value) throws org.apache.directory.api.ldap.model.exception.LdapException
      Sends a extended operation request to the server with the given OID and value.
      Specified by:
      extended in interface LdapConnection
      Overrides:
      extended in class LdapConnectionWrapper
      Parameters:
      oid - the object identifier of the extended operation
      value - value to be used by the extended operation, can be a null value
      Returns:
      extended operation's response
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - if some error occurred
    • extended

      public org.apache.directory.api.ldap.model.message.ExtendedResponse extended(org.apache.directory.api.ldap.model.message.ExtendedRequest extendedRequest) throws org.apache.directory.api.ldap.model.exception.LdapException
      Performs an extended operation based on the extended request object.
      Specified by:
      extended in interface LdapConnection
      Overrides:
      extended in class LdapConnectionWrapper
      Parameters:
      extendedRequest - the extended operation's request
      Returns:
      Extended operation's response
      Throws:
      org.apache.directory.api.ldap.model.exception.LdapException - if the extended operation failed