org.opends.server.types.operation
Interface PluginOperation

All Known Subinterfaces:
InProgressOperation, ModifyDNOperation, 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, SearchEntrySearchOperation, SearchReferenceSearchOperation, SubordinateModifyDNOperation
All Known Implementing Classes:
AbandonOperationBasis, AbstractOperation, AddOperationBasis, BindOperationBasis, CompareOperationBasis, DeleteOperationBasis, ExtendedOperationBasis, InternalSearchOperation, LocalBackendAddOperation, LocalBackendBindOperation, LocalBackendCompareOperation, LocalBackendDeleteOperation, LocalBackendModifyDNOperation, LocalBackendModifyOperation, LocalBackendSearchOperation, ModifyDNOperationBasis, ModifyDNOperationWrapper, ModifyOperationBasis, SearchOperationBasis, UnbindOperationBasis

@PublicAPI(stability=UNCOMMITTED,
           mayInstantiate=false,
           mayExtend=false,
           mayInvoke=true)
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
 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.
 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.
 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.
 int getMessageID()
          Retrieves the message ID assigned to this operation.
 long getOperationID()
          Retrieves the operation ID for this operation.
 OperationType getOperationType()
          Retrieves the operation type for this operation.
 long getProcessingStartTime()
          Retrieves the time that processing started for this operation.
 java.util.List<Control> getRequestControls()
          Retrieves the set of controls included in the request from the client.
 java.util.List<Control> getResponseControls()
          Retrieves the set of controls to include in the response to the 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.
 java.lang.Object removeAttachment(java.lang.String name)
          Removes the attachment with the specified name.
 java.lang.Object setAttachment(java.lang.String name, java.lang.Object value)
          Sets the value of the specified attachment.
 java.lang.String toString()
          Retrieves a string representation of this operation.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this operation to the provided buffer.
 

Method Detail

getOperationType

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

Returns:
The operation type for this operation.

getClientConnection

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

Returns:
The client connection with which this operation is associated.

disconnectClient

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

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.

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.

getRequestControls

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

Returns:
The set of controls included in the request from the client.

getResponseControls

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.

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:
true if this is an internal operation, or false if it is not.

isSynchronizationOperation

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

Returns:
true if this is a data synchronization operation, or false if it is not.

getAttachments

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.

Returns:
The set of attachments defined for this operation.

getAttachment

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

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

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

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

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.

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.

getProcessingStartTime

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

Returns:
The time that processing started for this operation.

toString

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

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this operation.

toString

void toString(java.lang.StringBuilder buffer)
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

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

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.