From 5363b9d3da9faf53b3e135dae0a68e4f70b99c5f Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Thu, 19 Feb 2009 17:40:39 +0000
Subject: [PATCH] Fix for issue 3812 (dsreplication should complain if wrong repl port given for existent replication server)

---
 opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java b/opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java
index 37be70f..abeb70a 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/dsreplication/ReplicationCliMain.java
+++ b/opendj-sdk/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());
 

--
Gitblit v1.10.0