From 6e14a8394d193af0fa32b83d3cc424787d41eadd Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 26 Jun 2014 13:19:57 +0000
Subject: [PATCH] OPENDJ-1453 (CR-3870) Replica offline messages should be synced with updates
---
opends/src/server/org/opends/server/replication/plugin/PendingChange.java | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/plugin/PendingChange.java b/opends/src/server/org/opends/server/replication/plugin/PendingChange.java
index e694ab4..9e7309f 100644
--- a/opends/src/server/org/opends/server/replication/plugin/PendingChange.java
+++ b/opends/src/server/org/opends/server/replication/plugin/PendingChange.java
@@ -29,6 +29,7 @@
import org.opends.server.replication.common.CSN;
import org.opends.server.replication.common.ServerState;
import org.opends.server.replication.protocol.LDAPUpdateMsg;
+import org.opends.server.replication.protocol.UpdateMsg;
import org.opends.server.types.operation.PluginOperation;
/**
@@ -39,7 +40,7 @@
{
private final CSN csn;
private boolean committed;
- private LDAPUpdateMsg msg;
+ private UpdateMsg msg;
private final PluginOperation op;
private ServerState dependencyState;
@@ -49,7 +50,7 @@
* @param op the operation to use
* @param msg the message to use (can be null for local operations)
*/
- PendingChange(CSN csn, PluginOperation op, LDAPUpdateMsg msg)
+ PendingChange(CSN csn, PluginOperation op, UpdateMsg msg)
{
this.csn = csn;
this.committed = false;
@@ -89,12 +90,27 @@
* @return the message if operation was a replication operation
* null if the operation was a local operation
*/
- public LDAPUpdateMsg getMsg()
+ public UpdateMsg getMsg()
{
return msg;
}
/**
+ * Get the LDAPUpdateMsg associated to this PendingChange.
+ *
+ * @return the LDAPUpdateMsg if operation was a replication operation, null
+ * otherwise
+ */
+ public LDAPUpdateMsg getLDAPUpdateMsg()
+ {
+ if (msg instanceof LDAPUpdateMsg)
+ {
+ return (LDAPUpdateMsg) msg;
+ }
+ return null;
+ }
+
+ /**
* Set the message associated to the PendingChange.
* @param msg the message
*/
--
Gitblit v1.10.0