From d491fe177f1740e7b5882569d51987a15662fc85 Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Thu, 12 Jul 2007 09:30:40 +0000
Subject: [PATCH] fix for 1887 : Define new interfaces used by the synchronization provider so that LocalBackend operations are not exposed

---
 opends/src/server/org/opends/server/replication/protocol/OperationContext.java |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/protocol/OperationContext.java b/opends/src/server/org/opends/server/replication/protocol/OperationContext.java
index 78e96e9..e00ac66 100644
--- a/opends/src/server/org/opends/server/replication/protocol/OperationContext.java
+++ b/opends/src/server/org/opends/server/replication/protocol/OperationContext.java
@@ -28,6 +28,7 @@
 
 import org.opends.server.replication.common.ChangeNumber;
 import org.opends.server.types.Operation;
+import org.opends.server.types.operation.PluginOperation;
 
 /**
  * This class describe the replication context that is attached
@@ -84,9 +85,10 @@
   /**
    * Get the change number of an operation.
    *
-   * @param op The operation.
+   * @param  op The operation.
+   *
    * @return The change number of the provided operation, or null if there is
-   * no change number associated with the operation.
+   *         no change number associated with the operation.
    */
   public static ChangeNumber getChangeNumber(Operation op)
   {
@@ -99,6 +101,24 @@
   }
 
   /**
+   * Get the change number of an operation.
+   *
+   * @param  op The operation.
+   *
+   * @return The change number of the provided operation, or null if there is
+   *         no change number associated with the operation.
+   */
+  public static ChangeNumber getChangeNumber(PluginOperation op)
+  {
+    OperationContext ctx = (OperationContext)op.getAttachment(SYNCHROCONTEXT);
+    if (ctx == null)
+    {
+      return null;
+    }
+    return ctx.changeNumber;
+  }
+
+  /**
    * {@inheritDoc}
    */
   @Override

--
Gitblit v1.10.0