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

gbellato
18.40.2008 66f48672bc7953e77364a9a7ae41f1e70d83534f
opends/src/server/org/opends/server/replication/server/MsgQueue.java
@@ -42,6 +42,9 @@
  private SortedMap<ChangeNumber, UpdateMessage>  map =
    new TreeMap<ChangeNumber, UpdateMessage>();
  // The total number of bytes for all the message in the queue.
  private int bytesCount = 0;
  /**
   * Return the first UpdateMessage in the MsgQueue.
   *
@@ -67,12 +70,22 @@
   *
   * @return The number of elements in this MsgQueue.
   */
  public int size()
  public int count()
  {
    return map.size();
  }
  /**
   * Returns the number of bytes in this MsgQueue.
   *
   * @return The number of bytes in this MsgQueue.
   */
  public int bytesCount()
  {
    return bytesCount;
  }
  /**
   * Returns <tt>true</tt> if this MsgQueue contains no UpdateMessage.
   *
   * @return <tt>true</tt> if this MsgQueue contains no UpdateMessage.
@@ -91,6 +104,7 @@
  public void add(UpdateMessage update)
  {
    map.put(update.getChangeNumber(), update);
    bytesCount += update.size();
  }
  /**
@@ -102,6 +116,7 @@
  {
    UpdateMessage msg = map.get(map.firstKey());
    map.remove(msg.getChangeNumber());
    bytesCount -= msg.size();
    return msg;
  }
@@ -126,5 +141,6 @@
  public void clear()
  {
    map.clear();
    bytesCount = 0;
  }
}