Package org.opends.server.types
Class AbstractOperation
- java.lang.Object
-
- org.opends.server.types.AbstractOperation
-
- All Implemented Interfaces:
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 Object implements Operation, PreParseOperation, PostResponseOperation
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 OpenDJ project. It should only be extended by the operation types included in theorg.opends.server.corepackage.
-
-
Field Summary
Fields Modifier and Type Field Description protected CancelRequestcancelRequestThe cancel request for this operation.protected CancelResultcancelResultThe cancel result for this operation.protected ClientConnectionclientConnectionThe client connection with which this operation is associated.protected intmessageIDThe message ID for this operation.protected static List<Control>NO_RESPONSE_CONTROLSThe set of response controls that will always be returned for an abandon operation.protected longoperationIDThe operation ID for this operation.-
Fields inherited from interface org.opends.server.types.Operation
LOCALBACKENDOPERATIONS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOperation(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls)Creates a new operation with the provided information.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort(CancelRequest cancelRequest)Attempts to abort this operation before processing has completed.voidaddAdditionalLogItem(AdditionalLogItem item)Adds an additional log item to this operation, which should be written to the log but not included in the response to the client.voidaddRequestControl(Control control)Adds the provided control to the set of request controls for this operation.voidappendErrorMessage(org.forgerock.i18n.LocalizableMessage message)Appends the provided message to the error message buffer.voidappendMaskedErrorMessage(org.forgerock.i18n.LocalizableMessage maskedMessage)Appends the provided message to the real, masked error message buffer.CancelResultcancel(CancelRequest cancelRequest)Attempts to cancel this operation before processing has completed.voidcheckIfCanceled(boolean signalTooLate)Checks to see if this operation requested to cancel in which case CanceledOperationException will be thrown.voiddisconnectClient(DisconnectReason disconnectReason, boolean sendNotification, org.forgerock.i18n.LocalizableMessage message)Terminates the client connection being used to process this operation.booleandontSynchronize()Indicates whether this operation needs to be synchronized to other copies of the data.booleanequals(Object obj)List<AdditionalLogItem>getAdditionalLogItems()Returns an unmodifiable list containing the additional log items for this operation, which should be written to the log but not included in the response to the client.<T> TgetAttachment(String name)Retrieves the attachment with the specified name.Map<String,Object>getAttachments()Retrieves the set of attachments defined for this operation, as a mapping between the attachment name and the associated object.DNgetAuthorizationDN()Retrieves the authorization DN for this operation.EntrygetAuthorizationEntry()Retrieves the entry for the user that should be considered the authorization identity for this operation.CancelRequestgetCancelRequest()Retrieves the cancel request that has been issued for this operation, if there is one.CancelResultgetCancelResult()Retrieves the cancel result for this operation.ClientConnectiongetClientConnection()Retrieves the client connection with which this operation is associated.longgetConnectionID()Retrieves the unique identifier that is assigned to the client connection that submitted this operation.org.forgerock.i18n.LocalizableMessageBuildergetErrorMessage()Retrieves the error message for this operation.org.forgerock.i18n.LocalizableMessageBuildergetMaskedErrorMessage()Retrieves the real, masked error message for this operation.ResultCodegetMaskedResultCode()Retrieves the real, masked result code for this operation.DNgetMatchedDN()Retrieves the matched DN for this operation.intgetMessageID()Retrieves the message ID assigned to this operation.longgetOperationID()Retrieves the operation ID for this operation.longgetProcessingNanoTime()Retrieves the length of time in nanoseconds that the server spent processing this operation if available.longgetProcessingStartTime()Retrieves the time that processing started for this operation.longgetProcessingStopTime()Retrieves the time that processing stopped for this operation.longgetProcessingTime()Retrieves the length of time in milliseconds that the server spent processing this operation.List<String>getReferralURLs()Retrieves the set of referral URLs for this operation.<T extends Control>
TgetRequestControl(ControlDecoder<T> d)Retrieves a control included in the request from the client.List<Control>getRequestControls()Retrieves the set of controls included in the request from the client.ResultCodegetResultCode()Retrieves the result code for this operation.StringgetTransactionId()inthashCode()protected voidinvokePostResponseCallbacks()Invokes the post response callbacks that were registered with this operation.booleanisInnerOperation()Indicates whether this is an inner operation rather than one that was directly requested by an external client.booleanisInternalOperation()Indicates whether this is an internal operation rather than one that was requested by an external client.booleanisSynchronizationOperation()Indicates whether this is a synchronization operation rather than one that was requested by an external client.voidoperationCompleted()Indicates that processing on this operation has completed successfully and that the client should perform any associated cleanup work.booleanprocessOperationResult(PluginResult.OperationResult operationResult)Processes the provided operation result for the current operation.static booleanprocessOperationResult(Operation op, PluginResult.OperationResult opResult)Processes the provided operation result for the provided operation.voidregisterPostResponseCallback(Runnable callback)Registers a callback which should be run once this operation has completed and the response sent back to the client.<T> TremoveAttachment(String name)Removes the attachment with the specified name.<T> TsetAttachment(String name, Object value)Sets the value of the specified attachment.voidsetAttachments(Map<String,Object> attachments)Set the attachments to the operation.voidsetAuthorizationEntry(Entry authorizationEntry)Provides the entry for the user that should be considered the authorization identity for this operation.voidsetDontSynchronize(boolean dontSynchronize)Specifies whether this operation must be synchronized to other copies of the data.voidsetErrorMessage(org.forgerock.i18n.LocalizableMessageBuilder errorMessage)Specifies the error message for this operation.voidsetInnerOperation(boolean isInnerOperation)Specifies whether this is an inner operation rather than one that was directly requested by an external client.voidsetInternalOperation(boolean isInternalOperation)Specifies whether this is an internal operation rather than one that was requested by an external client.voidsetMaskedErrorMessage(org.forgerock.i18n.LocalizableMessageBuilder maskedErrorMessage)Specifies the real, masked error message for this operation.voidsetMaskedResultCode(ResultCode maskedResultCode)Specifies the real, masked result code for this operation.voidsetMatchedDN(DN matchedDN)Specifies the matched DN for this operation.voidsetProcessingStartTime()Set the time at which the processing started for this operation.voidsetProcessingStopTime()Set the time at which the processing stopped for this operation.voidsetReferralURLs(List<String> referralURLs)Specifies the set of referral URLs for this operation.voidsetResponseData(DirectoryException directoryException)Sets the response elements for this operation based on the information contained in the providedDirectoryExceptionobject.voidsetResultCode(ResultCode resultCode)Specifies the result code for this operation.voidsetSynchronizationOperation(boolean isSynchronizationOperation)Specifies whether this is a synchronization operation rather than one that was requested by an external client.StringtoString()Retrieves a string representation of this operation.voidupdateOperationErrMsgAndResCode()Updates the error message and the result code of the operation.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opends.server.types.Operation
addResponseControl, getOperationType, getProxiedAuthorizationDN, getResponseControls, removeResponseControl, run, setProxiedAuthorizationDN, toString
-
Methods inherited from interface org.opends.server.types.operation.PluginOperation
getOperationType, getResponseControls, toString
-
Methods inherited from interface org.opends.server.types.operation.PreParseOperation
addResponseControl, removeResponseControl
-
-
-
-
Field Detail
-
NO_RESPONSE_CONTROLS
protected static final 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.
-
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, 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
-
disconnectClient
public void disconnectClient(DisconnectReason disconnectReason, boolean sendNotification, org.forgerock.i18n.LocalizableMessage message)
Description copied from interface:OperationTerminates 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 terminated.- Specified by:
disconnectClientin interfaceOperation- Specified by:
disconnectClientin interfacePluginOperation- 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 benullif no notification is to be sent.
-
getClientConnection
public final ClientConnection getClientConnection()
Description copied from interface:OperationRetrieves the client connection with which this operation is associated.- Specified by:
getClientConnectionin interfaceOperation- Specified by:
getClientConnectionin interfacePluginOperation- Returns:
- The client connection with which this operation is associated.
-
getConnectionID
public final long getConnectionID()
Description copied from interface:OperationRetrieves the unique identifier that is assigned to the client connection that submitted this operation.- Specified by:
getConnectionIDin interfaceOperation- Specified by:
getConnectionIDin interfacePluginOperation- Returns:
- The unique identifier that is assigned to the client connection that submitted this operation.
-
getOperationID
public final long getOperationID()
Description copied from interface:OperationRetrieves the operation ID for this operation.- Specified by:
getOperationIDin interfaceOperation- Specified by:
getOperationIDin interfacePluginOperation- Returns:
- The operation ID for this operation.
-
getMessageID
public final int getMessageID()
Description copied from interface:OperationRetrieves the message ID assigned to this operation.- Specified by:
getMessageIDin interfaceOperation- Specified by:
getMessageIDin interfacePluginOperation- Returns:
- The message ID assigned to this operation.
-
getRequestControls
public final List<Control> getRequestControls()
Description copied from interface:OperationRetrieves the set of controls included in the request from the client. The returned list must not be altered.- Specified by:
getRequestControlsin interfaceOperation- Specified by:
getRequestControlsin interfacePluginOperation- Returns:
- The set of controls included in the request from the client.
-
getRequestControl
public final <T extends Control> T getRequestControl(ControlDecoder<T> d) throws DirectoryException
Description copied from interface:OperationRetrieves a control included in the request from the client.- Specified by:
getRequestControlin interfaceOperation- Specified by:
getRequestControlin interfacePluginOperation- Type Parameters:
T- The type of control requested.- Parameters:
d- The requested control's decoder.- Returns:
- The decoded form of the requested control included in the
request from the client or
nullif the control was not found. - Throws:
DirectoryException- if an error occurs while decoding the control.
-
addRequestControl
public final void addRequestControl(Control control)
Description copied from interface:OperationAdds the provided control to the set of request controls for this operation. This method may only be called by pre-parse plugins.- Specified by:
addRequestControlin interfaceOperation- Specified by:
addRequestControlin interfacePreParseOperation- Parameters:
control- The control to add to the set of request controls for this operation.
-
getResultCode
public final ResultCode getResultCode()
Description copied from interface:OperationRetrieves the result code for this operation.- Specified by:
getResultCodein interfaceOperation- Specified by:
getResultCodein interfacePostResponseOperation- Returns:
- The result code associated for this operation, or
UNDEFINEDif the operation has not yet completed.
-
setResultCode
public final void setResultCode(ResultCode resultCode)
Description copied from interface:OperationSpecifies the result code for this operation. This method may not be called by post-response plugins.- Specified by:
setResultCodein interfaceOperation- Parameters:
resultCode- The result code for this operation.
-
getMaskedResultCode
public final ResultCode getMaskedResultCode()
Description copied from interface:OperationRetrieves the real, masked result code for this operation.- Specified by:
getMaskedResultCodein interfaceOperation- Returns:
- The real, masked result code associated for this operation, or
UNDEFINEDif the operation has not yet completed.
-
setMaskedResultCode
public final void setMaskedResultCode(ResultCode maskedResultCode)
Description copied from interface:OperationSpecifies the real, masked result code for this operation. This method may not be called by post-response plugins.- Specified by:
setMaskedResultCodein interfaceOperation- Parameters:
maskedResultCode- The real, masked result code for this operation.
-
getErrorMessage
public final org.forgerock.i18n.LocalizableMessageBuilder getErrorMessage()
Description copied from interface:OperationRetrieves 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:
getErrorMessagein interfaceOperation- Specified by:
getErrorMessagein interfacePostResponseOperation- Specified by:
getErrorMessagein interfacePreParseOperation- Returns:
- The error message for this operation.
-
setErrorMessage
public final void setErrorMessage(org.forgerock.i18n.LocalizableMessageBuilder errorMessage)
Description copied from interface:OperationSpecifies the error message for this operation. This method may not be called by post-response plugins.- Specified by:
setErrorMessagein interfaceOperation- Specified by:
setErrorMessagein interfacePreParseOperation- Parameters:
errorMessage- The error message for this operation.
-
appendErrorMessage
public final void appendErrorMessage(org.forgerock.i18n.LocalizableMessage message)
Description copied from interface:OperationAppends 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:
appendErrorMessagein interfaceOperation- Specified by:
appendErrorMessagein interfacePreParseOperation- Parameters:
message- The message to append to the error message
-
getMaskedErrorMessage
public final org.forgerock.i18n.LocalizableMessageBuilder getMaskedErrorMessage()
Description copied from interface:OperationRetrieves the real, masked 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:
getMaskedErrorMessagein interfaceOperation- Returns:
- The real, masked error message for this operation.
-
setMaskedErrorMessage
public final void setMaskedErrorMessage(org.forgerock.i18n.LocalizableMessageBuilder maskedErrorMessage)
Description copied from interface:OperationSpecifies the real, masked error message for this operation. This method may not be called by post-response plugins.- Specified by:
setMaskedErrorMessagein interfaceOperation- Parameters:
maskedErrorMessage- The real, masked error message for this operation.
-
appendMaskedErrorMessage
public final void appendMaskedErrorMessage(org.forgerock.i18n.LocalizableMessage maskedMessage)
Description copied from interface:OperationAppends the provided message to the real, masked 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:
appendMaskedErrorMessagein interfaceOperation- Parameters:
maskedMessage- The message to append to the real, masked error message
-
getAdditionalLogItems
public List<AdditionalLogItem> getAdditionalLogItems()
Description copied from interface:OperationReturns an unmodifiable list containing the additional log items for this operation, which should be written to the log but not included in the response to the client.- Specified by:
getAdditionalLogItemsin interfaceOperation- Specified by:
getAdditionalLogItemsin interfacePostResponseOperation- Specified by:
getAdditionalLogItemsin interfacePreParseOperation- Returns:
- An unmodifiable list containing the additional log items for this operation.
-
addAdditionalLogItem
public void addAdditionalLogItem(AdditionalLogItem item)
Description copied from interface:OperationAdds an additional log item to 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:
addAdditionalLogItemin interfaceOperation- Specified by:
addAdditionalLogItemin interfacePreParseOperation- Parameters:
item- The additional log item for this operation.
-
getMatchedDN
public final DN getMatchedDN()
Description copied from interface:OperationRetrieves the matched DN for this operation.- Specified by:
getMatchedDNin interfaceOperation- Specified by:
getMatchedDNin interfacePostResponseOperation- Returns:
- The matched DN for this operation, or
nullif the operation has not yet completed or does not have a matched DN.
-
setMatchedDN
public final void setMatchedDN(DN matchedDN)
Description copied from interface:OperationSpecifies the matched DN for this operation. This may not be called by post-response plugins.- Specified by:
setMatchedDNin interfaceOperation- Parameters:
matchedDN- The matched DN for this operation.
-
getReferralURLs
public final List<String> getReferralURLs()
Description copied from interface:OperationRetrieves the set of referral URLs for this operation. Its contents must not be altered by the caller.- Specified by:
getReferralURLsin interfaceOperation- Specified by:
getReferralURLsin interfacePostResponseOperation- Returns:
- The set of referral URLs for this operation, or
nullif the operation is not yet complete or does not have a set of referral URLs.
-
setReferralURLs
public final void setReferralURLs(List<String> referralURLs)
Description copied from interface:OperationSpecifies the set of referral URLs for this operation. This may not be called by post-response plugins.- Specified by:
setReferralURLsin interfaceOperation- Parameters:
referralURLs- The set of referral URLs for this operation.
-
setResponseData
public final void setResponseData(DirectoryException directoryException)
Description copied from interface:OperationSets the response elements for this operation based on the information contained in the providedDirectoryExceptionobject. This method may not be called by post-response plugins.- Specified by:
setResponseDatain interfaceOperation- Parameters:
directoryException- The exception containing the information to use for the response elements.
-
isInternalOperation
public final boolean isInternalOperation()
Description copied from interface:OperationIndicates whether this is an internal operation rather than one that was requested by an external client.- Specified by:
isInternalOperationin interfaceOperation- Specified by:
isInternalOperationin interfacePluginOperation- Returns:
trueif this is an internal operation, orfalseif it is not.
-
setInternalOperation
public final void setInternalOperation(boolean isInternalOperation)
Description copied from interface:OperationSpecifies 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:
setInternalOperationin interfaceOperation- Parameters:
isInternalOperation- Specifies whether this is an internal operation rather than one that was requested by an external client.
-
isInnerOperation
public boolean isInnerOperation()
Description copied from interface:OperationIndicates whether this is an inner operation rather than one that was directly requested by an external client. Said otherwise, inner operations include internal operations, but also operations in the server indirectly mandated by external requests like Rest2LDAP for example. This may not be called from within a plugin.- Specified by:
isInnerOperationin interfaceOperation- Returns:
trueif this is an inner operation, orfalseif it is not.
-
setInnerOperation
public void setInnerOperation(boolean isInnerOperation)
Description copied from interface:OperationSpecifies whether this is an inner operation rather than one that was directly requested by an external client. Said otherwise, inner operations include internal operations, but also operations in the server indirectly mandated by external requests like Rest2LDAP for example. This may not be called from within a plugin.- Specified by:
setInnerOperationin interfaceOperation- Parameters:
isInnerOperation- Specifies whether this is an inner operation rather than one that was requested by an external client.
-
isSynchronizationOperation
public final boolean isSynchronizationOperation()
Description copied from interface:OperationIndicates whether this is a synchronization operation rather than one that was requested by an external client.- Specified by:
isSynchronizationOperationin interfaceOperation- Specified by:
isSynchronizationOperationin interfacePluginOperation- Returns:
trueif this is a data synchronization operation, orfalseif it is not.
-
setSynchronizationOperation
public final void setSynchronizationOperation(boolean isSynchronizationOperation)
Description copied from interface:OperationSpecifies 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:
setSynchronizationOperationin interfaceOperation- Parameters:
isSynchronizationOperation- Specifies whether this is a synchronization operation rather than one that was requested by an external client.
-
dontSynchronize
public boolean dontSynchronize()
Description copied from interface:OperationIndicates whether this operation needs to be synchronized to other copies of the data.- Specified by:
dontSynchronizein interfaceOperation- Returns:
trueif this operation should not be synchronized, orfalseif it should be synchronized.
-
setDontSynchronize
public final void setDontSynchronize(boolean dontSynchronize)
Description copied from interface:OperationSpecifies whether this operation must be synchronized to other copies of the data.- Specified by:
setDontSynchronizein interfaceOperation- Parameters:
dontSynchronize- Specifies whether this operation must be synchronized to other copies of the data.
-
getAuthorizationEntry
public final Entry getAuthorizationEntry()
Description copied from interface:OperationRetrieves 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, ornullif 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:
getAuthorizationEntryin interfaceOperation- Returns:
- The entry for the user that should be considered the
authorization identity for this operation, or
nullif the authorization identity should be the unauthenticated user.
-
setAuthorizationEntry
public final void setAuthorizationEntry(Entry authorizationEntry)
Description copied from interface:OperationProvides 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:
setAuthorizationEntryin interfaceOperation- Parameters:
authorizationEntry- The entry for the user that should be considered the authorization identity for this operation, ornullif it should be the unauthenticated user.
-
getAuthorizationDN
public final DN getAuthorizationDN()
Description copied from interface:OperationRetrieves 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:
getAuthorizationDNin interfaceOperation- Specified by:
getAuthorizationDNin interfacePostResponseOperation- Returns:
- The authorization DN for this operation, or the null DN if it should be the unauthenticated user..
-
getAttachments
public final Map<String,Object> getAttachments()
Description copied from interface:OperationRetrieves the set of attachments defined for this operation, as a mapping between the attachment name and the associated object.- Specified by:
getAttachmentsin interfaceOperation- Specified by:
getAttachmentsin interfacePluginOperation- Returns:
- The set of attachments defined for this operation.
-
setAttachments
public final void setAttachments(Map<String,Object> attachments)
Description copied from interface:OperationSet the attachments to the operation.- Specified by:
setAttachmentsin interfaceOperation- Parameters:
attachments- - Attachments to register within the operation
-
getAttachment
public final <T> T getAttachment(String name)
Description copied from interface:OperationRetrieves the attachment with the specified name.- Specified by:
getAttachmentin interfaceOperation- Specified by:
getAttachmentin interfacePluginOperation- Type Parameters:
T- the type of the attached object- Parameters:
name- The name for the attachment to retrieve. It will be treated in a case-sensitive manner.- Returns:
- The requested attachment object, or
nullif it does not exist.
-
removeAttachment
public final <T> T removeAttachment(String name)
Description copied from interface:OperationRemoves the attachment with the specified name.- Specified by:
removeAttachmentin interfaceOperation- Specified by:
removeAttachmentin interfacePluginOperation- Type Parameters:
T- the type of the attached object- 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
nullif it does not exist.
-
setAttachment
public final <T> T setAttachment(String name, Object value)
Description copied from interface:OperationSets 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:
setAttachmentin interfaceOperation- Specified by:
setAttachmentin interfacePluginOperation- Type Parameters:
T- the type of the attached object- 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
nullif there was previously no such attachment.
-
operationCompleted
public final void operationCompleted()
Description copied from interface:OperationIndicates that processing on this operation has completed successfully and that the client should perform any associated cleanup work.- Specified by:
operationCompletedin interfaceOperation
-
cancel
public CancelResult cancel(CancelRequest cancelRequest)
Description copied from interface:OperationAttempts to cancel this operation before processing has completed.
-
abort
public void abort(CancelRequest cancelRequest)
Description copied from interface:OperationAttempts to abort this operation before processing has completed.
-
checkIfCanceled
public final void checkIfCanceled(boolean signalTooLate) throws CanceledOperationExceptionDescription copied from interface:OperationChecks to see if this operation requested to cancel in which case CanceledOperationException will be thrown.- Specified by:
checkIfCanceledin interfaceOperation- Specified by:
checkIfCanceledin interfacePluginOperation- Parameters:
signalTooLate-trueto signal that any further cancel requests will be too late after return from this call orfalseotherwise.- Throws:
CanceledOperationException- if this operation should be cancelled.
-
getCancelRequest
public final CancelRequest getCancelRequest()
Description copied from interface:OperationRetrieves 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:
getCancelRequestin interfaceOperation- Returns:
- The cancel request that has been issued for this
operation, or
nullif there has not been any request to cancel.
-
getCancelResult
public final CancelResult getCancelResult()
Description copied from interface:OperationRetrieves the cancel result for this operation.- Specified by:
getCancelResultin interfaceOperation- Returns:
- The cancel result for this operation. It will be
nullif the operation has not seen and reacted to a cancel request.
-
toString
public final String toString()
Description copied from interface:OperationRetrieves a string representation of this operation.
-
getProcessingStartTime
public final long getProcessingStartTime()
Description copied from interface:OperationRetrieves the time that processing started for this operation.- Specified by:
getProcessingStartTimein interfaceOperation- Specified by:
getProcessingStartTimein interfacePluginOperation- 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()
Description copied from interface:OperationRetrieves 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:
getProcessingStopTimein interfaceOperation- Specified by:
getProcessingStopTimein interfacePostResponseOperation- 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()
Description copied from interface:OperationRetrieves 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:
getProcessingTimein interfaceOperation- Specified by:
getProcessingTimein interfacePostResponseOperation- Returns:
- The length of time in milliseconds that the server spent processing this operation.
-
getProcessingNanoTime
public final long getProcessingNanoTime()
Description copied from interface:OperationRetrieves 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:
getProcessingNanoTimein interfaceOperation- Returns:
- The length of time in nanoseconds that the server spent processing this operation or -1 if its not available.
-
registerPostResponseCallback
public final void registerPostResponseCallback(Runnable callback)
Description copied from interface:OperationRegisters a callback which should be run once this operation has completed and the response sent back to the client.- Specified by:
registerPostResponseCallbackin interfaceOperation- Parameters:
callback- The callback to be run once this operation has completed and the response sent back to the client.
-
invokePostResponseCallbacks
protected final void invokePostResponseCallbacks()
Invokes the post response callbacks that were registered with this operation.
-
updateOperationErrMsgAndResCode
public void updateOperationErrMsgAndResCode()
Updates the error message and the result code of the operation. This method is called because no workflows were found to process the operation.
-
processOperationResult
public boolean processOperationResult(PluginResult.OperationResult operationResult)
Processes the provided operation result for the current operation.- Parameters:
operationResult- the operation result- Returns:
trueif processing can continue,falseotherwise
-
processOperationResult
public static boolean processOperationResult(Operation op, PluginResult.OperationResult opResult)
Processes the provided operation result for the provided operation.- Parameters:
op- the operationopResult- the operation result- Returns:
trueif processing can continue,falseotherwise
-
getTransactionId
public String getTransactionId()
-
-