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

gbellato
09.15.2006 7b84e53457bce1f0733afa87797afc9928568c52
opendj-sdk/opends/src/server/org/opends/server/synchronization/SynchronizationDomain.java
@@ -34,6 +34,7 @@
import static org.opends.server.synchronization.OperationContext.SYNCHROCONTEXT;
import static org.opends.server.synchronization.Historical.*;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.LinkedList;
@@ -290,10 +291,11 @@
     */
    try
    {
      broker = new ChangelogBroker(this);
      broker = new ChangelogBroker(state, baseDN, serverId, maxReceiveQueue,
          maxReceiveDelay, maxSendQueue, maxSendDelay);
      synchronized (broker)
      {
        broker.start(serverId, changelogServers);
        broker.start(changelogServers);
        if (!receiveStatus)
          broker.suspendReceive();
      }
@@ -379,7 +381,7 @@
      {
        broker.stop();
        changelogServers = newChangelogServers;
        broker.start(serverId, changelogServers);
        broker.start(changelogServers);
      }
      /*
@@ -676,14 +678,22 @@
      UpdateMessage update = null;
      while (update == null)
      {
        SynchronizationMessage msg = broker.receive();
        if (msg == null)
        SynchronizationMessage msg;
        try
        {
          // The server is in the shutdown process
          return null;
          msg = broker.receive();
          if (msg == null)
          {
            // The server is in the shutdown process
            return null;
          }
          update = msg.processReceive(this);
        } catch (SocketTimeoutException e)
        {
          // just retry
        }
        update = msg.processReceive(this);
      }
      return update;
    }
@@ -1001,28 +1011,6 @@
  }
  /**
   * Get the largest ChangeNumber that has been processed locally.
   *
   * @return The largest ChangeNumber that has been processed locally.
   */
  public ChangeNumber getMaxChangeNumber()
  {
    return state.getMaxChangeNumber(serverId);
  }
  /**
   * Create a new serverStartMessage suitable for this SynchronizationDomain.
   *
   * @return A new serverStartMessage suitable for this SynchronizationDomain.
   */
  public ServerStartMessage newServerStartMessage()
  {
    return new ServerStartMessage(serverId, baseDN, maxReceiveDelay,
                                  maxReceiveQueue, maxSendDelay, maxSendQueue,
                                  state);
  }
  /**
   * Create and replay a synchronized Operation from an UpdateMessage.
   *
   * @param msg The UpdateMessage to be replayed.
@@ -1074,6 +1062,13 @@
          {
            done = true;  // unknown type of operation ?!
          }
          if (done)
          {
            // the update became a dummy update and the result
            // of the conflict resolution phase is to do nothing.
            // however we still need to push this change to the serverState
            updateError(changeNumber);
          }
        }
        else
        {
@@ -1377,8 +1372,8 @@
      }
      else
      {
        RDN entryRdn = op.getEntryDN().getRDN();
        msg.setDn(parentDn + "," + entryRdn);
        RDN entryRdn = DN.decode(msg.getDn()).getRDN();
        msg.setDn(entryRdn + "," + parentDn);
        return false;
      }
    }
@@ -1534,7 +1529,7 @@
   */
  private String generateConflictDn(String entryUid, String dn)
  {
    return dn + "entryuuid=" + entryUid;
    return "entryuuid=" + entryUid + "+" + dn;
  }
  /**