Enum DisconnectType

java.lang.Object
java.lang.Enum<DisconnectType>
com.unboundid.ldap.sdk.DisconnectType
All Implemented Interfaces:
Serializable, Comparable<DisconnectType>, java.lang.constant.Constable

This enum defines a set of disconnect types that may be used to provide general information about the reason that an LDAPConnection was disconnected. Note that additional disconnect types may be added in the future, so any decision made based on a disconnect type should account for the possibility of previously-undefined disconnect types.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The connection was closed because a bind performed as part of the creation did not complete successfully.
    The connection was closed by a finalizer in the LDAP SDK, which indicates that it was not properly closed by the application that had been using it.
    The connection was closed at the request of the client, but without first sending an unbind request.
    The connection was closed because an error occurred while trying to decode data from the server.
    The connection was closed because an I/O problem was encountered while trying to communicate with the server.
    The connection was closed because an unexpected error occurred within the LDAP SDK.
    The connection was closed for a reason that does not fit any other defined disconnect type.
    The connection was closed because it was part of a connection pool that was closed.
    The connection was closed because it was part of a connection pool that was being initialized and a failure occurred while attempting to create another connection as part of the pool.
    The connection was closed because it was part of a connection pool and had been classified as defunct.
    The connection was closed because it was part of a connection pool and the connection had been established for longer than the maximum connection age for the pool.
    The connection was closed because it was part of a connection pool and was no longer needed.
    The connection was closed because it is going to be re-established.
    The connection was closed because it had been a temporary connection created for following a referral and was no longer needed.
    The connection was closed because a problem was encountered while negotiating a security layer with the server.
    The connection was closed by the server, and a notice of disconnection unsolicited notification was provided.
    The connection was closed by the server without a notice of disconnection.
    The connection was closed as a result of an unbind request sent by the client.
    The reason for the disconnect is not known.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the disconnect type with the specified name.
    Retrieves the description for this disconnect type.
    Retrieves the result code most closely associated with this disconnect type.
    static boolean
    isExpected(DisconnectType disconnectType)
    Indicates whether the provided disconnect type is likely one that is expected in some way.
    Retrieves a string representation for this disconnect type.
    void
    Appends a string representation of this disconnect type to the provided buffer.
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • UNBIND

      public static final DisconnectType UNBIND
      The connection was closed as a result of an unbind request sent by the client.
    • CLOSED_WITHOUT_UNBIND

      The connection was closed at the request of the client, but without first sending an unbind request.
    • BIND_FAILED

      public static final DisconnectType BIND_FAILED
      The connection was closed because a bind performed as part of the creation did not complete successfully.
    • RECONNECT

      public static final DisconnectType RECONNECT
      The connection was closed because it is going to be re-established.
    • REFERRAL

      public static final DisconnectType REFERRAL
      The connection was closed because it had been a temporary connection created for following a referral and was no longer needed.
    • SERVER_CLOSED_WITH_NOTICE

      The connection was closed by the server, and a notice of disconnection unsolicited notification was provided.
    • SERVER_CLOSED_WITHOUT_NOTICE

      The connection was closed by the server without a notice of disconnection.
    • IO_ERROR

      public static final DisconnectType IO_ERROR
      The connection was closed because an I/O problem was encountered while trying to communicate with the server.
    • DECODE_ERROR

      public static final DisconnectType DECODE_ERROR
      The connection was closed because an error occurred while trying to decode data from the server.
    • LOCAL_ERROR

      public static final DisconnectType LOCAL_ERROR
      The connection was closed because an unexpected error occurred within the LDAP SDK.
    • SECURITY_PROBLEM

      public static final DisconnectType SECURITY_PROBLEM
      The connection was closed because a problem was encountered while negotiating a security layer with the server.
    • POOL_CLOSED

      public static final DisconnectType POOL_CLOSED
      The connection was closed because it was part of a connection pool that was closed.
    • POOL_CREATION_FAILURE

      The connection was closed because it was part of a connection pool that was being initialized and a failure occurred while attempting to create another connection as part of the pool.
    • POOLED_CONNECTION_DEFUNCT

      The connection was closed because it was part of a connection pool and had been classified as defunct.
    • POOLED_CONNECTION_EXPIRED

      The connection was closed because it was part of a connection pool and the connection had been established for longer than the maximum connection age for the pool.
    • POOLED_CONNECTION_UNNEEDED

      The connection was closed because it was part of a connection pool and was no longer needed.
    • UNKNOWN

      public static final DisconnectType UNKNOWN
      The reason for the disconnect is not known. This generally indicates a problem with inappropriate instrumentation in the LDAP SDK.
    • CLOSED_BY_FINALIZER

      public static final DisconnectType CLOSED_BY_FINALIZER
      The connection was closed by a finalizer in the LDAP SDK, which indicates that it was not properly closed by the application that had been using it.
    • OTHER

      public static final DisconnectType OTHER
      The connection was closed for a reason that does not fit any other defined disconnect type.
  • Method Details

    • values

      public static DisconnectType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DisconnectType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getDescription

      Retrieves the description for this disconnect type.
      Returns:
      The description for this disconnect type.
    • getResultCode

      Retrieves the result code most closely associated with this disconnect type.
      Returns:
      The result code most closely associated with this disconnect type.
    • forName

      Retrieves the disconnect type with the specified name.
      Parameters:
      name - The name of the disconnect type to retrieve.
      Returns:
      The requested change type, or null if no such disconnect type is defined.
    • isExpected

      public static boolean isExpected(@NotNull DisconnectType disconnectType)
      Indicates whether the provided disconnect type is likely one that is expected in some way. This includes the following:
      • Connections closed by the application.
      • Connections which are managed as part of a connection pool.
      • Temporary connections created for following a referral.
      • Connections which are being closed by the SDK so they can be re-established.
      • Connections that were not properly closed by the application but are no longer in use and are being closed by a finalizer.
      Parameters:
      disconnectType - The disconnect type for which to make the determination.
      Returns:
      true if the connection is one that can be classified as expected and there is likely nothing that a disconnect handler needs to do to handle it, or false if not.
    • toString

      Retrieves a string representation for this disconnect type.
      Overrides:
      toString in class Enum<DisconnectType>
      Returns:
      A string representation for this disconnect type.
    • toString

      public void toString(@NotNull StringBuilder buffer)
      Appends a string representation of this disconnect type to the provided buffer.
      Parameters:
      buffer - The buffer to which the string representation should be appended.