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

jvergara
27.38.2009 9ee3d32dd459650afff9678e49d2535962333862
Fix for issue 4195 (dsreplication enable should check that the user did not provide the same host:port twice)
The fix also applies to dsreplication initialize.
2 files modified
22 ■■■■■ changed files
opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java 18 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java
@@ -1913,7 +1913,7 @@
    if (hostName1Arg.getValue().equalsIgnoreCase(hostName2Arg.getValue()) &&
        !isInteractive())
    {
      if (port1Arg.getValue() == port2Arg.getValue())
      if (port1Arg.getValue().equals(port2Arg.getValue()))
      {
        Message message = ERR_REPLICATION_ENABLE_SAME_SERVER_PORT.get(
            hostName1Arg.getValue(), port1Arg.getValue());
@@ -2033,7 +2033,7 @@
    if (hostNameSourceArg.getValue().equalsIgnoreCase(
        hostNameDestinationArg.getValue()) && !isInteractive())
    {
      if (portSourceArg.getValue() == portDestinationArg.getValue())
      if (portSourceArg.getValue().equals(portDestinationArg.getValue()))
      {
        Message message = ERR_REPLICATION_INITIALIZE_SAME_SERVER_PORT.get(
            hostNameSourceArg.getValue(), portSourceArg.getValue());
opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java
@@ -2267,6 +2267,23 @@
        hostDestination = ci.getHostName();
        portDestination = ci.getPortNumber();
        boolean error = false;
        if (hostSource.equalsIgnoreCase(hostDestination))
        {
          if (portSource == portDestination)
          {
            portDestination = -1;
            Message message = ERR_REPLICATION_INITIALIZE_SAME_SERVER_PORT.get(
                hostSource, String.valueOf(portSource));
            println();
            println(message);
            println();
            error = true;
          }
        }
        if (!error)
        {
        ctxDestination = createInitialLdapContextInteracting(ci);
        if (ctxDestination == null)
@@ -2274,6 +2291,7 @@
          cancelled = true;
        }
      }
      }
      catch (ClientException ce)
      {
        LOG.log(Level.WARNING, "Client exception "+ce);