org.opends.server.core
Class CompareOperationBasis

java.lang.Object
  extended by org.opends.server.types.AbstractOperation
      extended by org.opends.server.core.CompareOperationBasis
All Implemented Interfaces:
java.lang.Runnable, CompareOperation, Operation, PluginOperation, PostResponseCompareOperation, PostResponseOperation, PreParseCompareOperation, PreParseOperation

public class CompareOperationBasis
extends AbstractOperation
implements PreParseCompareOperation, CompareOperation, java.lang.Runnable, PostResponseCompareOperation

This class defines an operation that may be used to determine whether a specified entry in the Directory Server contains a given attribute-value pair.


Field Summary
 
Fields inherited from class org.opends.server.types.AbstractOperation
cancelRequest, cancelResult, clientConnection, messageID, NO_RESPONSE_CONTROLS, operationID, useNanoTime
 
Fields inherited from interface org.opends.server.types.Operation
LOCALBACKENDOPERATIONS
 
Constructor Summary
CompareOperationBasis(ClientConnection clientConnection, long operationID, int messageID, java.util.List<Control> requestControls, ByteString rawEntryDN, java.lang.String rawAttributeType, ByteString assertionValue)
          Creates a new compare operation with the provided information.
CompareOperationBasis(ClientConnection clientConnection, long operationID, int messageID, java.util.List<Control> requestControls, DN entryDN, AttributeType attributeType, ByteString assertionValue)
          Creates a new compare operation with the provided information.
 
Method Summary
 void addResponseControl(Control control)
          Adds the provided control to the set of controls to include in the response to the client.
 ByteString getAssertionValue()
          Retrieves the assertion value for this compare operation.
 AttributeType getAttributeType()
          Retrieves the attribute type for this compare operation.
 DN getEntryDN()
          Retrieves the DN of the entry to compare.
 Entry getEntryToCompare()
          Retrieves the entry to target with the compare operation.
 OperationType getOperationType()
          Retrieves the operation type for this operation.
 DN getProxiedAuthorizationDN()
          Retrieves the proxied authorization DN for this operation if proxied authorization has been requested.
 java.lang.String getRawAttributeType()
          Retrieves the raw attribute type for this compare operation.
 ByteString getRawEntryDN()
          Retrieves the raw, unprocessed entry DN as included in the client request.
 java.lang.String[][] getRequestLogElements()
          Retrieves a standard set of elements that should be logged in requests for this type of operation.
 java.util.List<Control> getResponseControls()
          Retrieves the set of controls to include in the response to the client.
 java.lang.String[][] getResponseLogElements()
          Retrieves a standard set of elements that should be logged in responses for this type of operation.
 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.
 void setAssertionValue(ByteString assertionValue)
          Specifies the assertion value for this compare operation.
 void setAttributeType(AttributeType attributeType)
          Specifies the attribute type for this compare operation.
 void setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
          Specifies the proxied authorization target DN for this compare operation.
 void setRawAttributeType(java.lang.String rawAttributeType)
          Specifies the raw attribute type for this compare operation.
 void setRawEntryDN(ByteString rawEntryDN)
          Specifies the raw, unprocessed entry DN as included in the client request.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this operation to the provided buffer.
 
Methods inherited from class org.opends.server.types.AbstractOperation
abort, addRequestControl, appendAdditionalLogMessage, appendErrorMessage, cancel, checkIfCanceled, disconnectClient, dontSynchronize, getAdditionalLogMessage, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getCancelRequest, getCancelResult, getClientConnection, getCommonLogElements, getConnectionID, getErrorMessage, getMatchedDN, getMessageID, getOperationID, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControls, getResultCode, isInternalOperation, isSynchronizationOperation, operationCompleted, removeAttachment, removeRequestControl, setAdditionalLogMessage, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInternalOperation, setMatchedDN, setProcessingStartTime, setProcessingStopTime, setReferralURLs, setResponseData, setResultCode, setSynchronizationOperation, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opends.server.types.operation.PreParseOperation
addRequestControl, appendAdditionalLogMessage, appendErrorMessage, getAdditionalLogMessage, getErrorMessage, removeRequestControl, setAdditionalLogMessage, setErrorMessage
 
Methods inherited from interface org.opends.server.types.Operation
abort, addRequestControl, appendAdditionalLogMessage, appendErrorMessage, cancel, checkIfCanceled, disconnectClient, dontSynchronize, getAdditionalLogMessage, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getCancelRequest, getCancelResult, getClientConnection, getCommonLogElements, getConnectionID, getErrorMessage, getMatchedDN, getMessageID, getOperationID, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControls, getResultCode, isInternalOperation, isSynchronizationOperation, operationCompleted, removeAttachment, removeRequestControl, setAdditionalLogMessage, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInternalOperation, setMatchedDN, setReferralURLs, setResponseData, setResultCode, setSynchronizationOperation, toString
 
Methods inherited from interface org.opends.server.types.operation.PostResponseOperation
getAdditionalLogMessage, getAuthorizationDN, getErrorMessage, getMatchedDN, getProcessingStopTime, getProcessingTime, getReferralURLs, getResultCode
 
Methods inherited from interface org.opends.server.types.operation.PluginOperation
checkIfCanceled, disconnectClient, getAttachment, getAttachments, getClientConnection, getConnectionID, getMessageID, getOperationID, getProcessingStartTime, getRequestControls, isInternalOperation, isSynchronizationOperation, removeAttachment, setAttachment, toString
 

Constructor Detail

CompareOperationBasis

public CompareOperationBasis(ClientConnection clientConnection,
                             long operationID,
                             int messageID,
                             java.util.List<Control> requestControls,
                             ByteString rawEntryDN,
                             java.lang.String rawAttributeType,
                             ByteString assertionValue)
Creates a new compare operation with the provided information.

Parameters:
clientConnection - The client connection with which this operation is associated.
operationID - The operation ID for this operation.
messageID - The message ID of the request with which this operation is associated.
requestControls - The set of controls included in the request.
rawEntryDN - The raw, unprocessed entry DN as provided in the client request. This may or may not be a valid DN as no validation will have been performed yet.
rawAttributeType - The raw attribute type for the compare operation.
assertionValue - The assertion value for the compare operation.

CompareOperationBasis

public CompareOperationBasis(ClientConnection clientConnection,
                             long operationID,
                             int messageID,
                             java.util.List<Control> requestControls,
                             DN entryDN,
                             AttributeType attributeType,
                             ByteString assertionValue)
Creates a new compare operation with the provided information.

Parameters:
clientConnection - The client connection with which this operation is associated.
operationID - The operation ID for this operation.
messageID - The message ID of the request with which this operation is associated.
requestControls - The set of controls included in the request.
entryDN - The entry DN for this compare operation.
attributeType - The attribute type for this compare operation.
assertionValue - The assertion value for the compare operation.
Method Detail

getRawEntryDN

public final ByteString getRawEntryDN()
Retrieves the raw, unprocessed entry DN as included in the client request.

Specified by:
getRawEntryDN in interface CompareOperation
Specified by:
getRawEntryDN in interface PostResponseCompareOperation
Specified by:
getRawEntryDN in interface PreParseCompareOperation
Returns:
The raw, unprocessed entry DN as included in the client request.

setRawEntryDN

public final void setRawEntryDN(ByteString rawEntryDN)
Specifies the raw, unprocessed entry DN as included in the client request.

Specified by:
setRawEntryDN in interface CompareOperation
Specified by:
setRawEntryDN in interface PreParseCompareOperation
Parameters:
rawEntryDN - The raw entry DN for this compare operation.

getEntryDN

public final DN getEntryDN()
Retrieves the DN of the entry to compare. This should not be called by pre-parse plugins because the processed DN will not be available yet. Instead, they should call the getRawEntryDN method.

Specified by:
getEntryDN in interface CompareOperation
Specified by:
getEntryDN in interface PostResponseCompareOperation
Returns:
The DN of the entry to compare, or null if the raw entry DN has not yet been processed.

getRawAttributeType

public final java.lang.String getRawAttributeType()
Retrieves the raw attribute type for this compare operation.

Specified by:
getRawAttributeType in interface CompareOperation
Specified by:
getRawAttributeType in interface PostResponseCompareOperation
Specified by:
getRawAttributeType in interface PreParseCompareOperation
Returns:
The raw attribute type for this compare operation.

setRawAttributeType

public final void setRawAttributeType(java.lang.String rawAttributeType)
Specifies the raw attribute type for this compare operation.

Specified by:
setRawAttributeType in interface CompareOperation
Specified by:
setRawAttributeType in interface PreParseCompareOperation
Parameters:
rawAttributeType - The raw attribute type for this compare operation.

getAttributeType

public final AttributeType getAttributeType()
Retrieves the attribute type for this compare operation. This should not be called by pre-parse plugins because the processed attribute type will not be available yet.

Specified by:
getAttributeType in interface CompareOperation
Specified by:
getAttributeType in interface PostResponseCompareOperation
Returns:
The attribute type for this compare operation.

setAttributeType

public void setAttributeType(AttributeType attributeType)
Specifies the attribute type for this compare operation.

Specified by:
setAttributeType in interface CompareOperation
Parameters:
attributeType - The attribute type for this compare operation.

getAssertionValue

public final ByteString getAssertionValue()
Retrieves the assertion value for this compare operation.

Specified by:
getAssertionValue in interface CompareOperation
Specified by:
getAssertionValue in interface PostResponseCompareOperation
Specified by:
getAssertionValue in interface PreParseCompareOperation
Returns:
The assertion value for this compare operation.

setAssertionValue

public final void setAssertionValue(ByteString assertionValue)
Specifies the assertion value for this compare operation.

Specified by:
setAssertionValue in interface CompareOperation
Specified by:
setAssertionValue in interface PreParseCompareOperation
Parameters:
assertionValue - The assertion value for this compare operation.

getOperationType

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

Specified by:
getOperationType in interface Operation
Specified by:
getOperationType in interface PluginOperation
Specified by:
getOperationType in class AbstractOperation
Returns:
The operation type for this operation.

getRequestLogElements

public final java.lang.String[][] getRequestLogElements()
Retrieves a standard set of elements that should be logged in requests for this type of operation. Each element in the array will itself be a two-element array in which the first element is the name of the field and the second is a string representation of the value, or null if there is no value for that field.

Specified by:
getRequestLogElements in interface Operation
Specified by:
getRequestLogElements in class AbstractOperation
Returns:
A standard set of elements that should be logged in requests for this type of operation.

getResponseLogElements

public final java.lang.String[][] getResponseLogElements()
Retrieves a standard set of elements that should be logged in responses for this type of operation. Each element in the array will itself be a two-element array in which the first element is the name of the field and the second is a string representation of the value, or null if there is no value for that field.

Specified by:
getResponseLogElements in interface Operation
Specified by:
getResponseLogElements in class AbstractOperation
Returns:
A standard set of elements that should be logged in responses for this type of operation.

getProxiedAuthorizationDN

public DN getProxiedAuthorizationDN()
Retrieves the proxied authorization DN for this operation if proxied authorization has been requested.

Specified by:
getProxiedAuthorizationDN in interface CompareOperation
Returns:
The proxied authorization DN for this operation if proxied authorization has been requested, or null if proxied authorization has not been requested.

setProxiedAuthorizationDN

public void setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
Specifies the proxied authorization target DN for this compare operation.

Specified by:
setProxiedAuthorizationDN in interface CompareOperation
Parameters:
proxiedAuthorizationDN - The proxied authorization target DN for this compare operation

getResponseControls

public final 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.

Specified by:
getResponseControls in interface Operation
Specified by:
getResponseControls in interface PluginOperation
Specified by:
getResponseControls in class AbstractOperation
Returns:
The set of controls to include in the response to the client.

addResponseControl

public final void addResponseControl(Control control)
Adds the provided control to the set of controls to include in the response to the client. This method may not be called by post-response plugins.

Specified by:
addResponseControl in interface Operation
Specified by:
addResponseControl in interface PreParseOperation
Specified by:
addResponseControl in class AbstractOperation
Parameters:
control - The control to add to the set of controls to include in the response to the client.

removeResponseControl

public final void removeResponseControl(Control control)
Removes the provided control from the set of controls to include in the response to the client. This method may not be called by post-response plugins.

Specified by:
removeResponseControl in interface Operation
Specified by:
removeResponseControl in interface PreParseOperation
Specified by:
removeResponseControl in class AbstractOperation
Parameters:
control - The control to remove from the set of controls to include in the response to the client.

run

public final void run()
Performs the work of actually processing this operation. This should include all processing for the operation, including invoking plugins, logging messages, performing access control, managing synchronization, and any other work that might need to be done in the course of processing.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class AbstractOperation

toString

public final void toString(java.lang.StringBuilder buffer)
Appends a string representation of this operation to the provided buffer.

Specified by:
toString in interface Operation
Specified by:
toString in interface PluginOperation
Specified by:
toString in class AbstractOperation
Parameters:
buffer - The buffer into which a string representation of this operation should be appended.

getEntryToCompare

public Entry getEntryToCompare()
Retrieves the entry to target with the compare operation. This method always returns null.

Specified by:
getEntryToCompare in interface PostResponseCompareOperation
Returns:
The entry to target with the compare operation.