org.opends.server.extensions
Class GetConnectionIDExtendedOperation

java.lang.Object
  extended by org.opends.server.api.ExtendedOperationHandler<GetConnectionIdExtendedOperationHandlerCfg>
      extended by org.opends.server.extensions.GetConnectionIDExtendedOperation

public class GetConnectionIDExtendedOperation
extends ExtendedOperationHandler<GetConnectionIdExtendedOperationHandlerCfg>

This class implements the "Get Connection ID" extended operation that can be used to get the connection ID of the associated client connection.


Constructor Summary
GetConnectionIDExtendedOperation()
          Create an instance of this "Get Connection ID" extended operation.
 
Method Summary
static long decodeResponseValue(ASN1OctetString responseValue)
          Decodes the provided ASN.1 octet string to extract the connection ID.
static ASN1OctetString encodeResponseValue(long connectionID)
          Encodes the provided connection ID in an octet string suitable for use as the value for this extended operation.
 void finalizeExtendedOperationHandler()
          Performs any finalization that may be necessary for this extended operation handler.
 void initializeExtendedOperationHandler(GetConnectionIdExtendedOperationHandlerCfg config)
          Initializes this extended operation handler based on the information in the provided configuration entry.
 void processExtendedOperation(ExtendedOperation operation)
          Processes the provided extended operation.
 
Methods inherited from class org.opends.server.api.ExtendedOperationHandler
deregisterControlsAndFeatures, getSupportedControls, getSupportedFeatures, isConfigurationAcceptable, registerControlsAndFeatures, supportsControl, supportsFeature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetConnectionIDExtendedOperation

public GetConnectionIDExtendedOperation()
Create an instance of this "Get Connection ID" extended operation. All initialization should be performed in the initializeExtendedOperationHandler method.

Method Detail

initializeExtendedOperationHandler

public void initializeExtendedOperationHandler(GetConnectionIdExtendedOperationHandlerCfg config)
                                        throws ConfigException,
                                               InitializationException
Initializes this extended operation handler based on the information in the provided configuration entry. It should also register itself with the Directory Server for the particular kinds of extended operations that it will process.

Specified by:
initializeExtendedOperationHandler in class ExtendedOperationHandler<GetConnectionIdExtendedOperationHandlerCfg>
Parameters:
config - The extended operation handler configuration that contains the information to use to initialize this extended operation handler.
Throws:
ConfigException - If an unrecoverable problem arises in the process of performing the initialization.
InitializationException - If a problem occurs during initialization that is not related to the server configuration.

finalizeExtendedOperationHandler

public void finalizeExtendedOperationHandler()
Performs any finalization that may be necessary for this extended operation handler. By default, no finalization is performed.

Overrides:
finalizeExtendedOperationHandler in class ExtendedOperationHandler<GetConnectionIdExtendedOperationHandlerCfg>

processExtendedOperation

public void processExtendedOperation(ExtendedOperation operation)
Processes the provided extended operation.

Specified by:
processExtendedOperation in class ExtendedOperationHandler<GetConnectionIdExtendedOperationHandlerCfg>
Parameters:
operation - The extended operation to be processed.

encodeResponseValue

public static ASN1OctetString encodeResponseValue(long connectionID)
Encodes the provided connection ID in an octet string suitable for use as the value for this extended operation.

Parameters:
connectionID - The connection ID to be encoded.
Returns:
The ASN.1 octet string containing the encoded connection ID.

decodeResponseValue

public static long decodeResponseValue(ASN1OctetString responseValue)
                                throws ASN1Exception
Decodes the provided ASN.1 octet string to extract the connection ID.

Parameters:
responseValue - The response value to be decoded.
Returns:
The connection ID decoded from the provided response value.
Throws:
ASN1Exception - If an error occurs while trying to decode the response value.