mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

gbellato
08.03.2008 7adb93986ace907531875e25be1f94d735fbb068
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;
  }
}