@Extensible @ThreadSafety(level=INTERFACE_THREADSAFE) public interface DisconnectHandler
LDAPConnection.close(), terminated by the server, or closed due to an internal error). This interface may be used by applications to attempt to automatically re-establish connections as soon as they are terminated, potentially falling over to another server.
truefor the provided
disconnectTypevalue. The disconnect handler will be temporarily de-registered from the connection so that closing the connection in the course of processing the
handleDisconnect(com.unboundid.ldap.sdk.LDAPConnection, java.lang.String, int, com.unboundid.ldap.sdk.DisconnectType, java.lang.String, java.lang.Throwable)method will not cause it to be recursively re-invoked.
|Modifier and Type||Method and Description|
Performs any processing that may be necessary in response to the closure of the provided connection.
void handleDisconnect(@NotNull LDAPConnection connection, @NotNull java.lang.String host, int port, @NotNull DisconnectType disconnectType, @Nullable java.lang.String message, @Nullable java.lang.Throwable cause)
connection- The connection that has been closed.
host- The address of the server to which the connection had been established.
port- The port of the server to which the connection had been established.
disconnectType- The disconnect type, which provides general information about the nature of the disconnect.
message- A message that may be associated with the disconnect. It may be
nullif no message is available.
Throwablethat was caught and triggered the disconnect. It may be
nullif the disconnect was not triggered by a client-side exception or error.