org.opends.server.core
Class AddOperationWrapper

java.lang.Object
  extended by org.opends.server.core.OperationWrapper
      extended by org.opends.server.core.AddOperationWrapper
All Implemented Interfaces:
AddOperation, Operation
Direct Known Subclasses:
LocalBackendAddOperation

public abstract class AddOperationWrapper
extends OperationWrapper
implements AddOperation

This abstract class wraps/decorates a given add operation. This class will be extended by sub-classes to enhance the functionnality of the AddOperationBasis.


Field Summary
 
Fields inherited from interface org.opends.server.types.Operation
LOCALBACKENDOPERATIONS
 
Constructor Summary
AddOperationWrapper(AddOperation add)
          Creates a new add operation based on the provided add operation.
 
Method Summary
 void addObjectClass(ObjectClass objectClass, java.lang.String name)
          Adds the provided objectclass to the entry to add.
 void addRawAttribute(RawAttribute rawAttribute)
          Adds the provided attribute to the set of raw attributes for this add operation.
 long getChangeNumber()
          Retrieves the change number that has been assigned to this operation.
 DN getEntryDN()
          Retrieves the DN of the entry to add.
 java.util.Map<ObjectClass,java.lang.String> getObjectClasses()
          Retrieves the set of processed objectclasses for the entry to add.
 java.util.Map<AttributeType,java.util.List<Attribute>> getOperationalAttributes()
          Retrieves the set of processed operational attributes for the entry to add.
 DN getProxiedAuthorizationDN()
          Retrieves the proxied authorization DN for this operation if proxied authorization has been requested.
 java.util.List<RawAttribute> getRawAttributes()
          Retrieves the set of attributes in their raw, unparsed form as read from the client request.
 ByteString getRawEntryDN()
          Retrieves the DN of the entry to add in a raw, unparsed form as it was included in the request.
 java.util.Map<AttributeType,java.util.List<Attribute>> getUserAttributes()
          Retrieves the set of processed user attributes for the entry to add.
 void removeAttribute(AttributeType attributeType)
          Removes the specified attribute from the entry to add.
 void removeObjectClass(ObjectClass objectClass)
          Removes the provided objectclass from the entry to add.
 void setAttribute(AttributeType attributeType, java.util.List<Attribute> attributeList)
          Sets the specified attribute in the entry to add, overwriting any existing attribute of the specified type if necessary.
 void setChangeNumber(long changeNumber)
          Specifies the change number that has been assigned to this operation by the synchronization mechanism.
 void setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
          Set the proxied authorization DN for this operation if proxied authorization has been requested.
 void setRawAttributes(java.util.List<RawAttribute> rawAttributes)
          Replaces the set of raw attributes for this add operation.
 void setRawEntryDN(ByteString rawEntryDN)
          Specifies the raw entry DN for the entry to add.
 java.lang.String toString()
          Retrieves a string representation of this operation.
 
Methods inherited from class org.opends.server.core.OperationWrapper
abort, addRequestControl, addResponseControl, appendAdditionalLogMessage, appendErrorMessage, cancel, checkIfCanceled, disconnectClient, dontSynchronize, getAdditionalLogMessage, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getCancelRequest, getCancelResult, getClientConnection, getCommonLogElements, getConnectionID, getErrorMessage, getMatchedDN, getMessageID, getOperationID, getOperationType, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControls, getRequestLogElements, getResponseControls, getResponseLogElements, getResultCode, isInternalOperation, isSynchronizationOperation, operationCompleted, removeAttachment, removeRequestControl, removeResponseControl, setAdditionalLogMessage, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInternalOperation, setMatchedDN, 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
abort, addRequestControl, addResponseControl, appendAdditionalLogMessage, appendErrorMessage, cancel, checkIfCanceled, disconnectClient, dontSynchronize, getAdditionalLogMessage, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getCancelRequest, getCancelResult, getClientConnection, getCommonLogElements, getConnectionID, getErrorMessage, getMatchedDN, getMessageID, getOperationID, getOperationType, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControls, getRequestLogElements, getResponseControls, getResponseLogElements, getResultCode, isInternalOperation, isSynchronizationOperation, operationCompleted, removeAttachment, removeRequestControl, removeResponseControl, setAdditionalLogMessage, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInternalOperation, setMatchedDN, setReferralURLs, setResponseData, setResultCode, setSynchronizationOperation, toString
 

Constructor Detail

AddOperationWrapper

public AddOperationWrapper(AddOperation add)
Creates a new add operation based on the provided add operation.

Parameters:
add - The add operation to wrap
Method Detail

addObjectClass

public void addObjectClass(ObjectClass objectClass,
                           java.lang.String name)
Adds the provided objectclass to the entry to add. This should only be called from pre-operation plugins. Note that pre-operation plugin processing is invoked after access control and schema validation, so plugins should be careful to only make changes that will not violate either schema or access control rules.

Specified by:
addObjectClass in interface AddOperation
Parameters:
objectClass - The objectclass to add to the entry.
name - The name to use for the objectclass.

addRawAttribute

public void addRawAttribute(RawAttribute rawAttribute)
Adds the provided attribute to the set of raw attributes for this add operation. This should only be called by pre-parse plugins.

Specified by:
addRawAttribute in interface AddOperation
Parameters:
rawAttribute - The attribute to add to the set of raw attributes for this add operation.

getChangeNumber

public long getChangeNumber()
Retrieves the change number that has been assigned to this operation.

Specified by:
getChangeNumber in interface AddOperation
Returns:
The change number that has been assigned to this operation, or -1 if none has been assigned yet or if there is no applicable synchronization mechanism in place that uses change numbers.

getEntryDN

public DN getEntryDN()
Retrieves the DN of the entry to add. This method should not be called by pre-parse plugins because the parsed DN will not be available at that time.

Specified by:
getEntryDN in interface AddOperation
Returns:
The DN of the entry to add, or null if it has not yet been parsed from the raw DN.

getObjectClasses

public java.util.Map<ObjectClass,java.lang.String> getObjectClasses()
Retrieves the set of processed objectclasses for the entry to add. This should not be called by pre-parse plugins because this information will not yet be available. The contents of the returned map may not be altered by the caller.

Specified by:
getObjectClasses in interface AddOperation
Returns:
The set of processed objectclasses for the entry to add, or null if that information is not yet available.

getOperationalAttributes

public java.util.Map<AttributeType,java.util.List<Attribute>> getOperationalAttributes()
Retrieves the set of processed operational attributes for the entry to add. This should not be called by pre-parse plugins because this information will not yet be available. The contents of the returned map may be altered by the caller.

Specified by:
getOperationalAttributes in interface AddOperation
Returns:
The set of processed operational attributes for the entry to add, or null if that information is not yet available.

getRawAttributes

public java.util.List<RawAttribute> getRawAttributes()
Retrieves the set of attributes in their raw, unparsed form as read from the client request. Some of these attributes may be invalid as no validation will have been performed on them. The returned list must not be altered by the caller.

Specified by:
getRawAttributes in interface AddOperation
Returns:
The set of attributes in their raw, unparsed form as read from the client request.

getRawEntryDN

public ByteString getRawEntryDN()
Retrieves the DN of the entry to add in a raw, unparsed form as it was included in the request. This may or may not actually contain a valid DN, since no validation will have been performed on it.

Specified by:
getRawEntryDN in interface AddOperation
Returns:
The DN of the entry in a raw, unparsed form.

getUserAttributes

public java.util.Map<AttributeType,java.util.List<Attribute>> getUserAttributes()
Retrieves the set of processed user attributes for the entry to add. This should not be called by pre-parse plugins because this information will not yet be available. The contents of the returned map may be altered by the caller.

Specified by:
getUserAttributes in interface AddOperation
Returns:
The set of processed user attributes for the entry to add, or null if that information is not yet available.

removeAttribute

public void removeAttribute(AttributeType attributeType)
Removes the specified attribute from the entry to add. This should only be called from pre-operation plugins. Note that pre-operation processing is invoked after access control and schema validation, so plugins should be careful to only make changes that will not violate either schema or access control rules.

Specified by:
removeAttribute in interface AddOperation
Parameters:
attributeType - The attribute tyep for the attribute to remove.

removeObjectClass

public void removeObjectClass(ObjectClass objectClass)
Removes the provided objectclass from the entry to add. This should only be called from pre-operation plugins. Note that pre-operation plugin processing is invoked after access control and schema validation, so plugins should be careful to only make changes that will not violate either schema or access control rules.

Specified by:
removeObjectClass in interface AddOperation
Parameters:
objectClass - The objectclass to remove from the entry.

setAttribute

public void setAttribute(AttributeType attributeType,
                         java.util.List<Attribute> attributeList)
Sets the specified attribute in the entry to add, overwriting any existing attribute of the specified type if necessary. This should only be called from pre-operation plugins. Note that pre-operation plugin processing is invoked after access control and schema validation, so plugins should be careful to only make changes that will not violate either schema or access control rules.

Specified by:
setAttribute in interface AddOperation
Parameters:
attributeType - The attribute type for the attribute.
attributeList - The attribute list for the provided attribute type.

setChangeNumber

public void setChangeNumber(long changeNumber)
Specifies the change number that has been assigned to this operation by the synchronization mechanism.

Specified by:
setChangeNumber in interface AddOperation
Parameters:
changeNumber - The change number that has been assigned to this operation by the synchronization mechanism.

setRawAttributes

public void setRawAttributes(java.util.List<RawAttribute> rawAttributes)
Replaces the set of raw attributes for this add operation. This should only be called by pre-parse plugins.

Specified by:
setRawAttributes in interface AddOperation
Parameters:
rawAttributes - The set of raw attributes for this add operation.

setRawEntryDN

public void setRawEntryDN(ByteString rawEntryDN)
Specifies the raw entry DN for the entry to add. This should only be called by pre-parse plugins to alter the DN before it has been processed. If the entry DN needs to be altered later in the process, then it should be done using the getEntryDN and setEntryDN methods.

Specified by:
setRawEntryDN in interface AddOperation
Parameters:
rawEntryDN - The raw entry DN for the entry to add.

toString

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

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

getProxiedAuthorizationDN

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

Specified by:
getProxiedAuthorizationDN in interface AddOperation
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)
Set the proxied authorization DN for this operation if proxied authorization has been requested.

Specified by:
setProxiedAuthorizationDN in interface AddOperation
Parameters:
proxiedAuthorizationDN - The proxied authorization DN for this operation if proxied authorization has been requested, or null if proxied authorization has not been requested.