From bbadcb75d4629441e73ea04782ae2c5decf64fe3 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 17 Dec 2007 10:43:53 +0000
Subject: [PATCH] 2730: New - The setup command should perform some basic memory tuning Note: this issue is not fully covered by the proposed modifications but all that is missing in order to fix it is to figure out which are the default memory values that we want to propose in the setup.
---
opends/src/server/org/opends/server/tools/tasks/TaskTool.java | 44 ++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/tasks/TaskTool.java b/opends/src/server/org/opends/server/tools/tasks/TaskTool.java
index 84c6e64..764503e 100644
--- a/opends/src/server/org/opends/server/tools/tasks/TaskTool.java
+++ b/opends/src/server/org/opends/server/tools/tasks/TaskTool.java
@@ -74,6 +74,9 @@
*/
public static final String NOW = "0";
+ private static final int RUN_OFFLINE = 51;
+ private static final int RUN_ONLINE = 52;
+
// Number of milliseconds this utility will wait before reloading
// this task's entry in the directory while it is polling for status
private static final int SYNCHRONOUS_TASK_POLL_INTERVAL = 1000;
@@ -98,6 +101,10 @@
// Client for interacting with the task backend
TaskClient taskClient;
+ // Argument used to know whether we must test if we must run in offline
+ // mode.
+ BooleanArgument testIfOfflineArg;
+
/**
* Called when this utility should perform its actions locally in this
* JVM.
@@ -121,8 +128,8 @@
* @return LDAPConnectionArgumentParser for processing CLI input
*/
protected LDAPConnectionArgumentParser createArgParser(String className,
- Message toolDescription)
- {
+ Message toolDescription)
+ {
ArgumentGroup ldapGroup = new ArgumentGroup(
INFO_DESCRIPTION_TASK_LDAP_ARGS.get(), 1001);
@@ -191,6 +198,12 @@
FailedDependencyAction.defaultValue().name()));
argParser.addArgument(failedDependencyActionArg, taskGroup);
+ testIfOfflineArg = new BooleanArgument(
+ "testIfOffline", null, "testIfOffline",
+ INFO_DESCRIPTION_TEST_IF_OFFLINE.get());
+ testIfOfflineArg.setHidden(true);
+ argParser.addArgument(testIfOfflineArg);
+
} catch (ArgumentException e) {
// should never happen
}
@@ -351,6 +364,18 @@
PrintStream out, PrintStream err) {
int ret;
+ if (testIfOffline())
+ {
+ if (!processAsTask())
+ {
+ return RUN_OFFLINE;
+ }
+ else
+ {
+ return RUN_ONLINE;
+ }
+ }
+
if (processAsTask())
{
if (initializeServer)
@@ -449,4 +474,19 @@
return argParser.connectionArgumentsPresent();
}
+ /**
+ * Indicates whether we must return if the command must be run in offline
+ * mode.
+ * @return <CODE>true</CODE> if we must return if the command must be run in
+ * offline mode and <CODE>false</CODE> otherwise.
+ */
+ private boolean testIfOffline()
+ {
+ boolean returnValue = false;
+ if (testIfOfflineArg != null)
+ {
+ returnValue = testIfOfflineArg.isPresent();
+ }
+ return returnValue;
+ }
}
--
Gitblit v1.10.0