From 7adb93986ace907531875e25be1f94d735fbb068 Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Mon, 08 Dec 2008 08:03:33 +0000
Subject: [PATCH] Merge the replication-service branch with the OpenDS trunk

---
 opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerState.java |   31 +++++++++++++++++++++++++++----
 1 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerState.java b/opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerState.java
index 81d2ac3..559ae24 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerState.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerState.java
@@ -49,6 +49,7 @@
 public class ServerState implements Iterable<Short>
 {
   private HashMap<Short, ChangeNumber> list;
+  private boolean saved = true;
 
   /**
    * Creates a new empty ServerState.
@@ -142,16 +143,18 @@
 
   /**
    * Update the Server State with a ChangeNumber.
-   * All operations with smaller CSN and the same serverID must be committed
-   * before calling this method.
-   * @param changeNumber the committed ChangeNumber.
-   * @return a boolean indicating if the update was meaningfull.
+   *
+   * @param changeNumber    The committed ChangeNumber.
+   *
+   * @return a boolean indicating if the update was meaningful.
    */
   public boolean update(ChangeNumber changeNumber)
   {
     if (changeNumber == null)
       return false;
 
+    saved = false;
+
     synchronized(this)
     {
       Short id =  changeNumber.getServerId();
@@ -395,4 +398,24 @@
 
      return diff;
   }
+
+  /**
+   * Set the saved status of this ServerState.
+   *
+   * @param b A booelan indicating if the State has been safely stored.
+   */
+  public void setSaved(boolean b)
+  {
+    saved = false;
+  }
+
+  /**
+   * Get the saved status of this ServerState.
+   *
+   * @return The saved status of this ServerState.
+   */
+  public boolean isSaved()
+  {
+    return saved;
+  }
 }

--
Gitblit v1.10.0