From e6ee0bf1195bc2911b2d1efa6e5c04c3a51ef7c9 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 05 Nov 2007 22:14:14 +0000
Subject: [PATCH] Complete fix for issue 2263.

---
 opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java |   31 +++++++++++++++++++++++++++----
 1 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java b/opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java
index 7f49dca..d3657a4 100644
--- a/opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java
+++ b/opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliArgumentParser.java
@@ -168,6 +168,11 @@
   private BooleanArgument noSchemaReplicationArg;
 
   /**
+   * The 'useSecondServerAsSchemaSource' argument to not replicate schema.
+   */
+  private BooleanArgument useSecondServerAsSchemaSourceArg;
+
+  /**
    * The 'hostName' argument for the source server.
    */
   private StringArgument hostNameSourceArg = null;
@@ -558,6 +563,11 @@
         "noschemareplication", null, "noSchemaReplication",
         INFO_DESCRIPTION_ENABLE_REPLICATION_NO_SCHEMA_REPLICATION.get());
 
+    useSecondServerAsSchemaSourceArg = new BooleanArgument(
+        "usesecondserverasschemasource", null, "useSecondServerAsSchemaSource",
+        INFO_DESCRIPTION_ENABLE_REPLICATION_USE_SECOND_AS_SCHEMA_SOURCE.get(
+            noSchemaReplicationArg.getLongIdentifier()));
+
     enableReplicationSubCmd = new SubCommand(this,
         ENABLE_REPLICATION_SUBCMD_NAME,
         INFO_DESCRIPTION_SUBCMD_ENABLE_REPLICATION.get());
@@ -569,7 +579,8 @@
         hostName2Arg, port2Arg, bindDn2Arg, bindPassword2Arg,
         bindPasswordFile2Arg, useStartTLS2Arg, useSSL2Arg, replicationPort2Arg,
         secureReplication2Arg,
-        skipPortCheckArg, noSchemaReplicationArg
+        skipPortCheckArg, noSchemaReplicationArg,
+        useSecondServerAsSchemaSourceArg
     };
     for (int i=0; i<argsToAdd.length; i++)
     {
@@ -1252,8 +1263,8 @@
 
   /**
    * Returns whether the user asked to not replicate the schema between servers.
-   * @return <CODE>true</CODE> the user asked to not replicate schema and <CODE>
-   * false</CODE> otherwise.
+   * @return <CODE>true</CODE> if the user asked to not replicate schema and
+   * <CODE>false</CODE> otherwise.
    */
   public boolean noSchemaReplication()
   {
@@ -1261,6 +1272,17 @@
   }
 
   /**
+   * Returns whether the user asked to use the second server to initialize the
+   * schema of the first server.
+   * @return <CODE>true</CODE> if the user asked to use the second server to
+   * initialize the schema of the first server and <CODE>false</CODE> otherwise.
+   */
+  public boolean useSecondServerAsSchemaSource()
+  {
+    return useSecondServerAsSchemaSourceArg.isPresent();
+  }
+
+  /**
    * Returns the host name explicitly provided in the disable replication
    * subcommand.
    * @return the host name explicitly provided in the disable replication
@@ -1709,7 +1731,8 @@
         {bindPassword1Arg, bindPasswordFile1Arg},
         {useStartTLS1Arg, useSSL1Arg},
         {bindPassword2Arg, bindPasswordFile2Arg},
-        {useStartTLS2Arg, useSSL2Arg}
+        {useStartTLS2Arg, useSSL2Arg},
+        {noSchemaReplicationArg, useSecondServerAsSchemaSourceArg}
     };
 
     for (int i=0; i< conflictingPairs.length; i++)

--
Gitblit v1.10.0