From 459b0d746ffd89bdf8fcd47fa3a14e76be87136f Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 25 Sep 2007 01:54:38 +0000
Subject: [PATCH] Further split up the local backend modify operation to allow it to be better optimized, and do the same for SearchFilter.matchesEntryInternal and Entry.conformsToSchema.

---
 opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java |   31 ++++++++++++++++++++++++++-----
 1 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java
index 8e4ec8d..a7b19b8 100644
--- a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java
+++ b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java
@@ -203,7 +203,7 @@
     skipPostOperation = false;
 
     // Check for a request to cancel this operation.
-    if (getCancelRequest() != null)
+    if (cancelIfRequested())
     {
       return;
     }
@@ -283,7 +283,7 @@
 
 
       // Check for a request to cancel this operation.
-      if (getCancelRequest() != null)
+      if (cancelIfRequested())
       {
         return;
       }
@@ -359,7 +359,7 @@
       try
       {
         // Check for a request to cancel this operation.
-        if (getCancelRequest() != null)
+        if (cancelIfRequested())
         {
           return;
         }
@@ -514,7 +514,7 @@
 
 
         // Check for a request to cancel this operation.
-        if (getCancelRequest() != null)
+        if (cancelIfRequested())
         {
           return;
         }
@@ -575,7 +575,7 @@
 
 
         // Check for a request to cancel this operation.
-        if (getCancelRequest() != null)
+        if (cancelIfRequested())
         {
           return;
         }
@@ -789,6 +789,27 @@
 
 
   /**
+   * Checks to determine whether there has been a request to cancel this
+   * operation.  If so, then set the cancel result and processing stop time.
+   *
+   * @return  {@code true} if there was a cancel request, or {@code false} if
+   *          not.
+   */
+  private boolean cancelIfRequested()
+  {
+    if (getCancelRequest() == null)
+    {
+      return false;
+    }
+
+    indicateCancelled(getCancelRequest());
+    setProcessingStopTime();
+    return true;
+  }
+
+
+
+  /**
    * Processes the set of controls included in the request.
    *
    * @throws  DirectoryException  If a problem occurs that should cause the

--
Gitblit v1.10.0