Interface PluginOperation
- All Known Subinterfaces:
InProgressOperation,InProgressSearchOperation,PostCommitAddOperation,PostCommitDeleteOperation,PostCommitModifyDNOperation,PostCommitModifyOperation,PostCommitOperation,PostOperationAbandonOperation,PostOperationAddOperation,PostOperationBindOperation,PostOperationCompareOperation,PostOperationDeleteOperation,PostOperationExtendedOperation,PostOperationModifyDNOperation,PostOperationModifyOperation,PostOperationOperation,PostOperationSearchOperation,PostOperationUnbindOperation,PostResponseAddOperation,PostResponseBindOperation,PostResponseCompareOperation,PostResponseDeleteOperation,PostResponseExtendedOperation,PostResponseModifyDNOperation,PostResponseModifyOperation,PostResponseOperation,PostResponseSearchOperation,PostSynchronizationAddOperation,PostSynchronizationDeleteOperation,PostSynchronizationModifyDNOperation,PostSynchronizationModifyOperation,PostSynchronizationOperation,PreOperationAddOperation,PreOperationBindOperation,PreOperationCompareOperation,PreOperationDeleteOperation,PreOperationExtendedOperation,PreOperationModifyDNOperation,PreOperationModifyOperation,PreOperationOperation,PreOperationSearchOperation,PreParseAbandonOperation,PreParseAddOperation,PreParseBindOperation,PreParseCompareOperation,PreParseDeleteOperation,PreParseExtendedOperation,PreParseModifyDNOperation,PreParseModifyOperation,PreParseOperation,PreParseSearchOperation,PreParseUnbindOperation,SubordinateModifyDNOperation
- All Known Implementing Classes:
AbandonOperation,AddOperation,BindOperation,CompareOperation,DeleteOperation,ExtendedOperation,ModifyDnOperation,ModifyOperation,Operation,SearchOperation,UnbindOperation
public interface PluginOperation
This class defines a set of methods that are available for use by all types of plugins involved in operation
processing (pre-parse, pre-operation, post-operation, post-response, search result entry, search result reference,
and intermediate response). Note that this interface is intended only to define an API for use by plugins and is not
intended to be implemented by any custom classes.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcheckIfCanceled(boolean signalTooLate) Checks to see if this operation requested to cancel in which caseCancelledResultExceptionwill be thrown.<T> TgetAttachment(String name) Retrieves the attachment with the specified name.Retrieves the set of attachments defined for this operation, as a mapping between the attachment name and the associated object.Retrieves the client connection with which this operation is associated.longRetrieves the unique identifier that is assigned to the client connection that submitted this operation.intRetrieves the message ID assigned to this operation.longRetrieves the operation ID for this operation.Returns the request associated to this operation.default <T extends Control>
TRetrieves a control included in the request from the client using the default decode options.<T extends Control>
TgetRequestControl(ControlDecoder<T> d, DecodeOptions options) Retrieves a control included in the request from the client.Retrieves the set of controls included in the request from the client.Retrieves the set of controls to include in the response to the client.booleanhasPrivilege(Privilege privilege) Returnstrueif this operation has the provided privilege.booleanIndicates whether this is an internal operation rather than one that was requested by an external client.booleanIndicates whether this is a synchronization operation rather than one that was requested by an external client.voidsetAttachment(String name, Object value) Sets the value of the specified attachment.toString()Retrieves a string representation of this operation.voidtoString(StringBuilder buffer) Appends a string representation of this operation to the provided buffer.
-
Method Details
-
getClientConnection
ClientConnection getClientConnection()Retrieves the client connection with which this operation is associated.- Returns:
- The client connection with which this operation is associated.
-
getConnectionID
long getConnectionID()Retrieves the unique identifier that is assigned to the client connection that submitted this operation.- Returns:
- The unique identifier that is assigned to the client connection that submitted this operation.
-
getOperationID
long getOperationID()Retrieves the operation ID for this operation.- Returns:
- The operation ID for this operation.
-
getMessageID
int getMessageID()Retrieves the message ID assigned to this operation.- Returns:
- The message ID assigned to this operation.
-
getRequest
Request getRequest()Returns the request associated to this operation.- Returns:
- The request associated to this operation.
-
getRequestControls
Retrieves the set of controls included in the request from the client. The returned this list must not be altered.- Returns:
- The set of controls included in the request from the client.
Note: the list of request controls can be modified by the server. Therefore
PluginOperation.getRequestControls()may return a list different from the list returned byPluginOperation.getRequest().getControls().
-
getRequestControl
Retrieves a control included in the request from the client using the default decode options.- 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:
LdapException- if an error occurs while decoding the control.Note: the list of request controls can be modified by the server. Therefore
PluginOperation.getRequestControls(ControlDecoder<T> d)may return a list different from the list returned byPluginOperation.getRequest().getControls().
-
getRequestControl
<T extends Control> T getRequestControl(ControlDecoder<T> d, DecodeOptions options) throws LdapException Retrieves a control included in the request from the client.- Type Parameters:
T- The type of control requested.- Parameters:
d- The requested control's decoder.options- The decode options.- Returns:
- The decoded form of the requested control included in the request from the client or
nullif the control was not found. - Throws:
LdapException- if an error occurs while decoding the control.Note: the list of request controls can be modified by the server. Therefore
PluginOperation.getRequestControls(ControlDecoder<T> d, DecodeOptions options)may return a list different from the list returned byPluginOperation.getRequest().getControls().
-
getResponseControls
Retrieves the set of controls to include in the response to the client. The contents of this list must not be altered.- Returns:
- The set of controls to include in the response to the client.
-
isInternalOperation
boolean isInternalOperation()Indicates whether this is an internal operation rather than one that was requested by an external client.- Returns:
trueif this is an internal operation, orfalseif it is not.
-
isSynchronizationOperation
boolean isSynchronizationOperation()Indicates whether this is a synchronization operation rather than one that was requested by an external client.- Returns:
trueif this is a data synchronization operation, orfalseif it is not.
-
getAttachments
Retrieves the set of attachments defined for this operation, as a mapping between the attachment name and the associated object.- Returns:
- The set of attachments defined for this operation.
-
getAttachment
Retrieves the attachment with the specified name.- 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.
-
setAttachment
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.- Parameters:
name- The name to use for the attachment.value- The value to use for the attachment.
-
toString
String toString()Retrieves a string representation of this operation. -
toString
Appends a string representation of this operation to the provided buffer.- Parameters:
buffer- The buffer into which a string representation of this operation should be appended.
-
checkIfCanceled
Checks to see if this operation requested to cancel in which caseCancelledResultExceptionwill be thrown.- Parameters:
signalTooLate-trueto signal that any further cancel requests will be too late after return from this call orfalseotherwise.- Throws:
CancelledResultException- if this operation should be cancelled.
-
hasPrivilege
Returnstrueif this operation has the provided privilege.- Parameters:
privilege- the privilege to test- Returns:
- true if this operation has the provided privilege.
-