org.opends.server.types
Class AbstractOperation

java.lang.Object
  extended by org.opends.server.types.AbstractOperation
All Implemented Interfaces:
java.lang.Runnable, Operation, PluginOperation, PostResponseOperation, PreParseOperation
Direct Known Subclasses:
AbandonOperationBasis, AddOperationBasis, BindOperationBasis, CompareOperationBasis, DeleteOperationBasis, ExtendedOperationBasis, ModifyDNOperationBasis, ModifyOperationBasis, SearchOperationBasis, UnbindOperationBasis

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=false,
           mayInvoke=true)
public abstract class AbstractOperation
extends java.lang.Object
implements Operation, PreParseOperation, PostResponseOperation, java.lang.Runnable

This class defines a generic operation that may be processed by the Directory Server. Specific subclasses should implement specific functionality appropriate for the type of operation.

Note that this class is not intended to be subclassed by any third-party code outside of the OpenDS project. It should only be extended by the operation types included in the org.opends.server.core package.


Field Summary
protected  CancelRequest cancelRequest
          The cancel request for this operation.
protected  CancelResult cancelResult
          The cancel result for this operation.
protected  ClientConnection clientConnection
          The client connection with which this operation is associated.
protected  int messageID
          The message ID for this operation.
protected static java.util.List<Control> NO_RESPONSE_CONTROLS
          The set of response controls that will always be returned for an abandon operation.
protected  long operationID
          The operation ID for this operation.
protected  boolean useNanoTime
          Wether nanotime was used for this operation.
 
Fields inherited from interface org.opends.server.types.Operation
LOCALBACKENDOPERATIONS
 
Constructor Summary
protected AbstractOperation(ClientConnection clientConnection, long operationID, int messageID, java.util.List<Control> requestControls)
          Creates a new operation with the provided information.
 
Method Summary
 void abort(CancelRequest cancelRequest)
          Attempts to cancel this operation before processing has completed without waiting for a cancel result.
 void addRequestControl(Control control)
          Adds the provided control to the set of request controls for this operation.
abstract  void addResponseControl(Control control)
          Adds the provided control to the set of controls to include in the response to the client.
 void appendAdditionalLogMessage(Message message)
          Appends the provided message to the additional log information for this operation.
 void appendErrorMessage(Message message)
          Appends the provided message to the error message buffer.
 CancelResult cancel(CancelRequest cancelRequest)
          Attempts to cancel this operation before processing has completed.
 void checkIfCanceled(boolean signalTooLate)
          Checks to see if this operation requested to cancel in which case CanceledOperationException will be thrown.
 void disconnectClient(DisconnectReason disconnectReason, boolean sendNotification, Message message)
          Terminates the client connection being used to process this operation.
 boolean dontSynchronize()
          Indicates whether this operation needs to be synchronized to other copies of the data.
 MessageBuilder getAdditionalLogMessage()
          Retrieves the additional log message for this operation, which should be written to the log but not included in the response to the client.
 java.lang.Object getAttachment(java.lang.String name)
          Retrieves the attachment with the specified name.
 java.util.Map<java.lang.String,java.lang.Object> getAttachments()
          Retrieves the set of attachments defined for this operation, as a mapping between the attachment name and the associated object.
 DN getAuthorizationDN()
          Retrieves the authorization DN for this operation.
 Entry getAuthorizationEntry()
          Retrieves the entry for the user that should be considered the authorization identity for this operation.
 CancelRequest getCancelRequest()
          Retrieves the cancel request that has been issued for this operation, if there is one.
 CancelResult getCancelResult()
          Retrieves the cancel result for this operation.
 ClientConnection getClientConnection()
          Retrieves the client connection with which this operation is associated.
 java.lang.String[][] getCommonLogElements()
          Retrieves a set of standard elements that should be logged in all requests and responses for all types of operations.
 long getConnectionID()
          Retrieves the unique identifier that is assigned to the client connection that submitted this operation.
 MessageBuilder getErrorMessage()
          Retrieves the error message for this operation.
 DN getMatchedDN()
          Retrieves the matched DN for this operation.
 int getMessageID()
          Retrieves the message ID assigned to this operation.
 long getOperationID()
          Retrieves the operation ID for this operation.
abstract  OperationType getOperationType()
          Retrieves the operation type for this operation.
 long getProcessingNanoTime()
          Retrieves the length of time in nanoseconds that the server spent processing this operation if available.
 long getProcessingStartTime()
          Retrieves the time that processing started for this operation.
 long getProcessingStopTime()
          Retrieves the time that processing stopped for this operation.
 long getProcessingTime()
          Retrieves the length of time in milliseconds that the server spent processing this operation.
 java.util.List<java.lang.String> getReferralURLs()
          Retrieves the set of referral URLs for this operation.
 java.util.List<Control> getRequestControls()
          Retrieves the set of controls included in the request from the client.
abstract  java.lang.String[][] getRequestLogElements()
          Retrieves a standard set of elements that should be logged in requests for this type of operation.
abstract  java.util.List<Control> getResponseControls()
          Retrieves the set of controls to include in the response to the client.
abstract  java.lang.String[][] getResponseLogElements()
          Retrieves a standard set of elements that should be logged in responses for this type of operation.
 ResultCode getResultCode()
          Retrieves the result code for this operation.
 boolean isInternalOperation()
          Indicates whether this is an internal operation rather than one that was requested by an external client.
 boolean isSynchronizationOperation()
          Indicates whether this is a synchronization operation rather than one that was requested by an external client.
 void operationCompleted()
          Indicates that processing on this operation has completed successfully and that the client should perform any associated cleanup work.
 java.lang.Object removeAttachment(java.lang.String name)
          Removes the attachment with the specified name.
 void removeRequestControl(Control control)
          Removes the provided control from the set of request controls for this operation.
abstract  void removeResponseControl(Control control)
          Removes the provided control from the set of controls to include in the response to the client.
abstract  void run()
          Performs the work of actually processing this operation.
 void setAdditionalLogMessage(MessageBuilder additionalLogMessage)
          Specifies the additional log message for this operation, which should be written to the log but not included in the response to the client.
 java.lang.Object setAttachment(java.lang.String name, java.lang.Object value)
          Sets the value of the specified attachment.
 void setAttachments(java.util.Map<java.lang.String,java.lang.Object> attachments)
          Set the attachments to the operation.
 void setAuthorizationEntry(Entry authorizationEntry)
          Provides the entry for the user that should be considered the authorization identity for this operation.
 void setDontSynchronize(boolean dontSynchronize)
          Specifies whether this operation must be synchronized to other copies of the data.
 void setErrorMessage(MessageBuilder errorMessage)
          Specifies the error message for this operation.
 void setInternalOperation(boolean isInternalOperation)
          Specifies whether this is an internal operation rather than one that was requested by an external client.
 void setMatchedDN(DN matchedDN)
          Specifies the matched DN for this operation.
 void setProcessingStartTime()
          Set the time at which the processing started for this operation.
 void setProcessingStopTime()
          Set the time at which the processing stopped for this operation.
 void setReferralURLs(java.util.List<java.lang.String> referralURLs)
          Specifies the set of referral URLs for this operation.
 void setResponseData(DirectoryException directoryException)
          Sets the response elements for this operation based on the information contained in the provided DirectoryException object.
 void setResultCode(ResultCode resultCode)
          Specifies the result code for this operation.
 void setSynchronizationOperation(boolean isSynchronizationOperation)
          Specifies whether this is a synchronization operation rather than one that was requested by an external client.
 java.lang.String toString()
          Retrieves a string representation of this operation.
abstract  void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this operation to the provided buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_RESPONSE_CONTROLS

protected static final java.util.List<Control> NO_RESPONSE_CONTROLS
The set of response controls that will always be returned for an abandon operation.


clientConnection

protected final ClientConnection clientConnection
The client connection with which this operation is associated.


messageID

protected final int messageID
The message ID for this operation.


operationID

protected final long operationID
The operation ID for this operation.


useNanoTime

protected final boolean useNanoTime
Wether nanotime was used for this operation.


cancelRequest

protected CancelRequest cancelRequest
The cancel request for this operation.


cancelResult

protected CancelResult cancelResult
The cancel result for this operation.

Constructor Detail

AbstractOperation

protected AbstractOperation(ClientConnection clientConnection,
                            long operationID,
                            int messageID,
                            java.util.List<Control> requestControls)
Creates a new operation with the provided information.

Parameters:
clientConnection - The client connection with which this operation is associated.
operationID - The identifier assigned to this operation for the client connection.
messageID - The message ID of the request with which this operation is associated.
requestControls - The set of controls included in the request.
Method Detail

getOperationType

public abstract OperationType getOperationType()
Retrieves the operation type for this operation.

Specified by:
getOperationType in interface Operation
Specified by:
getOperationType in interface PluginOperation
Returns:
The operation type for this operation.

disconnectClient

public void disconnectClient(DisconnectReason disconnectReason,
                             boolean sendNotification,
                             Message message)
Terminates the client connection being used to process this operation. If this is called by a plugin, then that plugin must return a result indicating that the client connection has been teriminated.

Specified by:
disconnectClient in interface Operation
Specified by:
disconnectClient in interface PluginOperation
Parameters:
disconnectReason - The disconnect reason that provides the generic cause for the disconnect.
sendNotification - Indicates whether to try to provide notification to the client that the connection will be closed.
message - The message to send to the client. It may be null if no notification is to be sent.

getCommonLogElements

public final java.lang.String[][] getCommonLogElements()
Retrieves a set of standard elements that should be logged in all requests and responses for all types of operations. Each element in the array will itself be a two-element array in which the first element is the name of the field and the second is a string representation of the value, or null if there is no value for that field.

Specified by:
getCommonLogElements in interface Operation
Returns:
A standard set of elements that should be logged in requests and responses for all types of operations.

getRequestLogElements

public abstract java.lang.String[][] getRequestLogElements()
Retrieves a standard set of elements that should be logged in requests for this type of operation. Each element in the array will itself be a two-element array in which the first element is the name of the field and the second is a string representation of the value, or null if there is no value for that field.

Specified by:
getRequestLogElements in interface Operation
Returns:
A standard set of elements that should be logged in requests for this type of operation.

getResponseLogElements

public abstract java.lang.String[][] getResponseLogElements()
Retrieves a standard set of elements that should be logged in responses for this type of operation. Each element in the array will itself be a two-element array in which the first element is the name of the field and the second is a string representation of the value, or null if there is no value for that field.

Specified by:
getResponseLogElements in interface Operation
Returns:
A standard set of elements that should be logged in responses for this type of operation.

getClientConnection

public final ClientConnection getClientConnection()
Retrieves the client connection with which this operation is associated.

Specified by:
getClientConnection in interface Operation
Specified by:
getClientConnection in interface PluginOperation
Returns:
The client connection with which this operation is associated.

getConnectionID

public final long getConnectionID()
Retrieves the unique identifier that is assigned to the client connection that submitted this operation.

Specified by:
getConnectionID in interface Operation
Specified by:
getConnectionID in interface PluginOperation
Returns:
The unique identifier that is assigned to the client connection that submitted this operation.

getOperationID

public final long getOperationID()
Retrieves the operation ID for this operation.

Specified by:
getOperationID in interface Operation
Specified by:
getOperationID in interface PluginOperation
Returns:
The operation ID for this operation.

getMessageID

public final int getMessageID()
Retrieves the message ID assigned to this operation.

Specified by:
getMessageID in interface Operation
Specified by:
getMessageID in interface PluginOperation
Returns:
The message ID assigned to this operation.

getRequestControls

public final java.util.List<Control> getRequestControls()
Retrieves the set of controls included in the request from the client. The returned list must not be altered.

Specified by:
getRequestControls in interface Operation
Specified by:
getRequestControls in interface PluginOperation
Returns:
The set of controls included in the request from the client.

addRequestControl

public final void addRequestControl(Control control)
Adds the provided control to the set of request controls for this operation. This method may only be called by pre-parse plugins.

Specified by:
addRequestControl in interface Operation
Specified by:
addRequestControl in interface PreParseOperation
Parameters:
control - The control to add to the set of request controls for this operation.

removeRequestControl

public final void removeRequestControl(Control control)
Removes the provided control from the set of request controls for this operation. This method may only be called by pre-parse plugins.

Specified by:
removeRequestControl in interface Operation
Specified by:
removeRequestControl in interface PreParseOperation
Parameters:
control - The control to remove from the set of request controls for this operation.

getResponseControls

public abstract java.util.List<Control> getResponseControls()
Retrieves the set of controls to include in the response to the client. The contents of this list must not be altered.

Specified by:
getResponseControls in interface Operation
Specified by:
getResponseControls in interface PluginOperation
Returns:
The set of controls to include in the response to the client.

addResponseControl

public abstract void addResponseControl(Control control)
Adds the provided control to the set of controls to include in the response to the client. This method may not be called by post-response plugins.

Specified by:
addResponseControl in interface Operation
Specified by:
addResponseControl in interface PreParseOperation
Parameters:
control - The control to add to the set of controls to include in the response to the client.

removeResponseControl

public abstract void removeResponseControl(Control control)
Removes the provided control from the set of controls to include in the response to the client. This method may not be called by post-response plugins.

Specified by:
removeResponseControl in interface Operation
Specified by:
removeResponseControl in interface PreParseOperation
Parameters:
control - The control to remove from the set of controls to include in the response to the client.

getResultCode

public final ResultCode getResultCode()
Retrieves the result code for this operation.

Specified by:
getResultCode in interface Operation
Specified by:
getResultCode in interface PostResponseOperation
Returns:
The result code associated for this operation, or UNDEFINED if the operation has not yet completed.

setResultCode

public final void setResultCode(ResultCode resultCode)
Specifies the result code for this operation. This method may not be called by post-response plugins.

Specified by:
setResultCode in interface Operation
Parameters:
resultCode - The result code for this operation.

getErrorMessage

public final MessageBuilder getErrorMessage()
Retrieves the error message for this operation. Its contents may be altered by pre-parse, pre-operation, and post-operation plugins, but not by post-response plugins.

Specified by:
getErrorMessage in interface Operation
Specified by:
getErrorMessage in interface PostResponseOperation
Specified by:
getErrorMessage in interface PreParseOperation
Returns:
The error message for this operation.

setErrorMessage

public final void setErrorMessage(MessageBuilder errorMessage)
Specifies the error message for this operation. This method may not be called by post-response plugins.

Specified by:
setErrorMessage in interface Operation
Specified by:
setErrorMessage in interface PreParseOperation
Parameters:
errorMessage - The error message for this operation.

appendErrorMessage

public final void appendErrorMessage(Message message)
Appends the provided message to the error message buffer. If the buffer has not yet been created, then this will create it first and then add the provided message. This method may not be called by post-response plugins.

Specified by:
appendErrorMessage in interface Operation
Specified by:
appendErrorMessage in interface PreParseOperation
Parameters:
message - The message to append to the error message buffer.

getAdditionalLogMessage

public final MessageBuilder getAdditionalLogMessage()
Retrieves the additional log message for this operation, which should be written to the log but not included in the response to the client. The contents of this buffer may be altered by pre-parse, pre-operation, and post-operation plugins, but not by post-response plugins.

Specified by:
getAdditionalLogMessage in interface Operation
Specified by:
getAdditionalLogMessage in interface PostResponseOperation
Specified by:
getAdditionalLogMessage in interface PreParseOperation
Returns:
The additional log message for this operation.

setAdditionalLogMessage

public final void setAdditionalLogMessage(MessageBuilder additionalLogMessage)
Specifies the additional log message for this operation, which should be written to the log but not included in the response to the client. This method may not be called by post-response plugins.

Specified by:
setAdditionalLogMessage in interface Operation
Specified by:
setAdditionalLogMessage in interface PreParseOperation
Parameters:
additionalLogMessage - The additional log message for this operation.

appendAdditionalLogMessage

public final void appendAdditionalLogMessage(Message message)
Appends the provided message to the additional log information for this operation. This method may not be called by post-response plugins.

Specified by:
appendAdditionalLogMessage in interface Operation
Specified by:
appendAdditionalLogMessage in interface PreParseOperation
Parameters:
message - The message that should be appended to the additional log information for this operation.

getMatchedDN

public final DN getMatchedDN()
Retrieves the matched DN for this operation.

Specified by:
getMatchedDN in interface Operation
Specified by:
getMatchedDN in interface PostResponseOperation
Returns:
The matched DN for this operation, or null if the operation has not yet completed or does not have a matched DN.

setMatchedDN

public final void setMatchedDN(DN matchedDN)
Specifies the matched DN for this operation. This may not be called by post-response plugins.

Specified by:
setMatchedDN in interface Operation
Parameters:
matchedDN - The matched DN for this operation.

getReferralURLs

public final java.util.List<java.lang.String> getReferralURLs()
Retrieves the set of referral URLs for this operation. Its contents must not be altered by the caller.

Specified by:
getReferralURLs in interface Operation
Specified by:
getReferralURLs in interface PostResponseOperation
Returns:
The set of referral URLs for this operation, or null if the operation is not yet complete or does not have a set of referral URLs.

setReferralURLs

public final void setReferralURLs(java.util.List<java.lang.String> referralURLs)
Specifies the set of referral URLs for this operation. This may not be called by post-response plugins.

Specified by:
setReferralURLs in interface Operation
Parameters:
referralURLs - The set of referral URLs for this operation.

setResponseData

public final void setResponseData(DirectoryException directoryException)
Sets the response elements for this operation based on the information contained in the provided DirectoryException object. This method may not be called by post-response plugins.

Specified by:
setResponseData in interface Operation
Parameters:
directoryException - The exception containing the information to use for the response elements.

isInternalOperation

public final boolean isInternalOperation()
Indicates whether this is an internal operation rather than one that was requested by an external client.

Specified by:
isInternalOperation in interface Operation
Specified by:
isInternalOperation in interface PluginOperation
Returns:
true if this is an internal operation, or false if it is not.

setInternalOperation

public final void setInternalOperation(boolean isInternalOperation)
Specifies whether this is an internal operation rather than one that was requested by an external client. This may not be called from within a plugin.

Specified by:
setInternalOperation in interface Operation
Parameters:
isInternalOperation - Specifies whether this is an internal operation rather than one that was requested by an external client.

isSynchronizationOperation

public final boolean isSynchronizationOperation()
Indicates whether this is a synchronization operation rather than one that was requested by an external client.

Specified by:
isSynchronizationOperation in interface Operation
Specified by:
isSynchronizationOperation in interface PluginOperation
Returns:
true if this is a data synchronization operation, or false if it is not.

setSynchronizationOperation

public final void setSynchronizationOperation(boolean isSynchronizationOperation)
Specifies whether this is a synchronization operation rather than one that was requested by an external client. This method may not be called from within a plugin.

Specified by:
setSynchronizationOperation in interface Operation
Parameters:
isSynchronizationOperation - Specifies whether this is a synchronization operation rather than one that was requested by an external client.

dontSynchronize

public boolean dontSynchronize()
Indicates whether this operation needs to be synchronized to other copies of the data.

Specified by:
dontSynchronize in interface Operation
Returns:
true if this operation should not be synchronized, or false if it should be synchronized.

setDontSynchronize

public final void setDontSynchronize(boolean dontSynchronize)
Specifies whether this operation must be synchronized to other copies of the data.

Specified by:
setDontSynchronize in interface Operation
Parameters:
dontSynchronize - Specifies whether this operation must be synchronized to other copies of the data.

getAuthorizationEntry

public final Entry getAuthorizationEntry()
Retrieves the entry for the user that should be considered the authorization identity for this operation. In many cases, it will be the same as the authorization entry for the underlying client connection, or null if no authentication has been performed on that connection. However, it may be some other value if special processing has been requested (e.g., the operation included a proxied authorization control). This method should not be called by pre-parse plugins because the correct value may not yet have been determined.

Specified by:
getAuthorizationEntry in interface Operation
Returns:
The entry for the user that should be considered the authorization identity for this operation, or null if the authorization identity should be the unauthenticated user.

setAuthorizationEntry

public final void setAuthorizationEntry(Entry authorizationEntry)
Provides the entry for the user that should be considered the authorization identity for this operation. This must not be called from within a plugin.

Specified by:
setAuthorizationEntry in interface Operation
Parameters:
authorizationEntry - The entry for the user that should be considered the authorization identity for this operation, or null if it should be the unauthenticated user.

getAuthorizationDN

public final DN getAuthorizationDN()
Retrieves the authorization DN for this operation. In many cases, it will be the same as the DN of the authenticated user for the underlying connection, or the null DN if no authentication has been performed on that connection. However, it may be some other value if special processing has been requested (e.g., the operation included a proxied authorization control). This method should not be called by pre-parse plugins because the correct value may not have yet been determined.

Specified by:
getAuthorizationDN in interface Operation
Specified by:
getAuthorizationDN in interface PostResponseOperation
Returns:
The authorization DN for this operation, or the null DN if it should be the unauthenticated user..

getAttachments

public final java.util.Map<java.lang.String,java.lang.Object> getAttachments()
Retrieves the set of attachments defined for this operation, as a mapping between the attachment name and the associated object.

Specified by:
getAttachments in interface Operation
Specified by:
getAttachments in interface PluginOperation
Returns:
The set of attachments defined for this operation.

setAttachments

public final void setAttachments(java.util.Map<java.lang.String,java.lang.Object> attachments)
Set the attachments to the operation.

Specified by:
setAttachments in interface Operation
Parameters:
attachments - - Attachments to register within the operation

getAttachment

public final java.lang.Object getAttachment(java.lang.String name)
Retrieves the attachment with the specified name.

Specified by:
getAttachment in interface Operation
Specified by:
getAttachment in interface PluginOperation
Parameters:
name - The name for the attachment to retrieve. It will be treated in a case-sensitive manner.
Returns:
The requested attachment object, or null if it does not exist.

removeAttachment

public final java.lang.Object removeAttachment(java.lang.String name)
Removes the attachment with the specified name.

Specified by:
removeAttachment in interface Operation
Specified by:
removeAttachment in interface PluginOperation
Parameters:
name - The name for the attachment to remove. It will be treated in a case-sensitive manner.
Returns:
The attachment that was removed, or null if it does not exist.

setAttachment

public final java.lang.Object setAttachment(java.lang.String name,
                                            java.lang.Object value)
Sets the value of the specified attachment. If an attachment already exists with the same name, it will be replaced. Otherwise, a new attachment will be added.

Specified by:
setAttachment in interface Operation
Specified by:
setAttachment in interface PluginOperation
Parameters:
name - The name to use for the attachment.
value - The value to use for the attachment.
Returns:
The former value held by the attachment with the given name, or null if there was previously no such attachment.

operationCompleted

public final void operationCompleted()
Indicates that processing on this operation has completed successfully and that the client should perform any associated cleanup work.

Specified by:
operationCompleted in interface Operation

cancel

public CancelResult cancel(CancelRequest cancelRequest)
Attempts to cancel this operation before processing has completed.

Specified by:
cancel in interface Operation
Parameters:
cancelRequest - Information about the way in which the operation should be canceled.
Returns:
A code providing information on the result of the cancellation.

abort

public void abort(CancelRequest cancelRequest)
Attempts to cancel this operation before processing has completed without waiting for a cancel result.

Specified by:
abort in interface Operation
Parameters:
cancelRequest - Information about the way in which the operation should be canceled.

checkIfCanceled

public final void checkIfCanceled(boolean signalTooLate)
                           throws CanceledOperationException
Checks to see if this operation requested to cancel in which case CanceledOperationException will be thrown.

Specified by:
checkIfCanceled in interface Operation
Specified by:
checkIfCanceled in interface PluginOperation
Parameters:
signalTooLate - true to signal that any further cancel requests will be too late after return from this call or false otherwise.
Throws:
CanceledOperationException - if this operation should be cancelled.

getCancelRequest

public final CancelRequest getCancelRequest()
Retrieves the cancel request that has been issued for this operation, if there is one. This method should not be called by post-operation or post-response plugins.

Specified by:
getCancelRequest in interface Operation
Returns:
The cancel request that has been issued for this operation, or null if there has not been any request to cancel.

getCancelResult

public final CancelResult getCancelResult()
Retrieves the cancel result for this operation.

Specified by:
getCancelResult in interface Operation
Returns:
The cancel result for this operation. It will be null if the operation has not seen and reacted to a cancel request.

toString

public final java.lang.String toString()
Retrieves a string representation of this operation.

Specified by:
toString in interface Operation
Specified by:
toString in interface PluginOperation
Overrides:
toString in class java.lang.Object
Returns:
A string representation of this operation.

toString

public abstract void toString(java.lang.StringBuilder buffer)
Appends a string representation of this operation to the provided buffer.

Specified by:
toString in interface Operation
Specified by:
toString in interface PluginOperation
Parameters:
buffer - The buffer into which a string representation of this operation should be appended.

getProcessingStartTime

public final long getProcessingStartTime()
Retrieves the time that processing started for this operation.

Specified by:
getProcessingStartTime in interface Operation
Specified by:
getProcessingStartTime in interface PluginOperation
Returns:
The time that processing started for this operation.

setProcessingStartTime

public final void setProcessingStartTime()
Set the time at which the processing started for this operation.


getProcessingStopTime

public final long getProcessingStopTime()
Retrieves the time that processing stopped for this operation. This will actually hold a time immediately before the response was sent to the client.

Specified by:
getProcessingStopTime in interface Operation
Specified by:
getProcessingStopTime in interface PostResponseOperation
Returns:
The time that processing stopped for this operation.

setProcessingStopTime

public final void setProcessingStopTime()
Set the time at which the processing stopped for this operation. This will actually hold a time immediately before the response was sent to the client.


getProcessingTime

public final long getProcessingTime()
Retrieves the length of time in milliseconds that the server spent processing this operation. This should not be called until after the server has sent the response to the client.

Specified by:
getProcessingTime in interface Operation
Specified by:
getProcessingTime in interface PostResponseOperation
Returns:
The length of time in milliseconds that the server spent processing this operation.

getProcessingNanoTime

public final long getProcessingNanoTime()
Retrieves the length of time in nanoseconds that the server spent processing this operation if available. This should not be called until after the server has sent the response to the client.

Specified by:
getProcessingNanoTime in interface Operation
Returns:
The length of time in nanoseconds that the server spent processing this operation or -1 if its not available.

run

public abstract void run()
Performs the work of actually processing this operation. This should include all processing for the operation, including invoking pre-parse and post-response plugins, logging messages and any other work that might need to be done in the course of processing.

Specified by:
run in interface java.lang.Runnable