com.unboundid.ldap.sdk
Enum DisconnectType

java.lang.Object
  extended by java.lang.Enum<DisconnectType>
      extended by com.unboundid.ldap.sdk.DisconnectType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<DisconnectType>

@ThreadSafety(level=COMPLETELY_THREADSAFE)
public enum DisconnectType
extends java.lang.Enum<DisconnectType>

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.


Enum Constant Summary
BIND_FAILED
          The connection was closed because a bind performed as part of the creation did not complete successfully.
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.
DECODE_ERROR
          The connection was closed because an error occurred while trying to decode data from the server.
IO_ERROR
          The connection was closed because an I/O problem was encountered while trying to communicate with the server.
LOCAL_ERROR
          The connection was closed because an unexpected error occurred within the LDAP SDK.
OTHER
          The connection was closed for a reason that does not fit any other defined disconnect type.
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.
RECONNECT
          The connection was closed because it is going to be re-established.
REFERRAL
          The connection was closed because it had been a temporary connection created for following a referral and was no longer needed.
SECURITY_PROBLEM
          The connection was closed because a problem was encountered while negotiating a security layer with the server.
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.
UNBIND
          The connection was closed as a result of an unbind request sent by the client.
UNKNOWN
          The reason for the disconnect is not known.
 
Method Summary
static DisconnectType forName(java.lang.String name)
          Retrieves the disconnect type with the specified name.
 java.lang.String getDescription()
          Retrieves the description for this disconnect type.
 ResultCode getResultCode()
          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.
 java.lang.String toString()
          Retrieves a string representation for this disconnect type.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this disconnect type to the provided buffer.
static DisconnectType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static DisconnectType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNBIND

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


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

public static final DisconnectType SERVER_CLOSED_WITH_NOTICE
The connection was closed by the server, and a notice of disconnection unsolicited notification was provided.


SERVER_CLOSED_WITHOUT_NOTICE

public static final DisconnectType 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

public static final DisconnectType 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

public static final DisconnectType POOLED_CONNECTION_DEFUNCT
The connection was closed because it was part of a connection pool and had been classified as defunct.


POOLED_CONNECTION_EXPIRED

public static final DisconnectType 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

public static final DisconnectType 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 Detail

values

public static DisconnectType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DisconnectType c : DisconnectType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DisconnectType valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getDescription

public java.lang.String getDescription()
Retrieves the description for this disconnect type.

Returns:
The description for this disconnect type.

getResultCode

public ResultCode getResultCode()
Retrieves the result code most closely associated with this disconnect type.

Returns:
The result code most closely associated with this disconnect type.

forName

public static DisconnectType forName(java.lang.String name)
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(DisconnectType disconnectType)
Indicates whether the provided disconnect type is likely one that is expected in some way. This includes the following:

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

public java.lang.String toString()
Retrieves a string representation for this disconnect type.

Overrides:
toString in class java.lang.Enum<DisconnectType>
Returns:
A string representation for this disconnect type.

toString

public void toString(java.lang.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.