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

jvergara
08.29.2009 7eaeeedf8905d5d5fdad7fbc3dc02c49dcfc406f
Follow up to fix for issue 4092 (dsreplication should allow to configure servers with no replication server and servers with only a replication server)
Handle the case where a server with no replication server must be configuredFollow up to fix for issue 4092 (dsreplication should allow to configure servers with no replication server and servers with only a replication server)
Handle the case where a server with no replication server must be configured..
Configure replication servers with no domain.
Fix an issue with an explanation in the dsreplication status table.

1 files modified
55 ■■■■ changed files
opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java 55 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java
@@ -6187,14 +6187,14 @@
      {
        printlnProgress();
        printProgress(INFO_REPLICATION_STATUS_REPLICATED_LEGEND.get());
        if (!replicasWithNoReplicationServer.isEmpty())
        if (!replicasWithNoReplicationServer.isEmpty() ||
            !serversWithNoReplica.isEmpty())
        {
          printlnProgress();
          printProgress(
              INFO_REPLICATION_STATUS_NOT_A_REPLICATION_SERVER_LEGEND.get());
        }
        if (!replicasWithNoReplicationServer.isEmpty())
        {
          printlnProgress();
          printProgress(
              INFO_REPLICATION_STATUS_NOT_A_REPLICATION_DOMAIN_LEGEND.get());
@@ -7118,6 +7118,10 @@
      Set<String> alreadyConfiguredReplicationServers)
  throws ReplicationCliException
  {
    Set<ServerDescriptor> serversToConfigureDomain =
      new HashSet<ServerDescriptor>();
    Set<ServerDescriptor> replicationServersToConfigure =
      new HashSet<ServerDescriptor>();
    SuffixDescriptor suffix = getSuffix(baseDN, cache, server);
    if (suffix != null)
    {
@@ -7126,6 +7130,40 @@
        ServerDescriptor s = replica.getServer();
        if (!alreadyConfiguredServers.contains(s.getId()))
        {
          serversToConfigureDomain.add(server);
        }
      }
    }
    // Now check the replication servers.
    for (ServerDescriptor s : cache.getServers())
    {
      if (s.isReplicationServer() &&
          !alreadyConfiguredReplicationServers.contains(server.getId()))
      {
        // Check if it is part of the replication topology
        boolean isInTopology = false;
        String repServerID = s.getReplicationServerHostPort();
        for (String rID : repServers)
        {
          if (repServerID.equalsIgnoreCase(rID))
          {
            isInTopology = true;
            break;
          }
        }
        if (isInTopology)
        {
          replicationServersToConfigure.add(server);
        }
      }
    }
    Set<ServerDescriptor> allServers = new HashSet<ServerDescriptor>();
    allServers.addAll(serversToConfigureDomain);
    allServers.addAll(replicationServersToConfigure);
    for (ServerDescriptor s : allServers)
    {
          String dn = ConnectionUtils.getBindDN(
              cache.getAdsContext().getDirContext());
          String pwd = ConnectionUtils.getBindPassword(
@@ -7140,11 +7178,13 @@
          try
          {
            ctx = loader.createContext();
        if (serversToConfigureDomain.contains(server))
        {
            configureToReplicateBaseDN(ctx, baseDN, repServers, usedIds);
            if (!alreadyConfiguredReplicationServers.contains(s.getId()))
        }
        if (replicationServersToConfigure.contains(server))
            {
              updateReplicationServer(ctx, allRepServers);
              alreadyConfiguredReplicationServers.add(s.getId());
            }
          }
          catch (NamingException ne)
@@ -7176,8 +7216,7 @@
            }
          }
          alreadyConfiguredServers.add(s.getId());
        }
      }
      alreadyConfiguredReplicationServers.add(s.getId());
    }
  }