| | |
| | | import org.opends.server.controls.ProxiedAuthV1Control; |
| | | import org.opends.server.controls.ProxiedAuthV2Control; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.AbstractOperation; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | |
| | | import org.opends.server.types.LockManager; |
| | | import org.opends.server.types.Modification; |
| | | import org.opends.server.types.ModificationType; |
| | | import org.opends.server.types.Operation; |
| | | import org.opends.server.types.OperationType; |
| | | import org.opends.server.types.Privilege; |
| | | import org.opends.server.types.RDN; |
| | |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | |
| | | import org.opends.server.loggers.debug.DebugLogger; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import static org.opends.server.messages.CoreMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | |
| | | * in the Directory Server. |
| | | */ |
| | | public class ModifyDNOperation |
| | | extends Operation |
| | | extends AbstractOperation |
| | | implements PreParseModifyDNOperation, PreOperationModifyDNOperation, |
| | | PostOperationModifyDNOperation, PostResponseModifyDNOperation |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | private static final DebugTracer TRACER = DebugLogger.getTracer(); |
| | | |
| | | // Indicates whether to delete the old RDN value from the entry. |
| | | private boolean deleteOldRDN; |
| | |
| | | // The change number that has been assigned to this operation. |
| | | private long changeNumber; |
| | | |
| | | // The time that processing started on this operation. |
| | | private long processingStartTime; |
| | | |
| | | // The time that processing ended on this operation. |
| | | private long processingStopTime; |
| | | |
| | | // The new RDN for the entry. |
| | | private RDN newRDN; |
| | | |
| | |
| | | return newEntry; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public final long getProcessingStartTime() |
| | | { |
| | | return processingStartTime; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public final long getProcessingStopTime() |
| | | { |
| | | return processingStopTime; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public final long getProcessingTime() |
| | | { |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the change number that has been assigned to this operation. |
| | | * |
| | |
| | | } |
| | | |
| | | String processingTime = |
| | | String.valueOf(processingStopTime - processingStartTime); |
| | | String.valueOf(getProcessingTime()); |
| | | |
| | | return new String[][] |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | * 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. |
| | | */ |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | setResultCode(ResultCode.UNDEFINED); |
| | |
| | | |
| | | |
| | | // Start the processing timer. |
| | | processingStartTime = System.currentTimeMillis(); |
| | | setProcessingStartTime(); |
| | | |
| | | |
| | | // Check for and handle a request to cancel this operation. |
| | | if (cancelRequest != null) |
| | | { |
| | | indicateCancelled(cancelRequest); |
| | | processingStopTime = System.currentTimeMillis(); |
| | | setProcessingStopTime(); |
| | | return; |
| | | } |
| | | |
| | |
| | | int msgID = MSGID_CANCELED_BY_PREPARSE_DISCONNECT; |
| | | appendErrorMessage(getMessage(msgID)); |
| | | |
| | | processingStopTime = System.currentTimeMillis(); |
| | | setProcessingStopTime(); |
| | | |
| | | logModifyDNRequest(this); |
| | | logModifyDNResponse(this); |
| | |
| | | if (cancelRequest != null) |
| | | { |
| | | indicateCancelled(cancelRequest); |
| | | processingStopTime = System.currentTimeMillis(); |
| | | setProcessingStopTime(); |
| | | logModifyDNResponse(this); |
| | | pluginConfigManager.invokePostResponseModifyDNPlugins(this); |
| | | return; |
| | |
| | | if (cancelRequest != null) |
| | | { |
| | | indicateCancelled(cancelRequest); |
| | | processingStopTime = System.currentTimeMillis(); |
| | | setProcessingStopTime(); |
| | | logModifyDNResponse(this); |
| | | pluginConfigManager.invokePostResponseModifyDNPlugins(this); |
| | | return; |
| | |
| | | if (cancelRequest != null) |
| | | { |
| | | indicateCancelled(cancelRequest); |
| | | processingStopTime = System.currentTimeMillis(); |
| | | setProcessingStopTime(); |
| | | logModifyDNResponse(this); |
| | | pluginConfigManager.invokePostResponseModifyDNPlugins(this); |
| | | return; |
| | |
| | | if (cancelRequest != null) |
| | | { |
| | | indicateCancelled(cancelRequest); |
| | | processingStopTime = System.currentTimeMillis(); |
| | | setProcessingStopTime(); |
| | | logModifyDNResponse(this); |
| | | pluginConfigManager.invokePostResponseModifyDNPlugins(this); |
| | | return; |
| | |
| | | int msgID = MSGID_CANCELED_BY_PREOP_DISCONNECT; |
| | | appendErrorMessage(getMessage(msgID)); |
| | | |
| | | processingStopTime = System.currentTimeMillis(); |
| | | setProcessingStopTime(); |
| | | logModifyDNResponse(this); |
| | | pluginConfigManager.invokePostResponseModifyDNPlugins(this); |
| | | return; |
| | |
| | | if (cancelRequest != null) |
| | | { |
| | | indicateCancelled(cancelRequest); |
| | | processingStopTime = System.currentTimeMillis(); |
| | | setProcessingStopTime(); |
| | | logModifyDNResponse(this); |
| | | pluginConfigManager.invokePostResponseModifyDNPlugins(this); |
| | | return; |
| | |
| | | int msgID = MSGID_CANCELED_BY_POSTOP_DISCONNECT; |
| | | appendErrorMessage(getMessage(msgID)); |
| | | |
| | | processingStopTime = System.currentTimeMillis(); |
| | | setProcessingStopTime(); |
| | | logModifyDNResponse(this); |
| | | pluginConfigManager.invokePostResponseModifyDNPlugins(this); |
| | | return; |
| | |
| | | |
| | | |
| | | // Stop the processing timer. |
| | | processingStopTime = System.currentTimeMillis(); |
| | | setProcessingStopTime(); |
| | | |
| | | |
| | | // Send the modify DN response to the client. |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | protected boolean setCancelRequest(CancelRequest cancelRequest) |
| | | public boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | this.cancelRequest = cancelRequest; |
| | | return true; |
| | |
| | | |
| | | buffer.append(")"); |
| | | } |
| | | |
| | | } |
| | | |