From fbda6e0892dcfcc8dd43d21f6fb134aabb8d0cac Mon Sep 17 00:00:00 2001
From: jarnou <jarnou@localhost>
Date: Tue, 03 Jul 2007 09:29:17 +0000
Subject: [PATCH] Commits the refactoring of the core server to provide support for proxy/distribution/virtual functionnalities. This includes the new set of local operations, as well as the workflow and networkgroup support.
---
opends/src/server/org/opends/server/core/ModifyDNOperation.java | 83 ++++++++++++-----------------------------
1 files changed, 24 insertions(+), 59 deletions(-)
diff --git a/opends/src/server/org/opends/server/core/ModifyDNOperation.java b/opends/src/server/org/opends/server/core/ModifyDNOperation.java
index 22f41ef..9c01614 100644
--- a/opends/src/server/org/opends/server/core/ModifyDNOperation.java
+++ b/opends/src/server/org/opends/server/core/ModifyDNOperation.java
@@ -50,6 +50,7 @@
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;
@@ -68,7 +69,6 @@
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;
@@ -86,6 +86,8 @@
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.*;
@@ -99,14 +101,14 @@
* 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;
@@ -150,12 +152,6 @@
// 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;
@@ -490,41 +486,6 @@
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.
*
@@ -671,7 +632,7 @@
}
String processingTime =
- String.valueOf(processingStopTime - processingStartTime);
+ String.valueOf(getProcessingTime());
return new String[][]
{
@@ -734,9 +695,12 @@
/**
- * {@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);
@@ -749,14 +713,14 @@
// 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;
}
@@ -777,7 +741,7 @@
int msgID = MSGID_CANCELED_BY_PREPARSE_DISCONNECT;
appendErrorMessage(getMessage(msgID));
- processingStopTime = System.currentTimeMillis();
+ setProcessingStopTime();
logModifyDNRequest(this);
logModifyDNResponse(this);
@@ -805,7 +769,7 @@
if (cancelRequest != null)
{
indicateCancelled(cancelRequest);
- processingStopTime = System.currentTimeMillis();
+ setProcessingStopTime();
logModifyDNResponse(this);
pluginConfigManager.invokePostResponseModifyDNPlugins(this);
return;
@@ -941,7 +905,7 @@
if (cancelRequest != null)
{
indicateCancelled(cancelRequest);
- processingStopTime = System.currentTimeMillis();
+ setProcessingStopTime();
logModifyDNResponse(this);
pluginConfigManager.invokePostResponseModifyDNPlugins(this);
return;
@@ -1025,7 +989,7 @@
if (cancelRequest != null)
{
indicateCancelled(cancelRequest);
- processingStopTime = System.currentTimeMillis();
+ setProcessingStopTime();
logModifyDNResponse(this);
pluginConfigManager.invokePostResponseModifyDNPlugins(this);
return;
@@ -1571,7 +1535,7 @@
if (cancelRequest != null)
{
indicateCancelled(cancelRequest);
- processingStopTime = System.currentTimeMillis();
+ setProcessingStopTime();
logModifyDNResponse(this);
pluginConfigManager.invokePostResponseModifyDNPlugins(this);
return;
@@ -1599,7 +1563,7 @@
int msgID = MSGID_CANCELED_BY_PREOP_DISCONNECT;
appendErrorMessage(getMessage(msgID));
- processingStopTime = System.currentTimeMillis();
+ setProcessingStopTime();
logModifyDNResponse(this);
pluginConfigManager.invokePostResponseModifyDNPlugins(this);
return;
@@ -1798,7 +1762,7 @@
if (cancelRequest != null)
{
indicateCancelled(cancelRequest);
- processingStopTime = System.currentTimeMillis();
+ setProcessingStopTime();
logModifyDNResponse(this);
pluginConfigManager.invokePostResponseModifyDNPlugins(this);
return;
@@ -2078,7 +2042,7 @@
int msgID = MSGID_CANCELED_BY_POSTOP_DISCONNECT;
appendErrorMessage(getMessage(msgID));
- processingStopTime = System.currentTimeMillis();
+ setProcessingStopTime();
logModifyDNResponse(this);
pluginConfigManager.invokePostResponseModifyDNPlugins(this);
return;
@@ -2114,7 +2078,7 @@
// Stop the processing timer.
- processingStopTime = System.currentTimeMillis();
+ setProcessingStopTime();
// Send the modify DN response to the client.
@@ -2217,7 +2181,7 @@
* {@inheritDoc}
*/
@Override()
- protected boolean setCancelRequest(CancelRequest cancelRequest)
+ public boolean setCancelRequest(CancelRequest cancelRequest)
{
this.cancelRequest = cancelRequest;
return true;
@@ -2250,5 +2214,6 @@
buffer.append(")");
}
+
}
--
Gitblit v1.10.0