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

Jean-Noel Rouvignac
08.10.2013 fe7f48c4d11f7b4a003038f2e406a148eac48d1e
opends/src/server/org/opends/server/replication/common/MultiDomainServerState.java
@@ -29,6 +29,7 @@
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import org.opends.messages.Category;
@@ -120,15 +121,18 @@
  }
  /**
   * Update the ServerState of the provided baseDN with the
   * provided server state.
   * Update the ServerState of the provided baseDN with the provided server
   * state. The provided server state will be owned by this instance, so care
   * must be taken by calling code to duplicate it if needed.
   *
   * @param baseDN       The provided baseDN.
   * @param serverState  The provided serverState.
   * @param baseDN
   *          The provided baseDN.
   * @param serverState
   *          The provided serverState.
   */
  public void update(DN baseDN, ServerState serverState)
  {
    list.put(baseDN, serverState.duplicate());
    list.put(baseDN, serverState);
  }
  /**
@@ -138,16 +142,16 @@
  @Override
  public String toString()
  {
    String res = "";
    if ((list != null) && (!list.isEmpty()))
    StringBuilder res = new StringBuilder();
    if (list != null && !list.isEmpty())
    {
      for (DN baseDN : list.keySet())
      for (Entry<DN, ServerState> entry : list.entrySet())
      {
        ServerState ss = list.get(baseDN);
        res += baseDN + ":" + ss + ";";
        res.append(entry.getKey()).append(":")
           .append(entry.getValue()).append(";");
      }
    }
    return res;
    return res.toString();
  }
  /**
@@ -156,7 +160,7 @@
   */
  public void toString(StringBuilder buffer)
  {
    buffer.append(this.toString());
    buffer.append(this);
  }
@@ -186,7 +190,7 @@
   */
  public boolean equalsTo(MultiDomainServerState other)
  {
    return ((this.cover(other)) && (other.cover(this)));
    return cover(other) && other.cover(this);
  }
  /**
@@ -200,7 +204,7 @@
    {
      ServerState state = list.get(baseDN);
      ServerState coveredState = covered.list.get(baseDN);
      if ((state==null)||(coveredState == null) || (!state.cover(coveredState)))
      if (state == null || coveredState == null || !state.cover(coveredState))
      {
        return false;
      }
@@ -220,8 +224,7 @@
      String multidomainserverstate) throws DirectoryException
  {
    Map<DN, ServerState> startStates = new TreeMap<DN, ServerState>();
    if ((multidomainserverstate != null)
        && (multidomainserverstate.length() > 0))
    if (multidomainserverstate != null && multidomainserverstate.length() > 0)
    {
      try
      {