From dc0cff95d5c42511ca2957b7c8469831983d7e2e Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Thu, 23 Aug 2007 17:46:41 +0000
Subject: [PATCH] Expands the interfaces of backup and restore with arguments for specifying an LDAP connection that can be used to schedule these operations as tasks in addition to the current behavior of operating locally.

---
 opends/src/server/org/opends/server/util/args/BooleanArgument.java |   31 ++++++++++++++++++++++++++-----
 1 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/opends/src/server/org/opends/server/util/args/BooleanArgument.java b/opends/src/server/org/opends/server/util/args/BooleanArgument.java
index 47f6fed..4f12103 100644
--- a/opends/src/server/org/opends/server/util/args/BooleanArgument.java
+++ b/opends/src/server/org/opends/server/util/args/BooleanArgument.java
@@ -35,10 +35,10 @@
 
 /**
  * This class defines an argument type that will be used to represent Boolean
- * values.  These arguments will never take values and will never be required.
- * If the argument is provided, then it will be considered true, and if not then
- * it will be considered false.  As such, the default value will always be
- * "false".
+ * values.  These arguments will never take values from the command line but
+ * and will never be required.  If the argument is provided, then it will be
+ * considered true, and if not then it will be considered false.  As such,
+ * the default value will always be "false".
  */
 public class BooleanArgument
        extends Argument
@@ -64,7 +64,7 @@
          throws ArgumentException
   {
     super(name, shortIdentifier, longIdentifier, false, false, false, null,
-          null, null, description);
+          String.valueOf(false), null, description);
   }
 
 
@@ -90,5 +90,26 @@
 
     return false;
   }
+
+
+  /**
+   * {@inheritDoc}
+   */
+  final public void addValue(String valueString) {
+    if (valueString != null) {
+      clearValues();
+      super.addValue(valueString);
+      super.setPresent(Boolean.valueOf(valueString));
+    }
+  }
+
+
+  /**
+   * {@inheritDoc}
+   */
+  final public void setPresent(boolean isPresent) {
+    addValue(String.valueOf(isPresent));
+  }
+
 }
 

--
Gitblit v1.10.0