org.apache.directory.shared.ldap.extras.extended
Class GracefulShutdownRequest

java.lang.Object
  extended by org.apache.directory.shared.ldap.model.message.AbstractMessage
      extended by org.apache.directory.shared.ldap.model.message.AbstractRequest
          extended by org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl
              extended by org.apache.directory.shared.ldap.extras.extended.GracefulShutdownRequest
All Implemented Interfaces:
ExtendedRequest, Message, Request, ResultResponseRequest, SingleReplyRequest

public class GracefulShutdownRequest
extends ExtendedRequestImpl

An extended operation requesting the server to shutdown it's LDAP service port while allowing established clients to complete or abandon operations already in progress. More information about this extended request is available here: LDAP Extensions for Graceful Shutdown.

Author:
Apache Directory Project

Field Summary
static String EXTENSION_OID
          The OID for the graceful shutdown extended operation request.
static int NOW
          The shutdown is immediate
static int UNDETERMINED
          Undetermined value used for offline time
 
Fields inherited from class org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl
requestValue, response
 
Fields inherited from class org.apache.directory.shared.ldap.model.message.AbstractMessage
controls
 
Fields inherited from interface org.apache.directory.shared.ldap.model.message.ExtendedRequest
RESP_TYPE, TYPE
 
Constructor Summary
GracefulShutdownRequest(int messageId)
          Instantiates a new graceful shutdown request.
GracefulShutdownRequest(int messageId, int timeOffline, int delay)
          Instantiates a new graceful shutdown request.
 
Method Summary
 ExtendedResponse createExtendedResponse(String id, byte[] berValue, int offset, int length)
          
 int getDelay()
          Gets the delay before disconnection, in seconds.
 byte[] getRequestValue()
          
 ResultResponse getResultResponse()
          
 int getTimeOffline()
          Gets the offline time after disconnection, in minutes.
 void setDelay(int delay)
          Sets the delay befor disconnection, in seconds.
 void setRequestValue(byte[] requestValue)
          
 void setTimeOffline(int timeOffline)
          Sets the time offline after disconnection, in minutes.
 
Methods inherited from class org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl
equals, getRequestName, getResponseType, hashCode, setRequestName, toString
 
Methods inherited from class org.apache.directory.shared.ldap.model.message.AbstractRequest
hasResponse
 
Methods inherited from class org.apache.directory.shared.ldap.model.message.AbstractMessage
addAllControls, addControl, get, getControl, getControls, getMessageId, getType, hasControl, put, removeControl, setMessageId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.shared.ldap.model.message.Request
hasResponse
 
Methods inherited from interface org.apache.directory.shared.ldap.model.message.Message
addAllControls, addControl, get, getControl, getControls, getMessageId, getType, hasControl, put, removeControl, setMessageId
 

Field Detail

EXTENSION_OID

public static final String EXTENSION_OID
The OID for the graceful shutdown extended operation request.

See Also:
Constant Field Values

UNDETERMINED

public static final int UNDETERMINED
Undetermined value used for offline time

See Also:
Constant Field Values

NOW

public static final int NOW
The shutdown is immediate

See Also:
Constant Field Values
Constructor Detail

GracefulShutdownRequest

public GracefulShutdownRequest(int messageId)
Instantiates a new graceful shutdown request.

Parameters:
messageId - the message id

GracefulShutdownRequest

public GracefulShutdownRequest(int messageId,
                               int timeOffline,
                               int delay)
Instantiates a new graceful shutdown request.

Parameters:
messageId - the message id
timeOffline - the offline time after disconnection, in minutes
delay - the delay before disconnection, in seconds
Method Detail

setRequestValue

public void setRequestValue(byte[] requestValue)

Specified by:
setRequestValue in interface ExtendedRequest
Overrides:
setRequestValue in class ExtendedRequestImpl

createExtendedResponse

public ExtendedResponse createExtendedResponse(String id,
                                               byte[] berValue,
                                               int offset,
                                               int length)
                                        throws NamingException

Overrides:
createExtendedResponse in class ExtendedRequestImpl
Throws:
NamingException

getRequestValue

public byte[] getRequestValue()

Specified by:
getRequestValue in interface ExtendedRequest
Overrides:
getRequestValue in class ExtendedRequestImpl

getResultResponse

public ResultResponse getResultResponse()

Specified by:
getResultResponse in interface ResultResponseRequest
Overrides:
getResultResponse in class ExtendedRequestImpl

getDelay

public int getDelay()
Gets the delay before disconnection, in seconds.

Returns:
the delay before disconnection

setDelay

public void setDelay(int delay)
Sets the delay befor disconnection, in seconds.

Parameters:
delay - the new delay before disconnection

getTimeOffline

public int getTimeOffline()
Gets the offline time after disconnection, in minutes.

Returns:
the offline time after disconnection

setTimeOffline

public void setTimeOffline(int timeOffline)
Sets the time offline after disconnection, in minutes.

Parameters:
timeOffline - the new time offline after disconnection


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.