From 486ffa6d0abfa0b91dc7ab22ee71758b5eecfb88 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 26 Sep 2007 18:57:15 +0000
Subject: [PATCH] Fix for 2306: configure replication encryption on or off in dsreplication and setup-gui

---
 opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java b/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java
index 234fb31..118a07e 100644
--- a/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java
+++ b/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java
@@ -104,6 +104,11 @@
   private IntegerArgument replicationPort1Arg = null;
 
   /**
+   * The 'secureReplication' argument for the first server.
+   */
+  private BooleanArgument secureReplication1Arg = null;
+
+  /**
    * The 'hostName' argument for the second server.
    */
   private StringArgument hostName2Arg = null;
@@ -144,6 +149,11 @@
   private IntegerArgument replicationPort2Arg = null;
 
   /**
+   * The 'secureReplication' argument for the second server.
+   */
+  private BooleanArgument secureReplication2Arg = null;
+
+  /**
    * The 'skipPortCheckArg' argument to not check replication ports.
    */
   private BooleanArgument skipPortCheckArg;
@@ -471,6 +481,10 @@
         "replicationPort1", false, false, true, OPTION_VALUE_PORT, 8989, null,
         INFO_DESCRIPTION_ENABLE_REPLICATION_PORT1.get());
 
+    secureReplication1Arg = new BooleanArgument("secureReplication1", null,
+        "secureReplication1",
+        INFO_DESCRIPTION_ENABLE_SECURE_REPLICATION1.get());
+
     hostName2Arg = new StringArgument("host2", 'O',
         "host2", false, false, true, OPTION_VALUE_HOST, "localhost",
         null, INFO_DESCRIPTION_ENABLE_REPLICATION_HOST2.get());
@@ -505,6 +519,10 @@
         "replicationPort2", false, false, true, OPTION_VALUE_PORT, 8989, null,
         INFO_DESCRIPTION_ENABLE_REPLICATION_PORT2.get());
 
+    secureReplication2Arg = new BooleanArgument("secureReplication2", null,
+        "secureReplication2",
+        INFO_DESCRIPTION_ENABLE_SECURE_REPLICATION2.get());
+
     skipPortCheckArg = new BooleanArgument(
         "skipportcheck", 'S', "skipPortCheck",
         INFO_DESCRIPTION_ENABLE_REPLICATION_SKIPPORT.get());
@@ -520,8 +538,10 @@
     Argument[] argsToAdd = {
         hostName1Arg, port1Arg, bindDn1Arg, bindPassword1Arg,
         bindPasswordFile1Arg, useStartTLS1Arg, useSSL1Arg, replicationPort1Arg,
+        secureReplication1Arg,
         hostName2Arg, port2Arg, bindDn2Arg, bindPassword2Arg,
         bindPasswordFile2Arg, useStartTLS2Arg, useSSL2Arg, replicationPort2Arg,
+        secureReplication2Arg,
         skipPortCheckArg, noSchemaReplicationArg
     };
     for (int i=0; i<argsToAdd.length; i++)
@@ -1030,6 +1050,17 @@
   }
 
   /**
+   * Returns whether the user asked to have replication communication with the
+   * first server or not.
+   * @return <CODE>true</CODE> the user asked to have replication communication
+   * with the first server and <CODE>false</CODE> otherwise.
+   */
+  public boolean isSecureReplication1()
+  {
+    return secureReplication1Arg.isPresent();
+  }
+
+  /**
    * Returns the second host name explicitly provided in the enable replication
    * subcommand.
    * @return the second host name explicitly provided in the enable replication
@@ -1119,6 +1150,17 @@
   }
 
   /**
+   * Returns whether the user asked to have replication communication with the
+   * second server or not.
+   * @return <CODE>true</CODE> the user asked to have replication communication
+   * with the second server and <CODE>false</CODE> otherwise.
+   */
+  public boolean isSecureReplication2()
+  {
+    return secureReplication2Arg.isPresent();
+  }
+
+  /**
    * Returns whether the user asked to skip the replication port checks (if the
    * ports are free) or not.
    * @return <CODE>true</CODE> the user asked to skip the replication port

--
Gitblit v1.10.0