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

Ludovic Poitou
04.16.2013 b6baf9b93cd501ac43200589d37feefd1e5291c2
opends/src/server/org/opends/server/replication/server/DataServerHandler.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions copyright 2011-2012 ForgeRock AS
 *      Portions copyright 2011-2013 ForgeRock AS
 */
package org.opends.server.replication.server;
@@ -61,7 +61,7 @@
 */
public class DataServerHandler extends ServerHandler
{
  // Temporay generationId received in handshake/phase1,
  // Temporary generationId received in handshake/phase1,
  // and used after handshake/phase2
  long tmpGenerationId;
@@ -204,7 +204,7 @@
    if (newStatus == ServerStatus.INVALID_STATUS)
    {
      Message msg = ERR_RS_CANNOT_CHANGE_STATUS.get(getServiceId().toString(),
      Message msg = ERR_RS_CANNOT_CHANGE_STATUS.get(getServiceId(),
          Integer.toString(serverId), status.toString(), event.toString());
      logError(msg);
      return;
@@ -393,7 +393,7 @@
    ServerStatus newStatus = StatusMachine.computeNewStatus(status, event);
    if (newStatus == ServerStatus.INVALID_STATUS)
    {
      Message msg = ERR_RS_CANNOT_CHANGE_STATUS.get(getServiceId().toString(),
      Message msg = ERR_RS_CANNOT_CHANGE_STATUS.get(getServiceId(),
          Integer.toString(serverId), status.toString(), event.toString());
      logError(msg);
      return ServerStatus.INVALID_STATUS;
@@ -483,8 +483,21 @@
       * let the reader thread see the closure and cleanup any reference
       * to old connection. This must be done before taking the domain lock so
       * that the reader thread has a chance to stop the handler.
       *
       * TODO: This hack should be removed and disconnection/reconnection
       * properly dealt with.
       */
      replicationServerDomain.waitDisconnection(inServerStartMsg.getServerId());
      if (replicationServerDomain.getConnectedDSs()
          .containsKey(inServerStartMsg.getServerId()))
      {
        try {
          Thread.sleep(100);
        }
        catch(Exception e){
          abortStart(null);
          return;
        }
      }
      // lock with no timeout
      lockDomain(false);
@@ -649,11 +662,10 @@
   */
  public DSInfo toDSInfo()
  {
    DSInfo dsInfo = new DSInfo(serverId, replicationServerId, generationId,
    return new DSInfo(serverId, replicationServerId, generationId,
      status, assuredFlag, assuredMode, safeDataLevel, groupId, refUrls,
      eclIncludes, eclIncludesForDeletes, protocolVersion);
    return dsInfo;
  }
  /**