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

Jean-Noel Rouvignac
11.04.2014 37fd83b785c0993b0e1f0fb93777943a9ec46d83
opendj3-server-dev/src/server/org/opends/server/replication/common/MultiDomainServerState.java
@@ -26,7 +26,10 @@
 */
package org.opends.server.replication.common;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
@@ -166,7 +169,31 @@
  }
  /**
   * Returns a snapshot of this object.
   *
   * @return an unmodifiable Map representing a snapshot of this object.
   */
  public Map<DN, List<CSN>> getSnapshot()
  {
    if (list.isEmpty())
    {
      return Collections.emptyMap();
    }
    final Map<DN, List<CSN>> map = new HashMap<DN, List<CSN>>();
    for (Entry<DN, ServerState> entry : list.entrySet())
    {
      final List<CSN> l = entry.getValue().getSnapshot();
      if (!l.isEmpty())
      {
        map.put(entry.getKey(), l);
      }
    }
    return Collections.unmodifiableMap(map);
  }
  /**
   * Returns a string representation of this object.
   *
   * @return The string representation.
   */
  @Override