public class GracefulShutdownHandler extends java.lang.Object implements ExtendedOperationHandler<org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownRequest,org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownResponse>
| Modifier and Type | Field and Description |
|---|---|
static java.util.Set<java.lang.String> |
EXTENSION_OIDS |
private static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
GracefulShutdownHandler() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<java.lang.String> |
getExtensionOids()
The OIDs of the extensions supported by this handler.
|
static org.apache.directory.api.ldap.extras.extended.gracefulDisconnect.GracefulDisconnectResponse |
getGracefulDisconnect(int timeOffline,
int delay) |
java.lang.String |
getOid()
Returns the EXTENSION_OID of the extended request this handler can handle.
|
void |
handleExtendedOperation(LdapSession requestor,
org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownRequest req)
Handles the specified extended operation.
|
static void |
sendGracefulDisconnect(java.util.List<org.apache.mina.core.session.IoSession> sessions,
org.apache.directory.api.ldap.extras.extended.gracefulDisconnect.GracefulDisconnectResponse msg,
org.apache.mina.core.session.IoSession requestor)
Blocks to synchronously send the same GracefulDisconnect message to all
managed sessions except for the requestor of the GracefulShutdown.
|
static void |
sendNoticeOfDisconnect(java.util.List<org.apache.mina.core.session.IoSession> sessions,
org.apache.mina.core.session.IoSession requestor)
Blocks to synchronously send the a NoticeOfDisconnect message with
the resultCode set to unavailable(52) to all managed sessions except
for the requestor of the GracefulShutdown.
|
static void |
sendShutdownResponse(org.apache.mina.core.session.IoSession requestor,
int messageId)
Sends a successful response.
|
void |
setLdapServer(LdapServer ldapServer)
Sets the LDAP server for this extendedOperation handler.
|
static void |
waitForDelay(int delay) |
private static final org.slf4j.Logger LOG
public static final java.util.Set<java.lang.String> EXTENSION_OIDS
public java.lang.String getOid()
ExtendedOperationHandlergetOid in interface ExtendedOperationHandler<org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownRequest,org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownResponse>public void handleExtendedOperation(LdapSession requestor, org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownRequest req) throws java.lang.Exception
ExtendedOperationHandlerhandleExtendedOperation in interface ExtendedOperationHandler<org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownRequest,org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownResponse>requestor - the session object related with current connectionreq - the LDAP Extended operation requestjava.lang.Exception - if failed to handle the operationpublic static void sendShutdownResponse(org.apache.mina.core.session.IoSession requestor,
int messageId)
requestor - the session of the requestormessageId - the message id associaed with this shutdown requestpublic static void sendGracefulDisconnect(java.util.List<org.apache.mina.core.session.IoSession> sessions,
org.apache.directory.api.ldap.extras.extended.gracefulDisconnect.GracefulDisconnectResponse msg,
org.apache.mina.core.session.IoSession requestor)
msg - the graceful disconnec extended request to sendrequestor - the session of the graceful shutdown requestorsessions - the IoSessions to send disconnect message topublic static void sendNoticeOfDisconnect(java.util.List<org.apache.mina.core.session.IoSession> sessions,
org.apache.mina.core.session.IoSession requestor)
requestor - the session of the graceful shutdown requestorsessions - the sessions from minapublic static org.apache.directory.api.ldap.extras.extended.gracefulDisconnect.GracefulDisconnectResponse getGracefulDisconnect(int timeOffline,
int delay)
public static void waitForDelay(int delay)
public java.util.Set<java.lang.String> getExtensionOids()
ExtendedOperationHandlergetExtensionOids in interface ExtendedOperationHandler<org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownRequest,org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownResponse>public void setLdapServer(LdapServer ldapServer)
ExtendedOperationHandlersetLdapServer in interface ExtendedOperationHandler<org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownRequest,org.apache.directory.api.ldap.extras.extended.gracefulShutdown.GracefulShutdownResponse>ldapServer - the ldap protocol server