Interface LDAPConnectionInfo

All Known Implementing Classes:
LDAPConnection

This interface defines a number of methods that may be used to obtain information about an LDAP connection. This should be treated as a read-only interface, and when a connection is used in the context of this interface, no processing should be performed that would alter any state.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Retrieves the number of outstanding operations on this LDAP connection (i.e., the number of operations currently in progress).
    Retrieves the address of the directory server to which this connection is currently established.
    Retrieves an InetAddress object that represents the address of the server to which this connection is currently established.
    Retrieves the string representation of the IP address to which this connection is currently established.
    int
    Retrieves the port of the directory server to which this connection is currently established.
    long
    Retrieves a value that uniquely identifies this connection within the JVM Each LDAPConnection object will be assigned a different connection ID, and that connection ID will not change over the life of the object, even if the connection is closed and re-established (whether re-established to the same server or a different server).
    Retrieves the user-friendly name that has been assigned to this connection.
    Retrieves the user-friendly name that has been assigned to the connection pool with which this connection is associated.
    Retrieves the connection statistics for this LDAP connection.
    Retrieves a stack trace of the thread that last attempted to establish this connection.
    long
    Retrieves the time that this connection was established in the number of milliseconds since January 1, 1970 UTC (the same format used by System.currentTimeMillis.
    Retrieves the disconnect cause for this connection, which is an exception or error that triggered the connection termination, if available.
    Retrieves the disconnect message for this connection, which may provide additional information about the reason for the disconnect, if available.
    Retrieves the disconnect type for this connection, if available.
    Retrieves a string representation of the host and port for the server to to which the last connection attempt was made.
    Retrieves the last successful bind request processed on this connection.
    long
    Retrieves the time that this connection was last used to send or receive an LDAP message.
    Retrieves the socket factory that was used when creating the socket for the last connection attempt (whether successful or unsuccessful) for this LDAP connection.
    Retrieves the socket factory to use to create the socket for subsequent connection attempts.
    Retrieves the SSLSession currently being used to secure communication on this connection.
    Retrieves the StartTLS request used to secure this connection.
    boolean
    Indicates whether this connection is currently established.
    boolean
    Indicates whether this connection is operating in synchronous mode.
    Retrieves a string representation of this LDAP connection.
    void
    Appends a string representation of this LDAP connection to the provided buffer.
  • Method Details

    • isConnected

      boolean isConnected()
      Indicates whether this connection is currently established.
      Returns:
      true if this connection is currently established, or false if it is not.
    • getLastUsedSocketFactory

      Retrieves the socket factory that was used when creating the socket for the last connection attempt (whether successful or unsuccessful) for this LDAP connection.
      Returns:
      The socket factory that was used when creating the socket for the last connection attempt for this LDAP connection, or null if no attempt has yet been made to establish this connection.
    • getSocketFactory

      Retrieves the socket factory to use to create the socket for subsequent connection attempts. This may or may not be the socket factory that was used to create the current established connection.
      Returns:
      The socket factory to use to create the socket for subsequent connection attempts.
    • getSSLSession

      Retrieves the SSLSession currently being used to secure communication on this connection. This may be available for connections that were secured at the time they were created (via an SSLSocketFactory), or for connections secured after their creation (via the StartTLS extended operation). This will not be available for unencrypted connections, or connections secured in other ways (e.g., via SASL QoP).
      Returns:
      The SSLSession currently being used to secure communication on this connection, or null if no SSLSession is available.
    • getConnectionID

      Retrieves a value that uniquely identifies this connection within the JVM Each LDAPConnection object will be assigned a different connection ID, and that connection ID will not change over the life of the object, even if the connection is closed and re-established (whether re-established to the same server or a different server).
      Returns:
      A value that uniquely identifies this connection within the JVM.
    • getConnectionName

      Retrieves the user-friendly name that has been assigned to this connection.
      Returns:
      The user-friendly name that has been assigned to this connection, or null if none has been assigned.
    • getConnectionPoolName

      Retrieves the user-friendly name that has been assigned to the connection pool with which this connection is associated.
      Returns:
      The user-friendly name that has been assigned to the connection pool with which this connection is associated, or null if none has been assigned or this connection is not associated with a connection pool.
    • getHostPort

      Retrieves a string representation of the host and port for the server to to which the last connection attempt was made. It does not matter whether the connection attempt was successful, nor does it matter whether it is still established. This is primarily intended for internal use in error messages.
      Returns:
      A string representation of the host and port for the server to which the last connection attempt was made, or an empty string if no connection attempt has yet been made on this connection.
    • getConnectedAddress

      Retrieves the address of the directory server to which this connection is currently established.
      Returns:
      The address of the directory server to which this connection is currently established, or null if the connection is not established.
    • getConnectedIPAddress

      Retrieves the string representation of the IP address to which this connection is currently established.
      Returns:
      The string representation of the IP address to which this connection is currently established, or null if the connection is not established.
    • getConnectedInetAddress

      Retrieves an InetAddress object that represents the address of the server to which this connection is currently established.
      Returns:
      An InetAddress that represents the address of the server to which this connection is currently established, or null if the connection is not established.
    • getConnectedPort

      Retrieves the port of the directory server to which this connection is currently established.
      Returns:
      The port of the directory server to which this connection is currently established, or -1 if the connection is not established.
    • getConnectStackTrace

      Retrieves a stack trace of the thread that last attempted to establish this connection. Note that this will only be available if an attempt has been made to establish this connection and the LDAPConnectionOptions.captureConnectStackTrace() method for the associated connection options returns true.
      Returns:
      A stack trace of the thread that last attempted to establish this connection, or null connect stack traces are not enabled, or if no attempt has been made to establish this connection.
    • getDisconnectType

      Retrieves the disconnect type for this connection, if available.
      Returns:
      The disconnect type for this connection, or null if no disconnect type has been set.
    • getDisconnectMessage

      Retrieves the disconnect message for this connection, which may provide additional information about the reason for the disconnect, if available.
      Returns:
      The disconnect message for this connection, or null if no disconnect message has been set.
    • getDisconnectCause

      Retrieves the disconnect cause for this connection, which is an exception or error that triggered the connection termination, if available.
      Returns:
      The disconnect cause for this connection, or null if no disconnect cause has been set.
    • getLastBindRequest

      Retrieves the last successful bind request processed on this connection.
      Returns:
      The last successful bind request processed on this connection. It may be null if no bind has been performed, or if the last bind attempt was not successful.
    • getStartTLSRequest

      Retrieves the StartTLS request used to secure this connection.
      Returns:
      The StartTLS request used to secure this connection, or null if StartTLS has not been used to secure this connection.
    • synchronousMode

      boolean synchronousMode()
      Indicates whether this connection is operating in synchronous mode.
      Returns:
      true if this connection is operating in synchronous mode, or false if not.
    • getConnectTime

      Retrieves the time that this connection was established in the number of milliseconds since January 1, 1970 UTC (the same format used by System.currentTimeMillis.
      Returns:
      The time that this connection was established, or -1 if the connection is not currently established.
    • getLastCommunicationTime

      Retrieves the time that this connection was last used to send or receive an LDAP message. The value will represent the number of milliseconds since January 1, 1970 UTC (the same format used by System.currentTimeMillis.
      Returns:
      The time that this connection was last used to send or receive an LDAP message. If the connection is not established, then -1 will be returned. If the connection is established but no communication has been performed over the connection since it was established, then the value of getConnectTime() will be returned.
    • getConnectionStatistics

      Retrieves the connection statistics for this LDAP connection.
      Returns:
      The connection statistics for this LDAP connection.
    • getActiveOperationCount

      Retrieves the number of outstanding operations on this LDAP connection (i.e., the number of operations currently in progress). The value will only be valid for connections not configured to use synchronous mode.
      Returns:
      The number of outstanding operations on this LDAP connection, or -1 if it cannot be determined (e.g., because the connection is not established or is operating in synchronous mode).
    • toString

      Retrieves a string representation of this LDAP connection.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this LDAP connection.
    • toString

      Appends a string representation of this LDAP connection to the provided buffer.
      Parameters:
      buffer - The buffer to which to append a string representation of this LDAP connection.