Package org.opends.server.core
Class ModifyDNOperationBasis
- java.lang.Object
-
- org.opends.server.types.AbstractOperation
-
- org.opends.server.core.ModifyDNOperationBasis
-
- All Implemented Interfaces:
Runnable,ModifyDNOperation,Operation,InProgressOperation,PluginOperation,PostResponseModifyDNOperation,PostResponseOperation,PreParseModifyDNOperation,PreParseOperation,SubordinateModifyDNOperation
public class ModifyDNOperationBasis extends AbstractOperation implements ModifyDNOperation, PreParseModifyDNOperation, PostResponseModifyDNOperation
This class defines an operation that may be used to alter the DN of 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 ModifyDNOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, ByteString rawEntryDN, ByteString rawNewRDN, boolean deleteOldRDN, ByteString rawNewSuperior)Creates a new modify DN operation with the provided information.ModifyDNOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, DN entryDN, RDN newRDN, boolean deleteOldRDN, DN newSuperior)Creates a new modify DN 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 be applied as part of the update.voidaddResponseControl(Control control)Adds the provided control to the set of controls to include in the response to the client.booleandeleteOldRDN()Indicates whether the current RDN value should be removed from the entry.DNgetEntryDN()Retrieves the DN of the entry to rename.List<Modification>getModifications()Retrieves the set of modifications applied to attributes of the target entry in the course of processing this modify DN operation.DNgetNewDN()Retrieves the new DN for the entry.RDNgetNewRDN()Retrieves the new RDN to use for the entry.DNgetNewSuperior()Retrieves the newSuperior DN for the entry.OperationTypegetOperationType()Retrieves the operation type for this operation.EntrygetOriginalEntry()Retrieves the current entry, before it is renamed.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.ByteStringgetRawNewRDN()Retrieves the raw, unprocessed newRDN as included in the request from the client.ByteStringgetRawNewSuperior()Retrieves the raw, unprocessed newSuperior from the client request.List<Control>getResponseControls()Retrieves the set of controls to include in the response to the client.EntrygetUpdatedEntry()Retrieves the new entry, as it will appear after it is renamed.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.voidsetDeleteOldRDN(boolean deleteOldRDN)Specifies whether the current RDN value should be removed from the entry.voidsetProxiedAuthorizationDN(DN dn)Sets 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.voidsetRawNewRDN(ByteString rawNewRDN)Specifies the raw, unprocessed newRDN as included in the request from the client.voidsetRawNewSuperior(ByteString rawNewSuperior)Specifies the raw, unprocessed newSuperior for this modify DN operation, as provided in the request from the client.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.InProgressOperation
addAdditionalLogItem, appendErrorMessage, getAdditionalLogItems, getAuthorizationDN, getErrorMessage, getMatchedDN, getReferralURLs, getResultCode, setErrorMessage, setMatchedDN, setReferralURLs, setResponseData, setResultCode
-
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
-
ModifyDNOperationBasis
public ModifyDNOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, ByteString rawEntryDN, ByteString rawNewRDN, boolean deleteOldRDN, ByteString rawNewSuperior)
Creates a new modify DN 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 included in the client request.rawNewRDN- The raw, unprocessed newRDN as included in the client request.deleteOldRDN- Indicates whether to delete the old RDN value from the entry.rawNewSuperior- The raw, unprocessed newSuperior as included in the client request.
-
ModifyDNOperationBasis
public ModifyDNOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, DN entryDN, RDN newRDN, boolean deleteOldRDN, DN newSuperior)
Creates a new modify DN 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 current entry DN for this modify DN operation.newRDN- The new RDN for this modify DN operation.deleteOldRDN- Indicates whether to delete the old RDN value from the entry.newSuperior- The newSuperior DN for this modify DN operation.
-
-
Method Detail
-
getRawEntryDN
public final ByteString getRawEntryDN()
Description copied from interface:ModifyDNOperationRetrieves 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 interfaceModifyDNOperation- Specified by:
getRawEntryDNin interfacePostResponseModifyDNOperation- Specified by:
getRawEntryDNin interfacePreParseModifyDNOperation- Specified by:
getRawEntryDNin interfaceSubordinateModifyDNOperation- Returns:
- The raw, unprocessed entry DN as included in the client request.
-
setRawEntryDN
public final void setRawEntryDN(ByteString rawEntryDN)
Description copied from interface:ModifyDNOperationSpecifies the raw, unprocessed entry DN as included in the client request. This should only be called by pre-parse plugins.- Specified by:
setRawEntryDNin interfaceModifyDNOperation- Specified by:
setRawEntryDNin interfacePreParseModifyDNOperation- Parameters:
rawEntryDN- The raw, unprocessed entry DN as included in the client request.
-
getEntryDN
public final DN getEntryDN()
Description copied from interface:ModifyDNOperationRetrieves the DN of the entry to rename. 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 interfaceModifyDNOperation- Specified by:
getEntryDNin interfacePostResponseModifyDNOperation- Specified by:
getEntryDNin interfaceSubordinateModifyDNOperation- Returns:
- The DN of the entry to rename, or
nullif the raw entry DN has not yet been processed.
-
getRawNewRDN
public final ByteString getRawNewRDN()
Description copied from interface:ModifyDNOperationRetrieves the raw, unprocessed newRDN as included in the request from the client. This may or may not contain a valid RDN, as no validation will have been performed on it.- Specified by:
getRawNewRDNin interfaceModifyDNOperation- Specified by:
getRawNewRDNin interfacePostResponseModifyDNOperation- Specified by:
getRawNewRDNin interfacePreParseModifyDNOperation- Specified by:
getRawNewRDNin interfaceSubordinateModifyDNOperation- Returns:
- The raw, unprocessed newRDN as included in the request from the client.
-
setRawNewRDN
public final void setRawNewRDN(ByteString rawNewRDN)
Description copied from interface:ModifyDNOperationSpecifies the raw, unprocessed newRDN as included in the request from the client. This should only be called by pre-parse plugins and should not be used in later stages of processing.- Specified by:
setRawNewRDNin interfaceModifyDNOperation- Specified by:
setRawNewRDNin interfacePreParseModifyDNOperation- Parameters:
rawNewRDN- The raw, unprocessed newRDN as included in the request from the client.
-
getNewRDN
public final RDN getNewRDN()
Description copied from interface:ModifyDNOperationRetrieves the new RDN to use for the entry. This should not be called by pre-parse plugins, because the processed newRDN will not yet be available. Pre-parse plugins should instead use thegetRawNewRDNmethod.- Specified by:
getNewRDNin interfaceModifyDNOperation- Specified by:
getNewRDNin interfacePostResponseModifyDNOperation- Specified by:
getNewRDNin interfaceSubordinateModifyDNOperation- Returns:
- The new RDN to use for the entry, or
nullif the raw newRDN has not yet been processed.
-
deleteOldRDN
public final boolean deleteOldRDN()
Description copied from interface:ModifyDNOperationIndicates whether the current RDN value should be removed from the entry.- Specified by:
deleteOldRDNin interfaceModifyDNOperation- Specified by:
deleteOldRDNin interfacePostResponseModifyDNOperation- Specified by:
deleteOldRDNin interfacePreParseModifyDNOperation- Specified by:
deleteOldRDNin interfaceSubordinateModifyDNOperation- Returns:
trueif the current RDN value should be removed from the entry, orfalseif not.
-
setDeleteOldRDN
public final void setDeleteOldRDN(boolean deleteOldRDN)
Description copied from interface:ModifyDNOperationSpecifies whether the current RDN value should be removed from the entry.- Specified by:
setDeleteOldRDNin interfaceModifyDNOperation- Specified by:
setDeleteOldRDNin interfacePreParseModifyDNOperation- Parameters:
deleteOldRDN- Specifies whether the current RDN value should be removed from the entry.
-
getRawNewSuperior
public final ByteString getRawNewSuperior()
Description copied from interface:ModifyDNOperationRetrieves the raw, unprocessed newSuperior from the client request. This may or may not contain a valid DN, as no validation will have been performed on it.- Specified by:
getRawNewSuperiorin interfaceModifyDNOperation- Specified by:
getRawNewSuperiorin interfacePostResponseModifyDNOperation- Specified by:
getRawNewSuperiorin interfacePreParseModifyDNOperation- Specified by:
getRawNewSuperiorin interfaceSubordinateModifyDNOperation- Returns:
- The raw, unprocessed newSuperior from the client request, or
nullif there is none.
-
setRawNewSuperior
public final void setRawNewSuperior(ByteString rawNewSuperior)
Description copied from interface:ModifyDNOperationSpecifies the raw, unprocessed newSuperior for this modify DN operation, as provided in the request from the client. This method should only be called by pre-parse plugins.- Specified by:
setRawNewSuperiorin interfaceModifyDNOperation- Specified by:
setRawNewSuperiorin interfacePreParseModifyDNOperation- Parameters:
rawNewSuperior- The raw, unprocessed newSuperior as provided in the request from the client.
-
getNewSuperior
public final DN getNewSuperior()
Description copied from interface:ModifyDNOperationRetrieves the newSuperior DN for the entry. This should not be called by pre-parse plugins, because the processed DN will not yet be available at that time. Instead, they should use thegetRawNewSuperiormethod.- Specified by:
getNewSuperiorin interfaceModifyDNOperation- Specified by:
getNewSuperiorin interfacePostResponseModifyDNOperation- Specified by:
getNewSuperiorin interfaceSubordinateModifyDNOperation- Returns:
- The newSuperior DN for the entry, or
nullif there is no newSuperior DN for this request or if the raw newSuperior has not yet been processed.
-
getModifications
public final List<Modification> getModifications()
Description copied from interface:ModifyDNOperationRetrieves the set of modifications applied to attributes of the target entry in the course of processing this modify DN operation. This will include attribute-level changes from the modify DN itself (e.g., removing old RDN values if deleteOldRDN is set, or adding new RDN values that don't already exist), but it may also be used by pre-operation plugins to cause additional changes in the entry. In this case, those plugins may add modifications to this list (they may not remove existing modifications) if any changes should be processed in addition to the core modify DN processing. Backends may read this list to identify which attribute-level changes were applied in order to more easily apply updates to attribute indexes.- Specified by:
getModificationsin interfaceModifyDNOperation- Specified by:
getModificationsin interfacePostResponseModifyDNOperation- Returns:
- The set of modifications applied to attributes during the course
of the modify DN processing, or
nullif that information is not yet available (e.g., during pre-parse plugins).
-
addModification
public final void addModification(Modification modification)
Description copied from interface:ModifyDNOperationAdds the provided modification to the set of modifications to be applied as part of the update. This should only be called by pre-operation plugins.- Specified by:
addModificationin interfaceModifyDNOperation- Parameters:
modification- The modification to add to the set of modifications to apply to the entry.
-
getOriginalEntry
public final Entry getOriginalEntry()
Description copied from interface:ModifyDNOperationRetrieves the current entry, before it is renamed. This will not be available to pre-parse plugins or during the conflict resolution portion of the synchronization processing.- Specified by:
getOriginalEntryin interfaceModifyDNOperation- Specified by:
getOriginalEntryin interfacePostResponseModifyDNOperation- Specified by:
getOriginalEntryin interfaceSubordinateModifyDNOperation- Returns:
- The current entry, or
nullif it is not yet available.
-
getUpdatedEntry
public final Entry getUpdatedEntry()
Description copied from interface:ModifyDNOperationRetrieves the new entry, as it will appear after it is renamed. This will not be available to pre-parse plugins or during the conflict resolution portion of the synchronization processing.- Specified by:
getUpdatedEntryin interfaceModifyDNOperation- Specified by:
getUpdatedEntryin interfacePostResponseModifyDNOperation- Specified by:
getUpdatedEntryin interfaceSubordinateModifyDNOperation- Returns:
- The updated entry, or
nullif it is not yet available.
-
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:ModifyDNOperationRetrieves the proxied authorization DN for this operation if proxied authorization has been requested.- Specified by:
getProxiedAuthorizationDNin interfaceModifyDNOperation- 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 interfaceInProgressOperation- 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 interfaceInProgressOperation- 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.
-
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.
-
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
-
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 dn)
Description copied from interface:ModifyDNOperationSets the proxied authorization DN for this operation if proxied authorization has been requested.- Specified by:
setProxiedAuthorizationDNin interfaceModifyDNOperation- Specified by:
setProxiedAuthorizationDNin interfaceOperation- Parameters:
dn- The proxied authorization DN for this operation if proxied authorization has been requested, ornullif proxied authorization has not been requested.
-
getNewDN
public DN getNewDN()
Description copied from interface:ModifyDNOperationRetrieves the new DN for the entry.- Specified by:
getNewDNin interfaceModifyDNOperation- Returns:
- The new DN for the entry, or
nullif there is neither newRDN, nor entryDN for this request.
-
-