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

Jean-Noel Rouvignac
02.01.2013 891159050af4aa3fe47c67e3ba7d3f21299027a4
opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -144,9 +144,7 @@
    throws ConfigException
  {
    this.config = configuration;
    this.changelogDB =
        new JEChangelogDB(this, configuration.getReplicationDBDirectory());
    this.changelogDB = new JEChangelogDB(this, configuration);
    replSessionSecurity = new ReplSessionSecurity();
    initialize();
@@ -764,6 +762,9 @@
  public ConfigChangeResult applyConfigurationChange(
      ReplicationServerCfg configuration)
  {
    ResultCode resultCode = ResultCode.SUCCESS;
    boolean adminActionRequired = false;
    // Some of those properties change don't need specific code.
    // They will be applied for next connections. Some others have immediate
    // effect
@@ -779,6 +780,20 @@
    {
      this.changelogDB.setPurgeDelay(getTrimAge());
    }
    final boolean computeCN = config.isComputeChangenumber();
    if (computeCN != oldConfig.isComputeChangenumber())
    {
      try
      {
        this.changelogDB.setComputeChangeNumber(computeCN);
      }
      catch (ChangelogException e)
      {
        if (debugEnabled())
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        resultCode = ResultCode.OPERATIONS_ERROR;
      }
    }
    // changing the listen port requires to stop the listen thread
    // and restart it.
@@ -800,10 +815,14 @@
      }
      catch (IOException e)
      {
        if (debugEnabled())
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        logError(ERR_COULD_NOT_CLOSE_THE_SOCKET.get(e.toString()));
      }
      catch (InterruptedException e)
      {
        if (debugEnabled())
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        logError(ERR_COULD_NOT_STOP_LISTEN_THREAD.get(e.toString()));
      }
    }
@@ -849,10 +868,9 @@
    final String newDir = config.getReplicationDBDirectory();
    if (newDir != null && !newDir.equals(oldConfig.getReplicationDBDirectory()))
    {
      return new ConfigChangeResult(ResultCode.SUCCESS, true);
      adminActionRequired = true;
    }
    return new ConfigChangeResult(ResultCode.SUCCESS, false);
    return new ConfigChangeResult(resultCode, adminActionRequired);
  }
  /**
@@ -1505,7 +1523,7 @@
  public MultiDomainServerState getNewestECLCookie(Set<String> excludedBaseDNs)
  {
    // Initialize start state for all running domains with empty state
    MultiDomainServerState result = new MultiDomainServerState();
    final MultiDomainServerState result = new MultiDomainServerState();
    for (ReplicationServerDomain rsDomain : getReplicationServerDomains())
    {
      if (contains(excludedBaseDNs, rsDomain.getBaseDN().toNormalizedString()))
@@ -1513,7 +1531,7 @@
      final ServerState latestDBServerState = rsDomain.getLatestServerState();
      if (latestDBServerState.isEmpty())
        continue;
      result.update(rsDomain.getBaseDN(), latestDBServerState);
      result.replace(rsDomain.getBaseDN(), latestDBServerState);
    }
    return result;
  }