W - the type of the object wrapped by this classpublic class OperationWrapper<W extends Operation> extends Object implements Operation
LOCALBACKENDOPERATIONS| Constructor and Description |
|---|
OperationWrapper(W operation)
Creates a new generic operation wrapper.
|
| 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 |
addResponseControl(Control control)
Adds the provided control to the set of controls to include in
the response to the client.
|
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.
|
protected W |
getOperation()
Returns the wrapped
Operation. |
long |
getOperationID()
Retrieves the operation ID for this operation.
|
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.
|
DN |
getProxiedAuthorizationDN()
Retrieves the proxied authorization DN for this operation if proxied
authorization has been requested.
|
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.
|
List<Control> |
getResponseControls()
Retrieves the set of controls to include in the response to the
client.
|
org.forgerock.opendj.ldap.ResultCode |
getResultCode()
Retrieves the result code for this operation.
|
int |
hashCode() |
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.
|
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.
|
void |
removeResponseControl(Control control)
Removes the provided control from the set of controls to include
in the response to the client.
|
void |
run()
Performs the work of actually processing this operation.
|
<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 |
setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
Set the proxied authorization DN for this operation if proxied
authorization has been requested.
|
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 |
toString(StringBuilder buffer)
Appends a string representation of this operation to the provided
buffer.
|
public OperationWrapper(W operation)
operation - the generic operation to wrappublic void addRequestControl(Control control)
addRequestControl in interface Operationcontrol - The control to add to the set of request
controls for this operation.public void addResponseControl(Control control)
addResponseControl in interface Operationcontrol - The control to add to the set of controls to
include in the response to the client.public void appendErrorMessage(LocalizableMessage message)
appendErrorMessage in interface Operationmessage - The message to append to the error messagepublic void appendMaskedErrorMessage(LocalizableMessage maskedMessage)
appendMaskedErrorMessage in interface OperationmaskedMessage - The message to append to the real, masked error messagepublic CancelResult cancel(CancelRequest cancelRequest)
public void abort(CancelRequest cancelRequest)
public void disconnectClient(DisconnectReason disconnectReason, boolean sendNotification, LocalizableMessage message)
disconnectClient in interface OperationdisconnectReason - 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 boolean dontSynchronize()
dontSynchronize in interface Operationtrue if this operation should not be
synchronized, or false if it should be
synchronized.public <T> T getAttachment(String name)
getAttachment in interface OperationT - 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 Map<String,Object> getAttachments()
getAttachments in interface Operationpublic DN getAuthorizationDN()
getAuthorizationDN in interface Operationpublic Entry getAuthorizationEntry()
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.getAuthorizationEntry in interface Operationnull if the authorization identity should be the
unauthenticated user.public DN getProxiedAuthorizationDN()
getProxiedAuthorizationDN in interface Operationnull if proxied
authorization has not been requested.public void setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
setProxiedAuthorizationDN in interface OperationproxiedAuthorizationDN - The proxied authorization DN for this operation if proxied
authorization has been requested, or null if proxied
authorization has not been requested.public CancelRequest getCancelRequest()
getCancelRequest in interface Operationnull if there has not been any
request to cancel.public CancelResult getCancelResult()
getCancelResult in interface Operationnull if the operation has not seen and reacted
to a cancel request.public ClientConnection getClientConnection()
getClientConnection in interface Operationpublic long getConnectionID()
getConnectionID in interface Operationpublic LocalizableMessageBuilder getErrorMessage()
getErrorMessage in interface Operationpublic LocalizableMessageBuilder getMaskedErrorMessage()
getMaskedErrorMessage in interface Operationpublic org.forgerock.opendj.ldap.ResultCode getMaskedResultCode()
getMaskedResultCode in interface OperationUNDEFINED if the operation has not yet completed.public DN getMatchedDN()
getMatchedDN in interface Operationnull if
the operation has not yet completed or does not have a
matched DN.public int getMessageID()
getMessageID in interface Operationprotected W getOperation()
Operation.Operation.public long getOperationID()
getOperationID in interface Operationpublic OperationType getOperationType()
getOperationType in interface Operationpublic long getProcessingStartTime()
getProcessingStartTime in interface Operationpublic long getProcessingStopTime()
getProcessingStopTime in interface Operationpublic long getProcessingTime()
getProcessingTime in interface Operationpublic long getProcessingNanoTime()
getProcessingNanoTime in interface Operationpublic List<String> getReferralURLs()
getReferralURLs in interface Operationnull if the operation is not yet complete or
does not have a set of referral URLs.public List<Control> getRequestControls()
getRequestControls in interface Operationpublic <T extends Control> T getRequestControl(ControlDecoder<T> d) throws DirectoryException
getRequestControl in interface OperationT - 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 List<Control> getResponseControls()
getResponseControls in interface Operationpublic org.forgerock.opendj.ldap.ResultCode getResultCode()
getResultCode in interface OperationUNDEFINED if the operation has not yet
completed.public boolean isInnerOperation()
isInnerOperation in interface Operationtrue if this is an inner operation, or false if it
is not.public boolean isInternalOperation()
isInternalOperation in interface Operationtrue if this is an internal operation, or
false if it is not.public boolean isSynchronizationOperation()
isSynchronizationOperation in interface Operationtrue if this is a data synchronization
operation, or false if it is not.public void operationCompleted()
operationCompleted in interface Operationpublic <T> T removeAttachment(String name)
removeAttachment in interface OperationT - 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 void removeResponseControl(Control control)
removeResponseControl in interface Operationcontrol - The control to remove from the set of controls
to include in the response to the client.public <T> T setAttachment(String name, Object value)
setAttachment in interface OperationT - 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 void setAttachments(Map<String,Object> attachments)
setAttachments in interface Operationattachments - - Attachments to register within the
operationpublic void setAuthorizationEntry(Entry authorizationEntry)
setAuthorizationEntry 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 void setDontSynchronize(boolean dontSynchronize)
setDontSynchronize in interface OperationdontSynchronize - Specifies whether this operation must be
synchronized to other copies
of the data.public void setErrorMessage(LocalizableMessageBuilder errorMessage)
setErrorMessage in interface OperationerrorMessage - The error message for this operation.public void setInnerOperation(boolean isInnerOperation)
setInnerOperation in interface OperationisInnerOperation - Specifies whether this is an inner operation rather than one that
was requested by an external client.public void setInternalOperation(boolean isInternalOperation)
setInternalOperation in interface OperationisInternalOperation - Specifies whether this is an
internal operation rather than one
that was requested by an external
client.public void setMaskedErrorMessage(LocalizableMessageBuilder maskedErrorMessage)
setMaskedErrorMessage in interface OperationmaskedErrorMessage - The real, masked error message for this operation.public void setMaskedResultCode(org.forgerock.opendj.ldap.ResultCode maskedResultCode)
setMaskedResultCode in interface OperationmaskedResultCode - The real, masked result code for this operation.public void setMatchedDN(DN matchedDN)
setMatchedDN in interface OperationmatchedDN - The matched DN for this operation.public void setReferralURLs(List<String> referralURLs)
setReferralURLs in interface OperationreferralURLs - The set of referral URLs for this
operation.public void setResponseData(DirectoryException directoryException)
DirectoryException
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 void setResultCode(org.forgerock.opendj.ldap.ResultCode resultCode)
setResultCode in interface OperationresultCode - The result code for this operation.public void setSynchronizationOperation(boolean isSynchronizationOperation)
setSynchronizationOperation in interface OperationisSynchronizationOperation - Specifies whether this is a
synchronization operation
rather than one that was
requested by an external
client.public void toString(StringBuilder buffer)
public final void checkIfCanceled(boolean signalTooLate) throws CanceledOperationException
checkIfCanceled in interface OperationsignalTooLate - 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 void registerPostResponseCallback(Runnable callback)
registerPostResponseCallback in interface Operationcallback - The callback to be run once this operation has completed
and the response sent back to the client.public void run()
public List<AdditionalLogItem> getAdditionalLogItems()
getAdditionalLogItems in interface Operationpublic void addAdditionalLogItem(AdditionalLogItem item)
addAdditionalLogItem in interface Operationitem - The additional log item for this operation.Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.