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

fdorson
07.45.2008 87e069074e41b0008cf0b549fce36b7dc4fcae30
opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java
@@ -2248,12 +2248,14 @@
    disabled = true;
    // Stop the listener thread
    listenerThread.shutdown();
    if (listenerThread != null)
      listenerThread.shutdown();
    broker.stop(); // This will cut the session and wake up the listener
    // Wait for the listener thread to stop
    listenerThread.waitForShutdown();
    if (listenerThread != null)
      listenerThread.waitForShutdown();
  }
  /**
@@ -3456,15 +3458,35 @@
    // server id and base dn are readonly.
    // isolationPolicy can be set immediately and will apply
    // to the next updates.
    // The other parameters needs to be renegociated with the ReplicationServer.
    // The other parameters needs to be renegociated with the ReplicationServer
    // so that requires restarting the session with the ReplicationServer.
    replicationServers = configuration.getReplicationServer();
    Boolean needToRestartSession = false;
    Collection<String> newReplServers = configuration.getReplicationServer();
    // A new session is necessary only when information regarding
    // the connection is modified
    if ((!(replicationServers.size() == newReplServers.size()
        && replicationServers.containsAll(newReplServers))) ||
        window != configuration.getWindowSize() ||
        heartbeatInterval != configuration.getHeartbeatInterval())
      needToRestartSession = true;
    replicationServers = newReplServers;
    window = configuration.getWindowSize();
    heartbeatInterval = configuration.getHeartbeatInterval();
    broker.changeConfig(replicationServers, maxReceiveQueue, maxReceiveDelay,
                        maxSendQueue, maxSendDelay, window, heartbeatInterval);
        maxSendQueue, maxSendDelay, window, heartbeatInterval);
    isolationpolicy = configuration.getIsolationPolicy();
    // To be able to stop and restart the broker properly just
    // disable and enable the domain. That way a new session
    // with the new configuration is available.
    if (needToRestartSession)
    {
      this.disable();
      this.enable();
    }
    return new ConfigChangeResult(ResultCode.SUCCESS, false);
  }