Package org.opends.server.core
Class ModifyOperationBasis
- java.lang.Object
-
- org.opends.server.types.AbstractOperation
-
- org.opends.server.core.ModifyOperationBasis
-
- All Implemented Interfaces:
Runnable,ModifyOperation,Operation,PluginOperation,PostResponseModifyOperation,PostResponseOperation,PreParseModifyOperation,PreParseOperation
public class ModifyOperationBasis extends AbstractOperation implements ModifyOperation, PreParseModifyOperation, PostResponseModifyOperation
This class defines an operation that may be used to modify an entry in 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 ModifyOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, ByteString rawEntryDN, List<RawModification> rawModifications)Creates a new modify operation with the provided information.ModifyOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, DN entryDN, List<Modification> modifications)Creates a new modify operation with the provided information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddModification(Modification modification)Adds the provided modification to the set of modifications to this modify operation.voidaddRawModification(RawModification rawModification)Adds the provided modification to the set of raw modifications for this modify operation.voidaddResponseControl(Control control)Adds the provided control to the set of controls to include in the response to the client.EntrygetCurrentEntry()Retrieves the current entry before any modifications are applied.List<ByteString>getCurrentPasswords()Retrieves the set of clear-text current passwords for the user, if available.DNgetEntryDN()Retrieves the DN of the entry to modify.List<Modification>getModifications()Retrieves the set of modifications for this modify operation.EntrygetModifiedEntry()Retrieves the modified entry that is to be written to the backend.List<ByteString>getNewPasswords()Retrieves the set of clear-text new passwords for the user, if available.OperationTypegetOperationType()Retrieves the operation type for this operation.DNgetProxiedAuthorizationDN()Retrieves the proxied authorization DN for this operation if proxied authorization has been requested.ByteStringgetRawEntryDN()Retrieves the raw, unprocessed entry DN as included in the client request.List<RawModification>getRawModifications()Retrieves the set of raw, unprocessed modifications as included in the client request.List<Control>getResponseControls()Retrieves the set of controls to include in the response to the client.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.voidsetProxiedAuthorizationDN(DN proxiedAuthorizationDN)Set the proxied authorization DN for this operation if proxied authorization has been requested.voidsetRawEntryDN(ByteString rawEntryDN)Specifies the raw, unprocessed entry DN as included in the client request.voidsetRawModifications(List<RawModification> rawModifications)Specifies the raw modifications for this modify operation.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
-
ModifyOperationBasis
public ModifyOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, ByteString rawEntryDN, List<RawModification> rawModifications)
Creates a new modify 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 DN of the entry to modify, as included in the client request.rawModifications- The raw, unprocessed set of modifications for this modify operation as included in the client request.
-
ModifyOperationBasis
public ModifyOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, DN entryDN, List<Modification> modifications)
Creates a new modify 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 the modify operation.modifications- The set of modifications for this modify operation.
-
-
Method Detail
-
getRawEntryDN
public final ByteString getRawEntryDN()
Description copied from interface:ModifyOperationRetrieves the raw, unprocessed entry DN as included in the client request. The DN that is returned may or may not be a valid DN, since no validation will have been performed upon it.- Specified by:
getRawEntryDNin interfaceModifyOperation- Specified by:
getRawEntryDNin interfacePostResponseModifyOperation- Specified by:
getRawEntryDNin interfacePreParseModifyOperation- Returns:
- The raw, unprocessed entry DN as included in the client request.
-
setRawEntryDN
public final void setRawEntryDN(ByteString rawEntryDN)
Description copied from interface:ModifyOperationSpecifies the raw, unprocessed entry DN as included in the client request. This should only be called by pre-parse plugins.- Specified by:
setRawEntryDNin interfaceModifyOperation- Specified by:
setRawEntryDNin interfacePreParseModifyOperation- Parameters:
rawEntryDN- The raw, unprocessed entry DN as included in the client request.
-
getEntryDN
public final DN getEntryDN()
Description copied from interface:ModifyOperationRetrieves the DN of the entry to modify. This should not be called by pre-parse plugins because the processed DN will not be available yet. Instead, they should call thegetRawEntryDNmethod.- Specified by:
getEntryDNin interfaceModifyOperation- Specified by:
getEntryDNin interfacePostResponseModifyOperation- Returns:
- The DN of the entry to modify, or
nullif the raw entry DN has not yet been processed.
-
getRawModifications
public final List<RawModification> getRawModifications()
Description copied from interface:ModifyOperationRetrieves the set of raw, unprocessed modifications as included in the client request. Note that this may contain one or more invalid modifications, as no validation will have been performed on this information. The list returned must not be altered by the caller.- Specified by:
getRawModificationsin interfaceModifyOperation- Specified by:
getRawModificationsin interfacePostResponseModifyOperation- Specified by:
getRawModificationsin interfacePreParseModifyOperation- Returns:
- The set of raw, unprocessed modifications as included in the client request.
-
addRawModification
public final void addRawModification(RawModification rawModification)
Description copied from interface:ModifyOperationAdds the provided modification to the set of raw modifications for this modify operation. This must only be called by pre-parse plugins.- Specified by:
addRawModificationin interfaceModifyOperation- Specified by:
addRawModificationin interfacePreParseModifyOperation- Parameters:
rawModification- The modification to add to the set of raw modifications for this modify operation.
-
setRawModifications
public final void setRawModifications(List<RawModification> rawModifications)
Description copied from interface:ModifyOperationSpecifies the raw modifications for this modify operation.- Specified by:
setRawModificationsin interfaceModifyOperation- Specified by:
setRawModificationsin interfacePreParseModifyOperation- Parameters:
rawModifications- The raw modifications for this modify operation.
-
getModifications
public final List<Modification> getModifications()
Description copied from interface:ModifyOperationRetrieves the set of modifications for this modify operation. Its contents should not be altered. It will not be available to pre-parse plugins.- Specified by:
getModificationsin interfaceModifyOperation- Specified by:
getModificationsin interfacePostResponseModifyOperation- Returns:
- The set of modifications for this modify operation, or
nullif the modifications have not yet been processed.
-
addModification
public final void addModification(Modification modification) throws DirectoryException
Description copied from interface:ModifyOperationAdds the provided modification to the set of modifications to this modify operation. This may only be called by pre-operation plugins.- Specified by:
addModificationin interfaceModifyOperation- Parameters:
modification- The modification to add to the set of changes for this modify operation.- Throws:
DirectoryException- If an unexpected problem occurs while applying the modification to the entry.
-
getOperationType
public final OperationType getOperationType()
Description copied from interface:OperationRetrieves 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:ModifyOperationRetrieves the proxied authorization DN for this operation if proxied authorization has been requested.- Specified by:
getProxiedAuthorizationDNin interfaceModifyOperation- 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 List<Control> getResponseControls()
Description copied from interface:OperationRetrieves 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:OperationAdds 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:
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:OperationRemoves 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:
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:OperationAppends 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:ModifyOperationSet the proxied authorization DN for this operation if proxied authorization has been requested.- Specified by:
setProxiedAuthorizationDNin interfaceModifyOperation- 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
-
getCurrentEntry
public Entry getCurrentEntry()
Retrieves the current entry before any modifications are applied. It should not be modified by the caller. This method always returns null.- Specified by:
getCurrentEntryin interfacePostResponseModifyOperation- Returns:
- The current entry before any modifications are applied.
-
getCurrentPasswords
public List<ByteString> getCurrentPasswords()
Retrieves the set of clear-text current passwords for the user, if available. This will only be available if the modify operation contains one or more delete elements that target the password attribute and provide the values to delete in the clear. This list should not be altered by the caller. This method always returns null.- Specified by:
getCurrentPasswordsin interfacePostResponseModifyOperation- Returns:
- The set of clear-text current password values as
provided in the modify request, or
nullif there were none.
-
getModifiedEntry
public Entry getModifiedEntry()
Retrieves the modified entry that is to be written to the backend. It should not be modified by the caller. This method always returns null.- Specified by:
getModifiedEntryin interfacePostResponseModifyOperation- Returns:
- The modified entry that is to be written to the backend.
-
getNewPasswords
public List<ByteString> getNewPasswords()
Retrieves the set of clear-text new passwords for the user, if available. This will only be available if the modify operation contains one or more add or replace elements that target the password attribute and provide the values in the clear. This list should not be altered by the caller. This method always returns null.- Specified by:
getNewPasswordsin interfacePostResponseModifyOperation- Returns:
- The set of clear-text new passwords as provided in the
modify request, or
nullif there were none.
-
-