@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=false, mayInvoke=true) public abstract class AbstractOperation extends Object implements Operation, PreParseOperation, PostResponseOperation
org.opends.server.core package.| Modifier and Type | Field and Description |
|---|---|
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 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.
|
LOCALBACKENDOPERATIONS| Modifier | Constructor and Description |
|---|---|
protected |
AbstractOperation(ClientConnection clientConnection,
long operationID,
int messageID,
List<Control> requestControls)
Creates a new operation with the provided information.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(CancelRequest cancelRequest)
Attempts to abort this operation before processing has
completed.
|
void |
addAdditionalLogItem(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.
|
void |
addRequestControl(Control control)
Adds the provided control to the set of request controls for this
operation.
|
void |
appendErrorMessage(LocalizableMessage message)
Appends the provided message to the error message buffer.
|
void |
appendMaskedErrorMessage(LocalizableMessage maskedMessage)
Appends the provided message to the real, masked 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,
LocalizableMessage 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.
|
boolean |
equals(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> T |
getAttachment(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.
|
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.
|
long |
getConnectionID()
Retrieves the unique identifier that is assigned to the client
connection that submitted this operation.
|
LocalizableMessageBuilder |
getErrorMessage()
Retrieves the error message for this operation.
|
LocalizableMessageBuilder |
getMaskedErrorMessage()
Retrieves the real, masked error message for this operation.
|
org.forgerock.opendj.ldap.ResultCode |
getMaskedResultCode()
Retrieves the real, masked result code 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.
|
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.
|
List<String> |
getReferralURLs()
Retrieves the set of referral URLs for this operation.
|
<T extends Control> |
getRequestControl(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.
|
org.forgerock.opendj.ldap.ResultCode |
getResultCode()
Retrieves the result code for this operation.
|
int |
hashCode() |
protected void |
invokePostResponseCallbacks()
Invokes the post response callbacks that were registered with
this operation.
|
boolean |
isInnerOperation()
Indicates whether this is an inner operation rather than one that was
directly requested by an external client.
|
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.
|
static boolean |
processOperationResult(Operation op,
PluginResult.OperationResult opResult)
Processes the provided operation result for the provided operation.
|
boolean |
processOperationResult(PluginResult.OperationResult operationResult)
Processes the provided operation result for the current operation.
|
void |
registerPostResponseCallback(Runnable callback)
Registers a callback which should be run once this operation has
completed and the response sent back to the client.
|
<T> T |
removeAttachment(String name)
Removes the attachment with the specified name.
|
<T> T |
setAttachment(String name,
Object value)
Sets the value of the specified attachment.
|
void |
setAttachments(Map<String,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(LocalizableMessageBuilder errorMessage)
Specifies the error message for this operation.
|
void |
setInnerOperation(boolean isInnerOperation)
Specifies whether this is an inner operation rather than one that was
directly requested by an external client.
|
void |
setInternalOperation(boolean isInternalOperation)
Specifies whether this is an internal operation rather than one
that was requested by an external client.
|
void |
setMaskedErrorMessage(LocalizableMessageBuilder maskedErrorMessage)
Specifies the real, masked error message for this operation.
|
void |
setMaskedResultCode(org.forgerock.opendj.ldap.ResultCode maskedResultCode)
Specifies the real, masked result code for this operation.
|
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(List<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(org.forgerock.opendj.ldap.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.
|
String |
toString()
Retrieves a string representation of this operation.
|
void |
updateOperationErrMsgAndResCode()
Updates the error message and the result code of the operation.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitaddResponseControl, getOperationType, getProxiedAuthorizationDN, getResponseControls, removeResponseControl, run, setProxiedAuthorizationDN, toStringaddResponseControl, removeResponseControlgetOperationType, getResponseControls, toStringprotected static final List<Control> NO_RESPONSE_CONTROLS
protected final ClientConnection clientConnection
protected final int messageID
protected final long operationID
protected CancelRequest cancelRequest
protected CancelResult cancelResult
protected AbstractOperation(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls)
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.public void disconnectClient(DisconnectReason disconnectReason, boolean sendNotification, LocalizableMessage message)
OperationdisconnectClient in interface OperationdisconnectClient in interface PluginOperationdisconnectReason - 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.public final ClientConnection getClientConnection()
OperationgetClientConnection in interface OperationgetClientConnection in interface PluginOperationpublic final long getConnectionID()
OperationgetConnectionID in interface OperationgetConnectionID in interface PluginOperationpublic final long getOperationID()
OperationgetOperationID in interface OperationgetOperationID in interface PluginOperationpublic final int getMessageID()
OperationgetMessageID in interface OperationgetMessageID in interface PluginOperationpublic final List<Control> getRequestControls()
OperationgetRequestControls in interface OperationgetRequestControls in interface PluginOperationpublic final <T extends Control> T getRequestControl(ControlDecoder<T> d) throws DirectoryException
OperationgetRequestControl in interface OperationgetRequestControl in interface PluginOperationT - The type of control requested.d - The requested control's decoder.null if the
control was not found.DirectoryException - if an error occurs while decoding the control.public final void addRequestControl(Control control)
OperationaddRequestControl in interface OperationaddRequestControl in interface PreParseOperationcontrol - The control to add to the set of request
controls for this operation.public final org.forgerock.opendj.ldap.ResultCode getResultCode()
OperationgetResultCode in interface OperationgetResultCode in interface PostResponseOperationUNDEFINED if the operation has not yet
completed.public final void setResultCode(org.forgerock.opendj.ldap.ResultCode resultCode)
OperationsetResultCode in interface OperationresultCode - The result code for this operation.public final org.forgerock.opendj.ldap.ResultCode getMaskedResultCode()
OperationgetMaskedResultCode in interface OperationUNDEFINED if the operation has not yet completed.public final void setMaskedResultCode(org.forgerock.opendj.ldap.ResultCode maskedResultCode)
OperationsetMaskedResultCode in interface OperationmaskedResultCode - The real, masked result code for this operation.public final LocalizableMessageBuilder getErrorMessage()
OperationgetErrorMessage in interface OperationgetErrorMessage in interface PostResponseOperationgetErrorMessage in interface PreParseOperationpublic final void setErrorMessage(LocalizableMessageBuilder errorMessage)
OperationsetErrorMessage in interface OperationsetErrorMessage in interface PreParseOperationerrorMessage - The error message for this operation.public final void appendErrorMessage(LocalizableMessage message)
OperationappendErrorMessage in interface OperationappendErrorMessage in interface PreParseOperationmessage - The message to append to the error messagepublic final LocalizableMessageBuilder getMaskedErrorMessage()
OperationgetMaskedErrorMessage in interface Operationpublic final void setMaskedErrorMessage(LocalizableMessageBuilder maskedErrorMessage)
OperationsetMaskedErrorMessage in interface OperationmaskedErrorMessage - The real, masked error message for this operation.public final void appendMaskedErrorMessage(LocalizableMessage maskedMessage)
OperationappendMaskedErrorMessage in interface OperationmaskedMessage - The message to append to the real, masked error messagepublic List<AdditionalLogItem> getAdditionalLogItems()
OperationgetAdditionalLogItems in interface OperationgetAdditionalLogItems in interface PostResponseOperationgetAdditionalLogItems in interface PreParseOperationpublic void addAdditionalLogItem(AdditionalLogItem item)
OperationaddAdditionalLogItem in interface OperationaddAdditionalLogItem in interface PreParseOperationitem - The additional log item for this operation.public final DN getMatchedDN()
OperationgetMatchedDN in interface OperationgetMatchedDN in interface PostResponseOperationnull if
the operation has not yet completed or does not have a
matched DN.public final void setMatchedDN(DN matchedDN)
OperationsetMatchedDN in interface OperationmatchedDN - The matched DN for this operation.public final List<String> getReferralURLs()
OperationgetReferralURLs in interface OperationgetReferralURLs in interface PostResponseOperationnull if the operation is not yet complete or
does not have a set of referral URLs.public final void setReferralURLs(List<String> referralURLs)
OperationsetReferralURLs in interface OperationreferralURLs - The set of referral URLs for this
operation.public final void setResponseData(DirectoryException directoryException)
OperationDirectoryException
object. This method may not be called by post-response plugins.setResponseData in interface OperationdirectoryException - The exception containing the
information to use for the response
elements.public final boolean isInternalOperation()
OperationisInternalOperation in interface OperationisInternalOperation in interface PluginOperationtrue if this is an internal operation, or
false if it is not.public final void setInternalOperation(boolean isInternalOperation)
OperationsetInternalOperation in interface OperationisInternalOperation - Specifies whether this is an
internal operation rather than one
that was requested by an external
client.public boolean isInnerOperation()
OperationisInnerOperation in interface Operationtrue if this is an inner operation, or false if it
is not.public void setInnerOperation(boolean isInnerOperation)
OperationsetInnerOperation in interface OperationisInnerOperation - Specifies whether this is an inner operation rather than one that
was requested by an external client.public final boolean isSynchronizationOperation()
OperationisSynchronizationOperation in interface OperationisSynchronizationOperation in interface PluginOperationtrue if this is a data synchronization
operation, or false if it is not.public final void setSynchronizationOperation(boolean isSynchronizationOperation)
OperationsetSynchronizationOperation in interface OperationisSynchronizationOperation - Specifies whether this is a
synchronization operation
rather than one that was
requested by an external
client.public boolean dontSynchronize()
OperationdontSynchronize in interface Operationtrue if this operation should not be
synchronized, or false if it should be
synchronized.public final void setDontSynchronize(boolean dontSynchronize)
OperationsetDontSynchronize in interface OperationdontSynchronize - Specifies whether this operation must be
synchronized to other copies
of the data.public final Entry getAuthorizationEntry()
Operationnull 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.getAuthorizationEntry in interface Operationnull if the authorization identity should be the
unauthenticated user.public final void setAuthorizationEntry(Entry authorizationEntry)
OperationsetAuthorizationEntry in interface OperationauthorizationEntry - The entry for the user that should be
considered the authorization identity
for this operation, or null
if it should be the unauthenticated
user.public final DN getAuthorizationDN()
OperationgetAuthorizationDN in interface OperationgetAuthorizationDN in interface PostResponseOperationpublic final Map<String,Object> getAttachments()
OperationgetAttachments in interface OperationgetAttachments in interface PluginOperationpublic final void setAttachments(Map<String,Object> attachments)
OperationsetAttachments in interface Operationattachments - - Attachments to register within the
operationpublic final <T> T getAttachment(String name)
OperationgetAttachment in interface OperationgetAttachment in interface PluginOperationT - the type of the attached objectname - The name for the attachment to retrieve. It will
be treated in a case-sensitive manner.null if it
does not exist.public final <T> T removeAttachment(String name)
OperationremoveAttachment in interface OperationremoveAttachment in interface PluginOperationT - the type of the attached objectname - The name for the attachment to remove. It will be
treated in a case-sensitive manner.null if it
does not exist.public final <T> T setAttachment(String name, Object value)
OperationsetAttachment in interface OperationsetAttachment in interface PluginOperationT - the type of the attached objectname - The name to use for the attachment.value - The value to use for the attachment.null if there was previously no such
attachment.public final void operationCompleted()
OperationoperationCompleted in interface Operationpublic CancelResult cancel(CancelRequest cancelRequest)
Operationpublic void abort(CancelRequest cancelRequest)
Operationpublic final void checkIfCanceled(boolean signalTooLate) throws CanceledOperationException
OperationcheckIfCanceled in interface OperationcheckIfCanceled in interface PluginOperationsignalTooLate - true to signal that any further
cancel requests will be too late after
return from this call or false
otherwise.CanceledOperationException - if this operation should
be cancelled.public final CancelRequest getCancelRequest()
OperationgetCancelRequest in interface Operationnull if there has not been any
request to cancel.public final CancelResult getCancelResult()
OperationgetCancelResult in interface Operationnull if the operation has not seen and reacted
to a cancel request.public final String toString()
Operationpublic final long getProcessingStartTime()
OperationgetProcessingStartTime in interface OperationgetProcessingStartTime in interface PluginOperationpublic final void setProcessingStartTime()
public final long getProcessingStopTime()
OperationgetProcessingStopTime in interface OperationgetProcessingStopTime in interface PostResponseOperationpublic final void setProcessingStopTime()
public final long getProcessingTime()
OperationgetProcessingTime in interface OperationgetProcessingTime in interface PostResponseOperationpublic final long getProcessingNanoTime()
OperationgetProcessingNanoTime in interface Operationpublic final void registerPostResponseCallback(Runnable callback)
OperationregisterPostResponseCallback in interface Operationcallback - The callback to be run once this operation has completed
and the response sent back to the client.protected final void invokePostResponseCallbacks()
public void updateOperationErrMsgAndResCode()
public boolean processOperationResult(PluginResult.OperationResult operationResult)
operationResult - the operation resulttrue if processing can continue, false otherwisepublic static boolean processOperationResult(Operation op, PluginResult.OperationResult opResult)
op - the operationopResult - the operation resulttrue if processing can continue, false otherwiseCopyright © 2010-2015 ForgeRock AS. All Rights Reserved.