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/AbandonOperation.java |   86 +++++++++++++-----------------------------
 1 files changed, 27 insertions(+), 59 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/AbandonOperation.java b/opends/src/server/org/opends/server/core/AbandonOperation.java
index fdcefa8..cf2d828 100644
--- a/opends/src/server/org/opends/server/core/AbandonOperation.java
+++ b/opends/src/server/org/opends/server/core/AbandonOperation.java
@@ -28,26 +28,30 @@
 
 
 
+import static org.opends.server.core.CoreConstants.LOG_ELEMENT_ERROR_MESSAGE;
+import static org.opends.server.core.CoreConstants.LOG_ELEMENT_ID_TO_ABANDON;
+import static org.opends.server.core.CoreConstants.LOG_ELEMENT_PROCESSING_TIME;
+import static org.opends.server.core.CoreConstants.LOG_ELEMENT_RESULT_CODE;
+import static org.opends.server.messages.CoreMessages.*;
+import static org.opends.server.messages.MessageHandler.getMessage;
+
 import java.util.List;
 
 import org.opends.server.api.ClientConnection;
 import org.opends.server.api.plugin.PreParsePluginResult;
+import org.opends.server.loggers.debug.DebugLogger;
+import org.opends.server.loggers.debug.DebugTracer;
+import org.opends.server.types.AbstractOperation;
 import org.opends.server.types.CancelRequest;
 import org.opends.server.types.CancelResult;
 import org.opends.server.types.Control;
 import org.opends.server.types.DisconnectReason;
-import org.opends.server.types.Operation;
 import org.opends.server.types.OperationType;
 import org.opends.server.types.ResultCode;
 import org.opends.server.types.operation.PostOperationAbandonOperation;
 import org.opends.server.types.operation.PreParseAbandonOperation;
 
-import static org.opends.server.core.CoreConstants.*;
 import static org.opends.server.loggers.AccessLogger.*;
-import static org.opends.server.messages.CoreMessages.*;
-import static org.opends.server.messages.MessageHandler.*;
-
-
 
 
 /**
@@ -55,23 +59,18 @@
  * may already be in progress in the Directory Server.
  */
 public class AbandonOperation
-       extends Operation
+       extends AbstractOperation
        implements PreParseAbandonOperation, PostOperationAbandonOperation
 {
 
-
+  /**
+   * The tracer object for the debug logger.
+   */
+  private static final DebugTracer TRACER = DebugLogger.getTracer();
 
   // The message ID of the operation that should be abandoned.
   private final int idToAbandon;
 
-  // The time that processing started on this operation.
-  private long processingStartTime;
-
-  // The time that processing ended on this operation.
-  private long processingStopTime;
-
-
-
   /**
    * Creates a new abandon operation with the provided information.
    *
@@ -106,41 +105,6 @@
     return idToAbandon;
   }
 
-
-
-  /**
-   * {@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);
-  }
-
-
-
   /**
    * {@inheritDoc}
    */
@@ -213,7 +177,7 @@
     }
 
     String processingTime =
-         String.valueOf(processingStopTime - processingStartTime);
+         String.valueOf(getProcessingTime());
 
     return new String[][]
     {
@@ -261,9 +225,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);
@@ -276,7 +243,7 @@
 
 
     // Start the processing timer.
-    processingStartTime = System.currentTimeMillis();
+    setProcessingStartTime();
 
 
     // Create a labeled block of code that we can break out of if a problem is
@@ -295,7 +262,7 @@
         int msgID = MSGID_CANCELED_BY_PREPARSE_DISCONNECT;
         appendErrorMessage(getMessage(msgID));
 
-        processingStopTime = System.currentTimeMillis();
+        setProcessingStopTime();
 
         logAbandonRequest(this);
         logAbandonResult(this);
@@ -321,7 +288,7 @@
       // code to reflect whether the abandon was successful and an error message
       // if it was not.  Even though there is no response, the result should
       // still be logged.
-      Operation operation =
+      AbstractOperation operation =
            clientConnection.getOperationInProgress(idToAbandon);
       if (operation == null)
       {
@@ -356,7 +323,7 @@
 
 
     // Stop the processing timer.
-    processingStopTime = System.currentTimeMillis();
+    setProcessingStopTime();
 
 
     // Log the result of the abandon operation.
@@ -392,7 +359,7 @@
    * {@inheritDoc}
    */
   @Override()
-  protected boolean setCancelRequest(CancelRequest cancelRequest)
+  public boolean setCancelRequest(CancelRequest cancelRequest)
   {
     // Abandon operations cannot be canceled.
     return false;
@@ -414,5 +381,6 @@
     buffer.append(idToAbandon);
     buffer.append(")");
   }
+
 }
 

--
Gitblit v1.10.0