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

jvergara
19.40.2009 e02320a2afb9967c056dd783a301cc3b6e86610e
Fix for issue 3812 (dsreplication should complain if wrong repl port given for existent replication server)

Display a warning informing the user that the server have already been configured if the user provides explicitly a replication port and if this port
value is different to the configured replication server port.

4 files modified
38 ■■■■■ changed files
opends/src/messages/messages/admin_tool.properties 2 ●●● patch | view | raw | blame | history
opends/src/messages/messages/tools.properties 8 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java 26 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/admin_tool.properties
@@ -2390,7 +2390,7 @@
INFO_CTRL_PANEL_AVAILABLE_CPUS=Available CPUs
INFO_CTRL_PANEL_SYSTEM_NAME=System Name
INFO_CTRL_PANEL_OPERATING_SYSTEM=Operating System
INFO_CTRL_PANEL_FREE_USED_MEMORY=Free Used Memory
INFO_CTRL_PANEL_FREE_USED_MEMORY=Free Memory in JVM
INFO_CTRL_PANEL_MAX_MEMORY=Max Memory
INFO_CTRL_PANEL_USED_MEMORY=Used Memory
INFO_CTRL_PANEL_CLASS_PATH=Class Path
opends/src/messages/messages/tools.properties
@@ -20,7 +20,7 @@
#
# CDDL HEADER END
#
#      Copyright 2006-2008 Sun Microsystems, Inc.
#      Copyright 2006-2009 Sun Microsystems, Inc.
@@ -2446,3 +2446,9 @@
INFO_UNCONFIGURE_USAGE_DESCRIPTION_1656=This utility unsets the instance location
INFO_DESCRIPTION_CHECK_OPTIONS_1657=Checks options are valid
MILD_WARN_FIRST_REPLICATION_SERVER_ALREADY_CONFIGURED_1658=The first server is \
 already configured with replication port '%d'.  The provided replication \
 server port '%d' has been ignored.
MILD_WARN_SECOND_REPLICATION_SERVER_ALREADY_CONFIGURED_1659=The second server \
 is already configured with replication port '%d'.  The provided replication \
 server port '%d' has been ignored.
opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java
@@ -137,7 +137,7 @@
  /**
   * The 'replicationPort' argument for the second server.
   */
  private IntegerArgument replicationPort2Arg = null;
  IntegerArgument replicationPort2Arg = null;
  /**
   * The 'secureReplication' argument for the second server.
opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java
@@ -4871,6 +4871,19 @@
            ConnectionUtils.getHostPort(ctx1)),
            ERROR_CONFIGURING_REPLICATIONSERVER, ode);
      }
      if (argParser.replicationPort1Arg.isPresent())
      {
        // Inform the user that the provided value will be ignored
        if (uData.getReplicationPort1() !=
          server1.getReplicationServerPort())
        {
          LOG.log(Level.WARNING, "Ignoring provided replication port for "+
              "first server (already configured with port "+
              server1.getReplicationServerPort()+")");
          println(WARN_FIRST_REPLICATION_SERVER_ALREADY_CONFIGURED.get(
              server1.getReplicationServerPort(), uData.getReplicationPort1()));
        }
      }
    }
    alreadyConfiguredReplicationServers.add(server1.getId());
    if (!server2.isReplicationServer())
@@ -4902,6 +4915,19 @@
            ConnectionUtils.getHostPort(ctx1)),
            ERROR_CONFIGURING_REPLICATIONSERVER, ode);
      }
      if (argParser.replicationPort2Arg.isPresent())
      {
        // Inform the user that the provided value will be ignored
        if (uData.getReplicationPort2() !=
          server2.getReplicationServerPort())
        {
          LOG.log(Level.WARNING, "Ignoring provided replication port for "+
              "second server (already configured with port "+
              server2.getReplicationServerPort()+")");
          println(WARN_SECOND_REPLICATION_SERVER_ALREADY_CONFIGURED.get(
              server2.getReplicationServerPort(), uData.getReplicationPort2()));
        }
      }
    }
    alreadyConfiguredReplicationServers.add(server2.getId());