Package org.opends.server.core
Class AddOperationBasis
- java.lang.Object
-
- org.opends.server.types.AbstractOperation
-
- org.opends.server.core.AddOperationBasis
-
- All Implemented Interfaces:
Runnable,AddOperation,Operation,PluginOperation,PostResponseAddOperation,PostResponseOperation,PreParseAddOperation,PreParseOperation
public class AddOperationBasis extends AbstractOperation implements PreParseAddOperation, AddOperation, PostResponseAddOperation
This class defines an operation that may be used to add a new entry to the Directory Server.
-
-
Field Summary
-
Fields inherited from class org.opends.server.types.AbstractOperation
cancelRequest, cancelResult, clientConnection, messageID, NO_RESPONSE_CONTROLS, operationID
-
Fields inherited from interface org.opends.server.types.Operation
LOCALBACKENDOPERATIONS
-
-
Constructor Summary
Constructors Constructor Description AddOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, ByteString rawEntryDN, List<RawAttribute> rawAttributes)Creates a new add operation with the provided information.AddOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, Entry entry)Creates a new add operation with the provided information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddObjectClass(ObjectClass objectClass, String name)Adds the provided objectclass to the entry to add.voidaddRawAttribute(RawAttribute rawAttribute)Adds the provided attribute to the set of raw attributes for this add operation.voidaddResponseControl(Control control)Adds the provided control to the set of controls to include in the response to the client.DNgetEntryDN()Retrieves the DN of the entry to add.EntrygetEntryToAdd()Retrieves the entry to be added to the server.Map<ObjectClass,String>getObjectClasses()Retrieves the set of processed objectclasses for the entry to add.Map<AttributeType,List<Attribute>>getOperationalAttributes()Retrieves the set of processed operational attributes for the entry to add.OperationTypegetOperationType()Retrieves the operation type for this operation.DNgetProxiedAuthorizationDN()Retrieves the proxied authorization DN for this operation if proxied authorization has been requested.List<RawAttribute>getRawAttributes()Retrieves the set of attributes in their raw, unparsed form as read from the client request.ByteStringgetRawEntryDN()Retrieves the DN of the entry to add in a raw, unparsed form as it was included in the request.ArrayList<Control>getResponseControls()Retrieves the set of controls to include in the response to the client.Map<AttributeType,List<Attribute>>getUserAttributes()Retrieves the set of processed user attributes for the entry to add.voidremoveAttribute(AttributeType attributeType)Removes the specified attribute from the entry to add.voidremoveObjectClass(ObjectClass objectClass)Removes the provided objectclass from the entry to add.voidremoveResponseControl(Control control)Removes the provided control from the set of controls to include in the response to the client.voidrun()Performs the work of actually processing this operation.voidsetAttribute(AttributeType attributeType, List<Attribute> attributeList)Sets the specified attribute in the entry to add, overwriting any existing attribute of the specified type if necessary.voidsetProxiedAuthorizationDN(DN proxiedAuthorizationDN)Set the proxied authorization DN for this operation if proxied authorization has been requested.voidsetRawAttributes(List<RawAttribute> rawAttributes)Replaces the set of raw attributes for this add operation.voidsetRawEntryDN(ByteString rawEntryDN)Specifies the raw entry DN for the entry to add.voidtoString(StringBuilder buffer)Appends a string representation of this operation to the provided buffer.voidupdateOperationErrMsgAndResCode()Updates the error message and the result code of the operation.-
Methods inherited from class org.opends.server.types.AbstractOperation
abort, addAdditionalLogItem, addRequestControl, appendErrorMessage, appendMaskedErrorMessage, cancel, checkIfCanceled, disconnectClient, dontSynchronize, equals, getAdditionalLogItems, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getCancelRequest, getCancelResult, getClientConnection, getConnectionID, getErrorMessage, getMaskedErrorMessage, getMaskedResultCode, getMatchedDN, getMessageID, getOperationID, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControl, getRequestControls, getResultCode, getTransactionId, hashCode, invokePostResponseCallbacks, isInnerOperation, isInternalOperation, isSynchronizationOperation, operationCompleted, processOperationResult, processOperationResult, registerPostResponseCallback, removeAttachment, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInnerOperation, setInternalOperation, setMaskedErrorMessage, setMaskedResultCode, setMatchedDN, setProcessingStartTime, setProcessingStopTime, setReferralURLs, setResponseData, setResultCode, setSynchronizationOperation, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opends.server.types.Operation
abort, addAdditionalLogItem, addRequestControl, appendErrorMessage, appendMaskedErrorMessage, cancel, checkIfCanceled, disconnectClient, dontSynchronize, getAdditionalLogItems, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getCancelRequest, getCancelResult, getClientConnection, getConnectionID, getErrorMessage, getMaskedErrorMessage, getMaskedResultCode, getMatchedDN, getMessageID, getOperationID, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControl, getRequestControls, getResultCode, isInnerOperation, isInternalOperation, isSynchronizationOperation, operationCompleted, registerPostResponseCallback, removeAttachment, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInnerOperation, setInternalOperation, setMaskedErrorMessage, setMaskedResultCode, setMatchedDN, setReferralURLs, setResponseData, setResultCode, setSynchronizationOperation, toString
-
Methods inherited from interface org.opends.server.types.operation.PluginOperation
checkIfCanceled, disconnectClient, getAttachment, getAttachments, getClientConnection, getConnectionID, getMessageID, getOperationID, getProcessingStartTime, getRequestControl, getRequestControls, isInternalOperation, isSynchronizationOperation, removeAttachment, setAttachment, toString
-
Methods inherited from interface org.opends.server.types.operation.PostResponseOperation
getAdditionalLogItems, getAuthorizationDN, getErrorMessage, getMatchedDN, getProcessingStopTime, getProcessingTime, getReferralURLs, getResultCode
-
Methods inherited from interface org.opends.server.types.operation.PreParseOperation
addAdditionalLogItem, addRequestControl, appendErrorMessage, getAdditionalLogItems, getErrorMessage, setErrorMessage
-
-
-
-
Constructor Detail
-
AddOperationBasis
public AddOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, ByteString rawEntryDN, List<RawAttribute> rawAttributes)
Creates a new add 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 DN of the entry to add from the client request. This may or may not be a valid DN.rawAttributes- The raw set of attributes from the client request (including the objectclass attribute). This may contain invalid attributes.
-
AddOperationBasis
public AddOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, Entry entry)
Creates a new add 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.entry- The entry to add.
-
-
Method Detail
-
getRawEntryDN
public final ByteString getRawEntryDN()
Description copied from interface:PreParseAddOperationRetrieves 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:
getRawEntryDNin interfaceAddOperation- Specified by:
getRawEntryDNin interfacePostResponseAddOperation- Specified by:
getRawEntryDNin interfacePreParseAddOperation- Returns:
- The DN of the entry in a raw, unparsed form.
-
setRawEntryDN
public final void setRawEntryDN(ByteString rawEntryDN)
Description copied from interface:PreParseAddOperationSpecifies the raw entry DN for the entry to add.- Specified by:
setRawEntryDNin interfaceAddOperation- Specified by:
setRawEntryDNin interfacePreParseAddOperation- Parameters:
rawEntryDN- The raw entry DN for the entry to add.
-
getEntryDN
public final DN getEntryDN()
Description copied from interface:AddOperationRetrieves 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:
getEntryDNin interfaceAddOperation- Specified by:
getEntryDNin interfacePostResponseAddOperation- Returns:
- The DN of the entry to add, or
nullif it has not yet been parsed from the raw DN.
-
getRawAttributes
public final List<RawAttribute> getRawAttributes()
Description copied from interface:PreParseAddOperationRetrieves 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:
getRawAttributesin interfaceAddOperation- Specified by:
getRawAttributesin interfacePostResponseAddOperation- Specified by:
getRawAttributesin interfacePreParseAddOperation- Returns:
- The set of attributes in their raw, unparsed form as read from the client request.
-
addRawAttribute
public final void addRawAttribute(RawAttribute rawAttribute)
Description copied from interface:PreParseAddOperationAdds the provided attribute to the set of raw attributes for this add operation.- Specified by:
addRawAttributein interfaceAddOperation- Specified by:
addRawAttributein interfacePreParseAddOperation- Parameters:
rawAttribute- The attribute to add to the set of raw attributes for this add operation.
-
setRawAttributes
public final void setRawAttributes(List<RawAttribute> rawAttributes)
Description copied from interface:PreParseAddOperationReplaces the set of raw attributes for this add operation.- Specified by:
setRawAttributesin interfaceAddOperation- Specified by:
setRawAttributesin interfacePreParseAddOperation- Parameters:
rawAttributes- The set of raw attributes for this add operation.
-
getObjectClasses
public final Map<ObjectClass,String> getObjectClasses()
Description copied from interface:AddOperationRetrieves 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:
getObjectClassesin interfaceAddOperation- Specified by:
getObjectClassesin interfacePostResponseAddOperation- Returns:
- The set of processed objectclasses for the entry to add, or
nullif that information is not yet available.
-
addObjectClass
public final void addObjectClass(ObjectClass objectClass, String name)
Description copied from interface:AddOperationAdds 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:
addObjectClassin interfaceAddOperation- Parameters:
objectClass- The objectclass to add to the entry.name- The name to use for the objectclass.
-
removeObjectClass
public final void removeObjectClass(ObjectClass objectClass)
Description copied from interface:AddOperationRemoves 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:
removeObjectClassin interfaceAddOperation- Parameters:
objectClass- The objectclass to remove from the entry.
-
getUserAttributes
public final Map<AttributeType,List<Attribute>> getUserAttributes()
Description copied from interface:AddOperationRetrieves 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:
getUserAttributesin interfaceAddOperation- Specified by:
getUserAttributesin interfacePostResponseAddOperation- Returns:
- The set of processed user attributes for the entry to add, or
nullif that information is not yet available.
-
getOperationalAttributes
public final Map<AttributeType,List<Attribute>> getOperationalAttributes()
Description copied from interface:AddOperationRetrieves 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:
getOperationalAttributesin interfaceAddOperation- Specified by:
getOperationalAttributesin interfacePostResponseAddOperation- Returns:
- The set of processed operational attributes for the entry to add,
or
nullif that information is not yet available.
-
setAttribute
public final void setAttribute(AttributeType attributeType, List<Attribute> attributeList)
Description copied from interface:AddOperationSets 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:
setAttributein interfaceAddOperation- Parameters:
attributeType- The attribute type for the attribute.attributeList- The attribute list for the provided attribute type.
-
removeAttribute
public final void removeAttribute(AttributeType attributeType)
Description copied from interface:AddOperationRemoves 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:
removeAttributein interfaceAddOperation- Parameters:
attributeType- The attribute tyep for the attribute to remove.
-
getOperationType
public final OperationType getOperationType()
Description copied from interface:PluginOperationRetrieves the operation type for this operation.- Specified by:
getOperationTypein interfaceOperation- Specified by:
getOperationTypein interfacePluginOperation- Returns:
- The operation type for this operation.
-
getProxiedAuthorizationDN
public DN getProxiedAuthorizationDN()
Description copied from interface:AddOperationRetrieves the proxied authorization DN for this operation if proxied authorization has been requested.- Specified by:
getProxiedAuthorizationDNin interfaceAddOperation- Specified by:
getProxiedAuthorizationDNin interfaceOperation- Returns:
- The proxied authorization DN for this operation if proxied
authorization has been requested, or
nullif proxied authorization has not been requested.
-
getResponseControls
public final ArrayList<Control> getResponseControls()
Description copied from interface:PluginOperationRetrieves the set of controls to include in the response to the client. The contents of this list must not be altered.- Specified by:
getResponseControlsin interfaceOperation- Specified by:
getResponseControlsin interfacePluginOperation- Returns:
- The set of controls to include in the response to the client.
-
addResponseControl
public final void addResponseControl(Control control)
Description copied from interface:PreParseOperationAdds the provided control to the set of controls to include in the response to the client.- Specified by:
addResponseControlin interfaceOperation- Specified by:
addResponseControlin interfacePreParseOperation- 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)
Description copied from interface:PreParseOperationRemoves the provided control from the set of controls to include in the response to the client.- Specified by:
removeResponseControlin interfaceOperation- Specified by:
removeResponseControlin interfacePreParseOperation- Parameters:
control- The control to remove from the set of controls to include in the response to the client.
-
toString
public final void toString(StringBuilder buffer)
Description copied from interface:PluginOperationAppends a string representation of this operation to the provided buffer.- Specified by:
toStringin interfaceOperation- Specified by:
toStringin interfacePluginOperation- Parameters:
buffer- The buffer into which a string representation of this operation should be appended.
-
setProxiedAuthorizationDN
public void setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
Description copied from interface:AddOperationSet the proxied authorization DN for this operation if proxied authorization has been requested.- Specified by:
setProxiedAuthorizationDNin interfaceAddOperation- Specified by:
setProxiedAuthorizationDNin interfaceOperation- Parameters:
proxiedAuthorizationDN- The proxied authorization DN for this operation if proxied authorization has been requested, ornullif proxied authorization has not been requested.
-
run
public final void run()
Description copied from interface:OperationPerforms the work of actually processing this operation. This should include all processing for the operation, including invoking pre-parse and post-response plugins, logging messages and any other work that might need to be done in the course of processing.
-
updateOperationErrMsgAndResCode
public void updateOperationErrMsgAndResCode()
Description copied from class:AbstractOperationUpdates the error message and the result code of the operation. This method is called because no workflows were found to process the operation.- Overrides:
updateOperationErrMsgAndResCodein classAbstractOperation
-
getEntryToAdd
public Entry getEntryToAdd()
Retrieves the entry to be added to the server. The contents of the returned entry must not be altered by the caller. This method always returns null.- Specified by:
getEntryToAddin interfacePostResponseAddOperation- Returns:
- The entry to be added to the server.
-
-