From 9be33d0929c290b2ee31b1b0d8fddab32f99674e Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Fri, 10 Nov 2006 23:45:06 +0000
Subject: [PATCH] Make a number of changes to administrative tools provided with OpenDS. These are all made under the umbrella of issue #994, but there are individual issues for each change.
---
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java | 523 +++++---
opendj-sdk/opends/resource/bin/_server-script.bat | 2
opendj-sdk/opends/resource/bin/stop-ds | 8
opendj-sdk/opends/src/server/org/opends/server/tools/ConfigureDS.java | 34
opendj-sdk/opends/resource/bin/makeldif | 3
opendj-sdk/opends/resource/bin/makeldif.bat | 1
opendj-sdk/opends/src/server/org/opends/server/tools/StopDS.java | 45
opendj-sdk/opends/resource/bin/ldifsearch | 3
opendj-sdk/opends/resource/bin/verify-index | 3
opendj-sdk/opends/resource/bin/_client-script.bat | 2
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java | 372 ++++--
opendj-sdk/opends/resource/bin/ldapmodify.bat | 1
opendj-sdk/opends/src/server/org/opends/server/util/ServerConstants.java | 15
opendj-sdk/opends/src/server/org/opends/server/util/args/SubCommandArgumentParser.java | 80 +
opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfileViewer.java | 3
opendj-sdk/opends/src/server/org/opends/server/messages/PluginMessages.java | 12
opendj-sdk/opends/resource/bin/start-ds.bat | 2
opendj-sdk/opends/src/server/org/opends/server/tools/LDIFDiff.java | 4
opendj-sdk/opends/resource/bin/backup | 3
opendj-sdk/opends/resource/bin/_server-script.sh | 2
opendj-sdk/opends/resource/bin/import-ldif.bat | 1
opendj-sdk/opends/resource/bin/export-ldif.bat | 1
opendj-sdk/opends/resource/bin/_client-script.sh | 2
opendj-sdk/opends/resource/bin/encode-password.bat | 1
opendj-sdk/opends/resource/bin/restore | 3
opendj-sdk/opends/src/server/org/opends/server/tools/InstallDS.java | 12
opendj-sdk/opends/resource/bin/ldappasswordmodify | 3
opendj-sdk/opends/resource/bin/ldifmodify.bat | 1
opendj-sdk/opends/resource/bin/ldapcompare | 3
opendj-sdk/opends/resource/bin/start-ds | 9
opendj-sdk/opends/src/server/org/opends/server/tools/BackUpDB.java | 43
opendj-sdk/opends/resource/bin/ldappasswordmodify.bat | 1
opendj-sdk/opends/resource/bin/ldifmodify | 3
opendj-sdk/opends/resource/bin/ldifsearch.bat | 1
opendj-sdk/opends/src/server/org/opends/server/tools/EncodePassword.java | 65
opendj-sdk/opends/resource/setup.bat | 2
opendj-sdk/opends/resource/bin/restore.bat | 1
opendj-sdk/opends/src/server/org/opends/server/messages/CoreMessages.java | 29
opendj-sdk/opends/resource/bin/verify-index.bat | 1
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java | 325 +++--
opendj-sdk/opends/src/server/org/opends/server/tools/LDIFSearch.java | 4
opendj-sdk/opends/resource/bin/ldif-diff | 3
opendj-sdk/opends/resource/bin/ldapcompare.bat | 1
opendj-sdk/opends/resource/bin/stop-ds.bat | 1
opendj-sdk/opends/src/server/org/opends/server/tools/ImportLDIF.java | 49
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java | 31
opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/MakeLDIF.java | 12
opendj-sdk/opends/src/server/org/opends/server/tools/LDIFModify.java | 4
opendj-sdk/opends/src/server/org/opends/server/util/args/ArgumentParser.java | 68 +
opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java | 5
opendj-sdk/opends/src/server/org/opends/server/tools/VerifyIndex.java | 37
opendj-sdk/opends/resource/bin/export-ldif | 3
opendj-sdk/opends/src/server/org/opends/server/tools/ExportLDIF.java | 39
opendj-sdk/opends/resource/bin/ldapmodify | 3
opendj-sdk/opends/resource/bin/ldapsearch | 3
opendj-sdk/opends/resource/bin/backup.bat | 1
opendj-sdk/opends/resource/bin/configure-ds.bat | 1
opendj-sdk/opends/resource/bin/ldif-diff.bat | 1
opendj-sdk/opends/resource/bin/import-ldif | 3
opendj-sdk/opends/resource/bin/ldapdelete.bat | 1
opendj-sdk/opends/resource/bin/encode-password | 3
opendj-sdk/opends/src/server/org/opends/server/tools/WaitForFileDelete.java | 12
opendj-sdk/opends/resource/bin/ldapsearch.bat | 1
opendj-sdk/opends/resource/setup.sh | 3
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPDelete.java | 280 +++-
opendj-sdk/opends/src/server/org/opends/server/tools/RestoreDB.java | 32
opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java | 907 +++++++++++-----
opendj-sdk/opends/resource/bin/ldapdelete | 3
opendj-sdk/opends/resource/bin/configure-ds | 3
69 files changed, 2,006 insertions(+), 1,133 deletions(-)
diff --git a/opendj-sdk/opends/resource/bin/_client-script.bat b/opendj-sdk/opends/resource/bin/_client-script.bat
index 5aa0f37..b9c04e9 100644
--- a/opendj-sdk/opends/resource/bin/_client-script.bat
+++ b/opendj-sdk/opends/resource/bin/_client-script.bat
@@ -61,7 +61,7 @@
set PATH=%SystemRoot%
-%JAVA_BIN% %JAVA_ARGS% %OPENDS_INVOKE_CLASS% %*
+%JAVA_BIN% %JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% %*
:end
diff --git a/opendj-sdk/opends/resource/bin/_client-script.sh b/opendj-sdk/opends/resource/bin/_client-script.sh
index 9f92e2a..b4723f4 100755
--- a/opendj-sdk/opends/resource/bin/_client-script.sh
+++ b/opendj-sdk/opends/resource/bin/_client-script.sh
@@ -94,4 +94,4 @@
# Launch the appropriate server utility.
-"${JAVA_BIN}" ${JAVA_ARGS} "${OPENDS_INVOKE_CLASS}" "${@}"
+"${JAVA_BIN}" ${JAVA_ARGS} ${SCRIPT_NAME_ARG} "${OPENDS_INVOKE_CLASS}" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/_server-script.bat b/opendj-sdk/opends/resource/bin/_server-script.bat
index e595ba9..908963e 100644
--- a/opendj-sdk/opends/resource/bin/_server-script.bat
+++ b/opendj-sdk/opends/resource/bin/_server-script.bat
@@ -61,7 +61,7 @@
set PATH=%SystemRoot%
-%JAVA_BIN% %JAVA_ARGS% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %*
+%JAVA_BIN% %JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" %*
:end
diff --git a/opendj-sdk/opends/resource/bin/_server-script.sh b/opendj-sdk/opends/resource/bin/_server-script.sh
index 0915084..0629d88 100755
--- a/opendj-sdk/opends/resource/bin/_server-script.sh
+++ b/opendj-sdk/opends/resource/bin/_server-script.sh
@@ -94,6 +94,6 @@
# Launch the appropriate server utility.
-"${JAVA_BIN}" ${JAVA_ARGS} "${OPENDS_INVOKE_CLASS}" \
+"${JAVA_BIN}" ${JAVA_ARGS} ${SCRIPT_NAME_ARG} "${OPENDS_INVOKE_CLASS}" \
--configClass org.opends.server.extensions.ConfigFileHandler \
--configFile "${INSTANCE_ROOT}/config/config.ldif" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/backup b/opendj-sdk/opends/resource/bin/backup
index c634303..bd2b09e 100755
--- a/opendj-sdk/opends/resource/bin/backup
+++ b/opendj-sdk/opends/resource/bin/backup
@@ -30,5 +30,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.BackUpDB"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=backup"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_server-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/backup.bat b/opendj-sdk/opends/resource/bin/backup.bat
index be05a42..e1f3165 100644
--- a/opendj-sdk/opends/resource/bin/backup.bat
+++ b/opendj-sdk/opends/resource/bin/backup.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.BackUpDB"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=backup"
call "%~dP0\_server-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/configure-ds b/opendj-sdk/opends/resource/bin/configure-ds
index 23553d5..1a7e22a 100755
--- a/opendj-sdk/opends/resource/bin/configure-ds
+++ b/opendj-sdk/opends/resource/bin/configure-ds
@@ -31,5 +31,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.ConfigureDS"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=configure-ds"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_server-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/configure-ds.bat b/opendj-sdk/opends/resource/bin/configure-ds.bat
index b079158..6742792 100644
--- a/opendj-sdk/opends/resource/bin/configure-ds.bat
+++ b/opendj-sdk/opends/resource/bin/configure-ds.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.ConfigureDS"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=configure-ds"
call "%~dP0\_server-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/encode-password b/opendj-sdk/opends/resource/bin/encode-password
index 0dd53d3..d68144c 100755
--- a/opendj-sdk/opends/resource/bin/encode-password
+++ b/opendj-sdk/opends/resource/bin/encode-password
@@ -31,5 +31,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.EncodePassword"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=encode-password"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_server-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/encode-password.bat b/opendj-sdk/opends/resource/bin/encode-password.bat
index 3917c41..4daca2c 100644
--- a/opendj-sdk/opends/resource/bin/encode-password.bat
+++ b/opendj-sdk/opends/resource/bin/encode-password.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.EncodePassword"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=encode-password"
call "%~dP0\_server-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/export-ldif b/opendj-sdk/opends/resource/bin/export-ldif
index bf5fb5d..e1b4d7e 100755
--- a/opendj-sdk/opends/resource/bin/export-ldif
+++ b/opendj-sdk/opends/resource/bin/export-ldif
@@ -31,5 +31,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.ExportLDIF"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=export-ldif"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_server-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/export-ldif.bat b/opendj-sdk/opends/resource/bin/export-ldif.bat
index 4baf3f7..4a6112d 100644
--- a/opendj-sdk/opends/resource/bin/export-ldif.bat
+++ b/opendj-sdk/opends/resource/bin/export-ldif.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.ExportLDIF"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=export-ldif"
call "%~dP0\_server-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/import-ldif b/opendj-sdk/opends/resource/bin/import-ldif
index e077470..0ebe3e8 100755
--- a/opendj-sdk/opends/resource/bin/import-ldif
+++ b/opendj-sdk/opends/resource/bin/import-ldif
@@ -30,5 +30,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.ImportLDIF"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=import-ldif"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_server-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/import-ldif.bat b/opendj-sdk/opends/resource/bin/import-ldif.bat
index 7c216d6..64205a8 100644
--- a/opendj-sdk/opends/resource/bin/import-ldif.bat
+++ b/opendj-sdk/opends/resource/bin/import-ldif.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.ImportLDIF"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=import-ldif"
call "%~dP0\_server-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/ldapcompare b/opendj-sdk/opends/resource/bin/ldapcompare
index 1c6c6c5..5bbe8b0 100755
--- a/opendj-sdk/opends/resource/bin/ldapcompare
+++ b/opendj-sdk/opends/resource/bin/ldapcompare
@@ -30,5 +30,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPCompare"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapcompare"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_client-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/ldapcompare.bat b/opendj-sdk/opends/resource/bin/ldapcompare.bat
index efdcfaa..36d9422 100644
--- a/opendj-sdk/opends/resource/bin/ldapcompare.bat
+++ b/opendj-sdk/opends/resource/bin/ldapcompare.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPCompare"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapcompare"
call "%~dP0\_client-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/ldapdelete b/opendj-sdk/opends/resource/bin/ldapdelete
index c106488..a67ecf9 100755
--- a/opendj-sdk/opends/resource/bin/ldapdelete
+++ b/opendj-sdk/opends/resource/bin/ldapdelete
@@ -30,5 +30,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPDelete"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapdelete"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_client-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/ldapdelete.bat b/opendj-sdk/opends/resource/bin/ldapdelete.bat
index 77a3fe5..1eed132 100644
--- a/opendj-sdk/opends/resource/bin/ldapdelete.bat
+++ b/opendj-sdk/opends/resource/bin/ldapdelete.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPDelete"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapdelete"
call "%~dP0\_client-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/ldapmodify b/opendj-sdk/opends/resource/bin/ldapmodify
index a281e3b..d111d97 100755
--- a/opendj-sdk/opends/resource/bin/ldapmodify
+++ b/opendj-sdk/opends/resource/bin/ldapmodify
@@ -31,5 +31,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPModify"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapmodify"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_client-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/ldapmodify.bat b/opendj-sdk/opends/resource/bin/ldapmodify.bat
index 2483f82..f39fdff 100644
--- a/opendj-sdk/opends/resource/bin/ldapmodify.bat
+++ b/opendj-sdk/opends/resource/bin/ldapmodify.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPModify"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapmodify"
call "%~dP0\_client-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/ldappasswordmodify b/opendj-sdk/opends/resource/bin/ldappasswordmodify
index be7e42f..a42035c 100755
--- a/opendj-sdk/opends/resource/bin/ldappasswordmodify
+++ b/opendj-sdk/opends/resource/bin/ldappasswordmodify
@@ -30,5 +30,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPPasswordModify"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldappasswordmodify"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_client-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/ldappasswordmodify.bat b/opendj-sdk/opends/resource/bin/ldappasswordmodify.bat
index 1321df8..1b8834f 100644
--- a/opendj-sdk/opends/resource/bin/ldappasswordmodify.bat
+++ b/opendj-sdk/opends/resource/bin/ldappasswordmodify.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPPasswordModify"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldappasswordmodify"
call "%~dP0\_client-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/ldapsearch b/opendj-sdk/opends/resource/bin/ldapsearch
index cbec1d0..8b1ef76 100755
--- a/opendj-sdk/opends/resource/bin/ldapsearch
+++ b/opendj-sdk/opends/resource/bin/ldapsearch
@@ -30,5 +30,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPSearch"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapsearch"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_client-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/ldapsearch.bat b/opendj-sdk/opends/resource/bin/ldapsearch.bat
index e012c89..23f5513 100644
--- a/opendj-sdk/opends/resource/bin/ldapsearch.bat
+++ b/opendj-sdk/opends/resource/bin/ldapsearch.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPSearch"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapsearch"
call "%~dP0\_client-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/ldif-diff b/opendj-sdk/opends/resource/bin/ldif-diff
index 77a144a..69802dd 100755
--- a/opendj-sdk/opends/resource/bin/ldif-diff
+++ b/opendj-sdk/opends/resource/bin/ldif-diff
@@ -30,5 +30,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.LDIFDiff"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldif-diff"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_client-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/ldif-diff.bat b/opendj-sdk/opends/resource/bin/ldif-diff.bat
index 9198790..7ff331e 100644
--- a/opendj-sdk/opends/resource/bin/ldif-diff.bat
+++ b/opendj-sdk/opends/resource/bin/ldif-diff.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDIFDiff"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldif-diff"
call "%~dP0\_client-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/ldifmodify b/opendj-sdk/opends/resource/bin/ldifmodify
index d7c8693..36b650d 100755
--- a/opendj-sdk/opends/resource/bin/ldifmodify
+++ b/opendj-sdk/opends/resource/bin/ldifmodify
@@ -30,5 +30,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.LDIFModify"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldifmodify"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_server-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/ldifmodify.bat b/opendj-sdk/opends/resource/bin/ldifmodify.bat
index c68e313..cccb864 100644
--- a/opendj-sdk/opends/resource/bin/ldifmodify.bat
+++ b/opendj-sdk/opends/resource/bin/ldifmodify.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDIFModify"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldifmodify"
call "%~dP0\_server-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/ldifsearch b/opendj-sdk/opends/resource/bin/ldifsearch
index fb8958d..95da317 100755
--- a/opendj-sdk/opends/resource/bin/ldifsearch
+++ b/opendj-sdk/opends/resource/bin/ldifsearch
@@ -30,5 +30,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.LDIFSearch"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldifsearch"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_client-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/ldifsearch.bat b/opendj-sdk/opends/resource/bin/ldifsearch.bat
index a0d3414..16cf549 100644
--- a/opendj-sdk/opends/resource/bin/ldifsearch.bat
+++ b/opendj-sdk/opends/resource/bin/ldifsearch.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDIFSearch"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldifsearch"
call "%~dP0\_client-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/makeldif b/opendj-sdk/opends/resource/bin/makeldif
index 9129946..28bc1c9 100755
--- a/opendj-sdk/opends/resource/bin/makeldif
+++ b/opendj-sdk/opends/resource/bin/makeldif
@@ -30,6 +30,9 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.makeldif.MakeLDIF"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=makeldif"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_server-script.sh" \
--resourcePath "${SCRIPT_DIR}/../config/MakeLDIF" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/makeldif.bat b/opendj-sdk/opends/resource/bin/makeldif.bat
index 67bd708..0957dee 100644
--- a/opendj-sdk/opends/resource/bin/makeldif.bat
+++ b/opendj-sdk/opends/resource/bin/makeldif.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.makeldif.MakeLDIF"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=makeldif"
call "%~dP0\_server-script.bat" --resourcePath "%~dP0..\config\MakeLDIF" %*
diff --git a/opendj-sdk/opends/resource/bin/restore b/opendj-sdk/opends/resource/bin/restore
index 6758eb9..426d9d0 100755
--- a/opendj-sdk/opends/resource/bin/restore
+++ b/opendj-sdk/opends/resource/bin/restore
@@ -30,5 +30,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.RestoreDB"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=restore"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_server-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/restore.bat b/opendj-sdk/opends/resource/bin/restore.bat
index 4c544a8..320c9a2 100644
--- a/opendj-sdk/opends/resource/bin/restore.bat
+++ b/opendj-sdk/opends/resource/bin/restore.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.RestoreDB"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=restore"
call "%~dP0\_server-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/start-ds b/opendj-sdk/opends/resource/bin/start-ds
index af9570c..f2bee71 100755
--- a/opendj-sdk/opends/resource/bin/start-ds
+++ b/opendj-sdk/opends/resource/bin/start-ds
@@ -92,6 +92,11 @@
STARTING_FILE=${INSTANCE_ROOT}/logs/server.starting
+# Specify the script name so that it may be provided in command-line usage.
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=start-ds"
+export SCRIPT_NAME_ARG
+
+
# See if an "-N" or a "--nodetach" argument was provided as a command-line
# argument. If it was, then don't use nohup to send to the background, and
# send all output to both the console and a lot file.
@@ -114,13 +119,13 @@
then
echo $$ > "${PID_FILE}"
rm -f "${PID_FILE}" "${LOG_FILE}"
- exec "${JAVA_BIN}" ${JAVA_ARGS} \
+ exec "${JAVA_BIN}" ${JAVA_ARGS} ${SCRIPT_NAME_ARG} \
org.opends.server.core.DirectoryServer \
--configClass org.opends.server.extensions.ConfigFileHandler \
--configFile "${CONFIG_FILE}" "${@}"
else
touch "${STARTING_FILE}"
- nohup "${JAVA_BIN}" ${JAVA_ARGS} \
+ nohup "${JAVA_BIN}" ${JAVA_ARGS} ${SCRIPT_NAME_ARG} \
org.opends.server.core.DirectoryServer \
--configClass org.opends.server.extensions.ConfigFileHandler \
--configFile "${CONFIG_FILE}" "${@}" > "${LOG_FILE}" 2>&1 &
diff --git a/opendj-sdk/opends/resource/bin/start-ds.bat b/opendj-sdk/opends/resource/bin/start-ds.bat
index 4c06e38..11ec3e7 100644
--- a/opendj-sdk/opends/resource/bin/start-ds.bat
+++ b/opendj-sdk/opends/resource/bin/start-ds.bat
@@ -50,6 +50,8 @@
set PATH=%SystemRoot%
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=start-ds"
+
set NODETACH=0
for %%x in (%*) DO if "%%x" == "-N" set NODETACH=1
for %%x in (%*) DO if "%%x" == "--nodetach" set NODETACH=1
diff --git a/opendj-sdk/opends/resource/bin/stop-ds b/opendj-sdk/opends/resource/bin/stop-ds
index 5b62199..ea29e5b 100755
--- a/opendj-sdk/opends/resource/bin/stop-ds
+++ b/opendj-sdk/opends/resource/bin/stop-ds
@@ -93,6 +93,11 @@
export CLASSPATH
+# Specify the script name so that it may be provided in command-line usage.
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=stop-ds"
+export SCRIPT_NAME_ARG
+
+
# See if any arguments were provided and if a local PID file exists. If there
# were no arguments and there is a PID file, then try to stop the server with
# a kill command.
@@ -115,4 +120,5 @@
# If we've gotten here, then we should try to stop the server over LDAP.
-"${JAVA_BIN}" ${JAVA_ARGS} org.opends.server.tools.StopDS "${@}"
+"${JAVA_BIN}" ${JAVA_ARGS} ${SCRIPT_NAME_ARG} \
+ org.opends.server.tools.StopDS "${@}"
diff --git a/opendj-sdk/opends/resource/bin/stop-ds.bat b/opendj-sdk/opends/resource/bin/stop-ds.bat
index f2cbe2f..30b327c 100644
--- a/opendj-sdk/opends/resource/bin/stop-ds.bat
+++ b/opendj-sdk/opends/resource/bin/stop-ds.bat
@@ -28,4 +28,5 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.StopDS"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=stop-ds"
call "%~dP0\_client-script.bat" %*
diff --git a/opendj-sdk/opends/resource/bin/verify-index b/opendj-sdk/opends/resource/bin/verify-index
index 2aad97c..ad3a68f 100755
--- a/opendj-sdk/opends/resource/bin/verify-index
+++ b/opendj-sdk/opends/resource/bin/verify-index
@@ -31,5 +31,8 @@
OPENDS_INVOKE_CLASS="org.opends.server.tools.VerifyIndex"
export OPENDS_INVOKE_CLASS
+SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=verify-index"
+export SCRIPT_NAME_ARG
+
SCRIPT_DIR=`dirname "${0}"`
"${SCRIPT_DIR}/_server-script.sh" "${@}"
diff --git a/opendj-sdk/opends/resource/bin/verify-index.bat b/opendj-sdk/opends/resource/bin/verify-index.bat
index 6d2eeaa..35ef2e2 100644
--- a/opendj-sdk/opends/resource/bin/verify-index.bat
+++ b/opendj-sdk/opends/resource/bin/verify-index.bat
@@ -28,5 +28,6 @@
setlocal
set OPENDS_INVOKE_CLASS="org.opends.server.tools.VerifyIndex"
+set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=verify-index"
call "%~dP0\_server-script.bat" %*
diff --git a/opendj-sdk/opends/resource/setup.bat b/opendj-sdk/opends/resource/setup.bat
index 59bd8a0..ef636b8 100644
--- a/opendj-sdk/opends/resource/setup.bat
+++ b/opendj-sdk/opends/resource/setup.bat
@@ -49,7 +49,7 @@
set PATH=%SystemRoot%
-%JAVA_BIN% %JAVA_ARGS% org.opends.server.tools.InstallDS --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" -P setup.bat %*
+%JAVA_BIN% %JAVA_ARGS% -Dorg.opends.server.scriptName=setup org.opends.server.tools.InstallDS --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%DIR_HOME%\config\config.ldif" -P setup.bat %*
:end
diff --git a/opendj-sdk/opends/resource/setup.sh b/opendj-sdk/opends/resource/setup.sh
index d2b8313..e3195a6 100755
--- a/opendj-sdk/opends/resource/setup.sh
+++ b/opendj-sdk/opends/resource/setup.sh
@@ -111,7 +111,8 @@
# Launch the setup process.
-"${JAVA_BIN}" ${JAVA_ARGS} org.opends.server.tools.InstallDS \
+"${JAVA_BIN}" ${JAVA_ARGS} -Dorg.opends.server.scriptName=setup \
+ org.opends.server.tools.InstallDS \
--configClass org.opends.server.extensions.ConfigFileHandler \
--configFile "${INSTANCE_ROOT}/config/config.ldif" -P "${0}" "${@}"
diff --git a/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java b/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
index 9ea387d..3353c09 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -7466,8 +7466,10 @@
// Create the command-line argument parser for use with this program.
+ String toolDescription = getMessage(MSGID_DSCORE_TOOL_DESCRIPTION);
ArgumentParser argParser =
- new ArgumentParser("org.opends.server.core.DirectoryServer", false);
+ new ArgumentParser("org.opends.server.core.DirectoryServer",
+ toolDescription, false);
// Initialize all the command-line argument types and register them with the
@@ -7503,7 +7505,6 @@
systemInfo = new BooleanArgument("systeminfo", 's', "systemInfo",
MSGID_DSCORE_DESCRIPTION_SYSINFO);
- systemInfo.setHidden(true);
argParser.addArgument(systemInfo);
diff --git a/opendj-sdk/opends/src/server/org/opends/server/messages/CoreMessages.java b/opendj-sdk/opends/src/server/org/opends/server/messages/CoreMessages.java
index 98e59fe..abc7cd0 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/messages/CoreMessages.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/messages/CoreMessages.java
@@ -5947,6 +5947,15 @@
/**
+ * The message ID for the message that will be used as the description for the
+ * start-ds tool. This does not take any arguments.
+ */
+ public static final int MSGID_DSCORE_TOOL_DESCRIPTION =
+ CATEGORY_MASK_CORE | SEVERITY_MASK_INFORMATIONAL | 569;
+
+
+
+ /**
* Associates a set of generic messages with the message IDs defined
* in this class.
*/
@@ -7201,6 +7210,10 @@
"has been removed from the server.");
+ registerMessage(MSGID_DSCORE_TOOL_DESCRIPTION,
+ "This utility may be used to start the Directory Server, " +
+ "as well as to obtain the server version and other forms " +
+ "of general server information.");
registerMessage(MSGID_DSCORE_DESCRIPTION_CONFIG_CLASS,
"Specifies the fully-qualified name of the Java class " +
"to use as the Directory Server configuration handler.");
@@ -7209,20 +7222,18 @@
"information needed by the configuration handler to " +
"obtain the Directory Server configuration.");
registerMessage(MSGID_DSCORE_DESCRIPTION_VERSION,
- "Displays the Directory Server version information.");
+ "Display Directory Server version information");
registerMessage(MSGID_DSCORE_DESCRIPTION_FULLVERSION,
- "Displays extended Directory Server version information.");
+ "Display extended Directory Server version information");
registerMessage(MSGID_DSCORE_DESCRIPTION_SYSINFO,
- "Displays a basic set of information about the system " +
- "on which the Directory Server is installed.");
+ "Display general system information");
registerMessage(MSGID_DSCORE_DESCRIPTION_DUMPMESSAGES,
- "Dumps a list of all messages that have been defined " +
- "for use in the Directory Server.");
+ "Dump a list of all defined messages");
registerMessage(MSGID_DSCORE_DESCRIPTION_NODETACH,
- "Indicates that the Directory Server has not detached " +
- "from the terminal used to start it.");
+ "Do not detach from the terminal and continue running in " +
+ "the foreground");
registerMessage(MSGID_DSCORE_DESCRIPTION_USAGE,
- "Displays usage information for the Directory Server.");
+ "Display this usage information");
registerMessage(MSGID_DSCORE_CANNOT_INITIALIZE_ARGS,
"An error occurred while attempting to initialize the " +
"command-line arguments: %s.");
diff --git a/opendj-sdk/opends/src/server/org/opends/server/messages/PluginMessages.java b/opendj-sdk/opends/src/server/org/opends/server/messages/PluginMessages.java
index b043752..5b5ce6a 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/messages/PluginMessages.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/messages/PluginMessages.java
@@ -780,6 +780,15 @@
/**
+ * The message ID for the message that will be used for the description of the
+ * profile viewer tool. It does not take any arguments.
+ */
+ public static final int MSGID_PROFILEVIEWER_TOOL_DESCRIPTION =
+ CATEGORY_MASK_PLUGIN | SEVERITY_MASK_INFORMATIONAL | 68;
+
+
+
+ /**
* Associates a set of generic messages with the message IDs defined in this
* class.
*/
@@ -1096,6 +1105,9 @@
"allowed for this plugin.");
+ registerMessage(MSGID_PROFILEVIEWER_TOOL_DESCRIPTION,
+ "This utility may be used to view information in data " +
+ "files captured by the Directory Server profiler.");
registerMessage(MSGID_PROFILEVIEWER_DESCRIPTION_FILENAMES,
"Specifies the path to a profile data file. This " +
"argument may be provided more than once to analyze data " +
diff --git a/opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java b/opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java
index 50d7990..849fbe3 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/messages/ToolMessages.java
@@ -3424,26 +3424,6 @@
/**
* The message ID for the message that will be used as the description of the
- * assertionFilter option for the ldapsearch tool. It does not take any
- * arguments.
- */
- public static final int MSGID_DESCRIPTION_SEARCH_ASSERTION_FILTER =
- CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 344;
-
-
-
- /**
- * The message ID for the message that will be used as the description of the
- * assertionFilter option for the ldapcompare tool. It does not take any
- * arguments.
- */
- public static final int MSGID_DESCRIPTION_COMPARE_ASSERTION_FILTER =
- CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 345;
-
-
-
- /**
- * The message ID for the message that will be used as the description of the
* preReadAttributes option. It does not take any arguments.
*/
public static final int MSGID_DESCRIPTION_PREREAD_ATTRS =
@@ -6708,6 +6688,378 @@
/**
+ * The message ID for the message that will be used as the description for the
+ * backup tool. This does not take any arguments.
+ */
+ public static final int MSGID_BACKUPDB_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 683;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * configure-ds tool. This does not take any arguments.
+ */
+ public static final int MSGID_CONFIGDS_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 684;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * encode-password tool. This does not take any arguments.
+ */
+ public static final int MSGID_ENCPW_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 685;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * export-ldif tool. This does not take any arguments.
+ */
+ public static final int MSGID_LDIFEXPORT_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 686;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * import-ldif tool. This does not take any arguments.
+ */
+ public static final int MSGID_LDIFIMPORT_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 687;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * setup tool. This does not take any arguments.
+ */
+ public static final int MSGID_INSTALLDS_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 688;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * ldapcompare tool. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPCOMPARE_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 689;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * ldapdelete tool. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPDELETE_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 690;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * ldapmodify tool. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPMODIFY_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 691;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * ldappasswordmodify tool. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPPWMOD_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 692;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * ldapsearch tool. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPSEARCH_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 693;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * ldif-diff tool. This does not take any arguments.
+ */
+ public static final int MSGID_LDIFDIFF_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 694;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * ldifmodify tool. This does not take any arguments.
+ */
+ public static final int MSGID_LDIFMODIFY_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 695;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * ldifsearch tool. This does not take any arguments.
+ */
+ public static final int MSGID_LDIFSEARCH_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 696;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * makeldif tool. This does not take any arguments.
+ */
+ public static final int MSGID_MAKELDIF_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 697;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * restore tool. This does not take any arguments.
+ */
+ public static final int MSGID_RESTOREDB_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 698;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * stop-ds tool. This does not take any arguments.
+ */
+ public static final int MSGID_STOPDS_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 699;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * verify-index tool. This does not take any arguments.
+ */
+ public static final int MSGID_VERIFYINDEX_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 700;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description for the
+ * wait-for-delete tool. This does not take any arguments.
+ */
+ public static final int MSGID_WAIT4DEL_TOOL_DESCRIPTION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 701;
+
+
+
+ /**
+ * The message ID for the message that will be used if two conflicting
+ * command-line arguments were provided. This takes two arguments, which are
+ * the long names for the conflicting arguments.
+ */
+ public static final int MSGID_TOOL_CONFLICTING_ARGS =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_SEVERE_ERROR | 702;
+
+
+
+ /**
+ * The message ID for the message that will be used if no compare attribute
+ * was provided. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPCOMPARE_NO_ATTR =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_SEVERE_ERROR | 703;
+
+
+
+ /**
+ * The message ID for the message that will be used if the attribute string
+ * had an invalid format. This takes a single argument, which is the invalid
+ * attribute string.
+ */
+ public static final int MSGID_LDAPCOMPARE_INVALID_ATTR_STRING =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_SEVERE_ERROR | 704;
+
+
+
+ /**
+ * The message ID for the message that will be used if the control string
+ * had an invalid format. This takes a single argument, which is the invalid
+ * control string.
+ */
+ public static final int MSGID_TOOL_INVALID_CONTROL_STRING =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_SEVERE_ERROR | 705;
+
+
+
+ /**
+ * The message ID for the message that will be used if the user requested SASL
+ * EXTERNAL authentication but is not using SSL or StartTLS. This does not
+ * take any arguments.
+ */
+ public static final int MSGID_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_SEVERE_ERROR | 706;
+
+
+
+ /**
+ * The message ID for the message that will be used if the user requested SASL
+ * EXTERNAL authentication but did not specify a keystore path. This does not
+ * take any arguments.
+ */
+ public static final int MSGID_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_SEVERE_ERROR | 707;
+
+
+
+ /**
+ * The message ID for the message that will be used to provide the persistent
+ * search change type. This takes a single argument, which is the change type
+ * string.
+ */
+ public static final int MSGID_LDAPSEARCH_PSEARCH_CHANGE_TYPE =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 708;
+
+
+
+ /**
+ * The message ID for the message that will be used to provide the persistent
+ * previous entry DN. This takes a single argument, which is the previous DN
+ * string.
+ */
+ public static final int MSGID_LDAPSEARCH_PSEARCH_PREVIOUS_DN =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 709;
+
+
+
+ /**
+ * The message ID for the message that will be used to provide the header for
+ * the account usability control output. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPSEARCH_ACCTUSABLE_HEADER =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 710;
+
+
+
+ /**
+ * The message ID for the message that will be used to indicate that an
+ * account is usable. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPSEARCH_ACCTUSABLE_IS_USABLE =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 711;
+
+
+
+ /**
+ * The message ID for the message that will be used to indicate the length of
+ * time before the password expires. This takes a single argument, which is a
+ * human-readable string representation of the remaining time.
+ */
+ public static final int MSGID_LDAPSEARCH_ACCTUSABLE_TIME_UNTIL_EXPIRATION =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 712;
+
+
+
+ /**
+ * The message ID for the message that will be used to indicate that the
+ * account is not usable. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPSEARCH_ACCTUSABLE_NOT_USABLE =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 713;
+
+
+
+ /**
+ * The message ID for the message that will be used to indicate that the
+ * account has been deactivated. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPSEARCH_ACCTUSABLE_ACCT_INACTIVE =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 714;
+
+
+
+ /**
+ * The message ID for the message that will be used to indicate that the
+ * user's password has been reset and must be changed before anything else can
+ * be done. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPSEARCH_ACCTUSABLE_PW_RESET =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 715;
+
+
+
+ /**
+ * The message ID for the message that will be used to indicate that the
+ * user's password has expired. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPSEARCH_ACCTUSABLE_PW_EXPIRED =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 716;
+
+
+
+ /**
+ * The message ID for the message that will be used to provide the number of
+ * grace logins remaining for the user. This takes a single argument, which
+ * is the number of remaining grace logins.
+ */
+ public static final int MSGID_LDAPSEARCH_ACCTUSABLE_REMAINING_GRACE =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 717;
+
+
+
+ /**
+ * The message ID for the message that will be used to indicate that the
+ * account has been locked. This does not take any arguments.
+ */
+ public static final int MSGID_LDAPSEARCH_ACCTUSABLE_LOCKED =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 718;
+
+
+
+ /**
+ * The message ID for the message that will be used to provide the length of
+ * time until the account is automatically unlocked. This takes a single
+ * argument, which is a human-readable string representation of the time
+ * remaining.
+ */
+ public static final int MSGID_LDAPSEARCH_ACCTUSABLE_TIME_UNTIL_UNLOCK =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 719;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description of the
+ * keystorePasswordFile argument. This does not take any arguments.
+ */
+ public static final int MSGID_DESCRIPTION_KEYSTOREPASSWORD_FILE =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 720;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description of the
+ * truststorePassword argument. This does not take any arguments.
+ */
+ public static final int MSGID_DESCRIPTION_TRUSTSTOREPASSWORD =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 721;
+
+
+
+ /**
+ * The message ID for the message that will be used as the description of the
+ * truststorePasswordFile argument. This does not take any arguments.
+ */
+ public static final int MSGID_DESCRIPTION_TRUSTSTOREPASSWORD_FILE =
+ CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 722;
+
+
+
+ /**
* Associates a set of generic messages with the message IDs defined in this
* class.
*/
@@ -6731,22 +7083,17 @@
registerMessage(MSGID_ENCPW_DESCRIPTION_LISTSCHEMES,
- "Lists the available password storage schemes configured " +
- "in the Directory Server.");
+ "List available password storage schemes");
registerMessage(MSGID_ENCPW_DESCRIPTION_CLEAR_PW,
- "Specifies the clear-text password to be encoded and/or " +
- "compared against an encoded password.");
+ "Clear-text password to encode or to compare against an " +
+ "encoded password");
registerMessage(MSGID_ENCPW_DESCRIPTION_CLEAR_PW_FILE,
- "Specifies the path to a file containing the clear-text " +
- "password to be encoded and/or compared against an " +
- "encoded password.");
+ "Clear-text password file");
registerMessage(MSGID_ENCPW_DESCRIPTION_ENCODED_PW,
- "Specifies the encoded password to be compared against " +
- "the provided clear-text password.");
+ "Encoded password to compare against the clear-text " +
+ "password");
registerMessage(MSGID_ENCPW_DESCRIPTION_ENCODED_PW_FILE,
- "Specifies the path to a file containing the encoded " +
- "password to be compared against the provided clear-text " +
- "password.");
+ "Encoded password file");
registerMessage(MSGID_ENCPW_DESCRIPTION_CONFIG_CLASS,
"Specifies the fully-qualified name of the Java class " +
"that serves as the configuration handler for the " +
@@ -6755,13 +7102,10 @@
"Specifies the path to the Directory Server " +
"configuration file.");
registerMessage(MSGID_ENCPW_DESCRIPTION_SCHEME,
- "Specifies the name of the password storage scheme that " +
- "should be used to encode the provided clear-text " +
- "password.");
+ "Scheme to use for the encoded password");
registerMessage(MSGID_ENCPW_DESCRIPTION_AUTHPW,
- "Indicates that the authentication password syntax " +
- "should be used to encode the password, rather than the " +
- "default user password syntax.");
+ "Use the authentication password syntax rather than the " +
+ "user password syntax");
registerMessage(MSGID_ENCPW_DESCRIPTION_USAGE,
"Displays this usage information.");
registerMessage(MSGID_ENCPW_CANNOT_INITIALIZE_ARGS,
@@ -6826,61 +7170,34 @@
"Specifies the path to the Directory Server " +
"configuration file.");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_LDIF_FILE,
- "Specifies the path to the file to which the LDIF data " +
- "should be written.");
+ "Path to the LDIF file to be written");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_APPEND_TO_LDIF,
- "Indicates that the export process should append to an " +
- "existing LDIF file rather than overwrite it.");
+ "Append an existing LDIF file rather than overwriting it");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_BACKEND_ID,
- "Specifies the backend ID for the backend from which the " +
- "data should be exported.");
+ "Backend ID for the backend to export");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_INCLUDE_BRANCH,
- "Specifies the base DN of a branch that should be " +
- "included in the LDIF export. This argument may be " +
- "provided more than once to specify multiple include " +
- "branches.");
+ "Base DN of a branch to include in the LDIF export");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_EXCLUDE_BRANCH,
- "Specifies the base DN of a branch that should be " +
- "excluded from the LDIF export. This argument may be " +
- "provided more than once to specify multiple exclude " +
- "branches.");
+ "Base DN of a branch to exclude from the LDIF export");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_INCLUDE_ATTRIBUTE,
- "Specifies an attribute that should be included in the " +
- "LDIF export. This argument may be provided more than " +
- "once to specify multiple include attributes. If this " +
- "is used, then only the listed include attributes will " +
- "be included in the LDIF export.");
+ "Attribute to include in the LDIF export");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_EXCLUDE_ATTRIBUTE,
- "Specifies an attribute that should be excluded from the " +
- "LDIF export. This argument may be provided more than " +
- "once to specify multiple exclude attributes.");
+ "Attribute to exclude from the LDIF export");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_INCLUDE_FILTER,
- "Specifies a search filter that may be used to control " +
- "which entries are included in the export. Only entries " +
- "matching the specified filter will be included. This " +
- "argument may be provided more than once to specify " +
- "multiple include filters.");
+ "Filter to identify entries to include in the LDIF export");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_EXCLUDE_FILTER,
- "Specifies a search filter that may be used to control " +
- "which entries are excluded from the export. Any entry " +
- "matching the specified filter will be excluded. This " +
- "argument may be provided more than once to specify " +
- "multiple exclude filters.");
+ "Filter to identify entries to exclude from the LDIF " +
+ "export");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_WRAP_COLUMN,
- "Specifies the column at which long lines should be " +
- "wrapped. A value of zero indicates that long lines " +
- "should not be wrapped.");
+ "Column at which to wrap long lines (0 for no wrapping)");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_COMPRESS_LDIF,
- "Indicates that the LDIF data should be compressed as it " +
- "is exported.");
+ "Compress the LDIF data as it is exported");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_ENCRYPT_LDIF,
- "Indicates that the LDIF data should be encrypted as it " +
- "is exported.");
+ "Encrypt the LDIF data as it is exported");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_SIGN_HASH,
- "Indicates that a signed hash of the export data " +
- "should be appended to the LDIF file.");
+ "Generate a signed hash of the export data");
registerMessage(MSGID_LDIFEXPORT_DESCRIPTION_USAGE,
- "Displays this usage information.");
+ "Display this usage information");
registerMessage(MSGID_LDIFEXPORT_CANNOT_INITIALIZE_ARGS,
"An unexpected error occurred while attempting to " +
"initialize the command-line arguments: %s.");
@@ -6987,81 +7304,47 @@
"Specifies the path to the Directory Server " +
"configuration file.");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_LDIF_FILE,
- "Specifies the path to the file containing the LDIF data " +
- "to import. This argument may be provided more than " +
- "once to import from multiple LDIF files (the files " +
- "will be processed in the order they are provided in " +
- "the arguments).");
+ "Path to the LDIF file to be imported");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_TEMPLATE_FILE,
- "Specifies the path to the MakeLDIF template file " +
- "defining the data to be generated for the import. This " +
- "may not be used in conjunction with the --ldifFile " +
- "option.");
+ "Path to a MakeLDIF template to use to generate the " +
+ "import data");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_APPEND,
- "Indicates that the import process should append to the " +
- "existing database rather than overwriting it.");
+ "Append to an existing database rather than overwriting " +
+ "it");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_REPLACE_EXISTING,
- "Indicates whether an existing entry should be replaced " +
- "when appending to an existing database.");
+ "Replace existing entries when appending to the database");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_BACKEND_ID,
- "Specifies the backend ID for the backend into which the " +
- "data should be imported.");
+ "Backend ID for the backend to import");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_INCLUDE_BRANCH,
- "Specifies the base DN of a branch that should be " +
- "included in the LDIF import. This argument may be " +
- "provided more than once to specify multiple include " +
- "branches.");
+ "Base DN of a branch to include in the LDIF import");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_EXCLUDE_BRANCH,
- "Specifies the base DN of a branch that should be " +
- "excluded from the LDIF import. This argument may be " +
- "provided more than once to specify multiple exclude " +
- "branches.");
+ "Base DN of a branch to exclude from the LDIF import");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_INCLUDE_ATTRIBUTE,
- "Specifies an attribute that should be included in the " +
- "LDIF import. This argument may be provided more than " +
- "once to specify multiple include attributes. If this " +
- "is used, then only the listed include attributes will " +
- "be included in the LDIF import.");
+ "Attribute to include in the LDIF import");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_EXCLUDE_ATTRIBUTE,
- "Specifies an attribute that should be excluded from the " +
- "LDIF import. This argument may be provided more than " +
- "once to specify multiple exclude attributes.");
+ "Attribute to exclude from the LDIF import");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_INCLUDE_FILTER,
- "Specifies a search filter that may be used to control " +
- "which entries are included in the import. Only entries " +
- "matching the specified filter will be included. This " +
- "argument may be provided more than once to specify " +
- "multiple include filters.");
+ "Filter to identify entries to include in the LDIF import");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_EXCLUDE_FILTER,
- "Specifies a search filter that may be used to control " +
- "which entries are excluded from the import. Any entry " +
- "matching the specified filter will be excluded. This " +
- "argument may be provided more than once to specify " +
- "multiple exclude filters.");
+ "Filter to identify entries to exclude from the LDIF " +
+ "import");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_REJECT_FILE,
- "Specifies the path to a file into which rejected " +
- "entries may be written if they are not accepted during " +
- "the import process.");
+ "Write rejected entries to the specified file");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_OVERWRITE_REJECTS,
- "Indicates that the import should overwrite an existing " +
- "reject file rather than appending to it.");
+ "Overwrite an existing rejects file rather than " +
+ "appending to it");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_RANDOM_SEED,
- "Specifies the seed to use for the random number " +
- "generator. This is only applicable when generating " +
- "entries from a template.");
+ "Seed for the MakeLDIF random number generator");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_SKIP_SCHEMA_VALIDATION,
- "Indicates whether to skip schema validation during the " +
- "import.");
+ "Skip schema validation during the LDIF import");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_IS_COMPRESSED,
- "Indicates whether the LDIF file containing the data to " +
- "import is compressed.");
+ "LDIF file is compressed");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_IS_ENCRYPTED,
- "Indicates whether the LDIF file containing the data to " +
- "import is encrypted.");
+ "LDIF file is encrypted");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_QUIET,
- "Use quiet mode (no output).");
+ "Use quiet mode (no output)");
registerMessage(MSGID_LDIFIMPORT_DESCRIPTION_USAGE,
- "Displays this usage information.");
+ "Display this usage information.");
registerMessage(MSGID_LDIFIMPORT_CANNOT_INITIALIZE_ARGS,
"An unexpected error occurred while attempting to " +
"initialize the command-line arguments: %s.");
@@ -7188,25 +7471,22 @@
registerMessage(MSGID_SEARCH_OPERATION_INVALID_PROTOCOL,
"Invalid operation type returned in search result %s.");
registerMessage(MSGID_DESCRIPTION_TRUSTALL,
- "Blindly trust the server SSL certificate.");
+ "Trust all server SSL certificates");
registerMessage(MSGID_DESCRIPTION_BINDDN,
- "Bind DN.");
+ "Bind DN");
registerMessage(MSGID_DESCRIPTION_BINDPASSWORD,
- "Bind password (used for simple authentication).");
+ "Bind password");
registerMessage(MSGID_DESCRIPTION_BINDPASSWORDFILE,
- "Read bind passwd (for simple authentication) from file");
+ "Bind password file");
registerMessage(MSGID_DESCRIPTION_PROXY_AUTHZID,
- "Specifies that the proxied authorization control should " +
- "be used with the given authorization ID.");
+ "Use the proxied authorization control with the given " +
+ "authorization ID");
registerMessage(MSGID_DESCRIPTION_PSEARCH_INFO,
- "Use the persistent search control to be notified of " +
- "changes to data matching the search criteria.");
+ "Use the persistent search control");
registerMessage(MSGID_DESCRIPTION_REPORT_AUTHZID,
- "Use the authorization identity control to request that " +
- "the server provide the authorization ID in the bind " +
- "response.");
+ "Use the authorization identity control");
registerMessage(MSGID_DESCRIPTION_USE_PWP_CONTROL,
- "Use the password policy control in the bind request.");
+ "Use the password policy request control");
registerMessage(MSGID_BIND_AUTHZID_RETURNED,
"# Bound with authorization ID %s.");
registerMessage(MSGID_BIND_PASSWORD_EXPIRED,
@@ -7221,73 +7501,58 @@
registerMessage(MSGID_BIND_GRACE_LOGINS_REMAINING,
"# You have %d grace logins remaining.");
registerMessage(MSGID_DESCRIPTION_VERBOSE,
- "Run in verbose mode.");
+ "Use verbose mode");
registerMessage(MSGID_DESCRIPTION_KEYSTOREPATH,
- "Path to key database to use for SSL client " +
- "authentication.");
+ "Certificate keystore path");
registerMessage(MSGID_DESCRIPTION_TRUSTSTOREPATH,
- "Path to the SSL certificate database.");
+ "Certificate trust store path");
registerMessage(MSGID_DESCRIPTION_KEYSTOREPASSWORD,
- "SSL key password.");
+ "Certificate keystore PIN");
+ registerMessage(MSGID_DESCRIPTION_KEYSTOREPASSWORD_FILE,
+ "Certificate keystore PIN file");
+ registerMessage(MSGID_DESCRIPTION_TRUSTSTOREPASSWORD,
+ "Certificate trust store PIN");
+ registerMessage(MSGID_DESCRIPTION_TRUSTSTOREPASSWORD_FILE,
+ "Certificate trust store PIN file");
registerMessage(MSGID_DESCRIPTION_HOST,
- "LDAP server name or IP address (default: localhost).");
+ "Directory server hostname or IP address");
registerMessage(MSGID_DESCRIPTION_PORT,
- "LDAP server TCP port number(default: 389).");
+ "Directory server port number");
registerMessage(MSGID_DESCRIPTION_VERSION,
- "LDAP version number(default: 3).");
+ "LDAP protocol version number");
registerMessage(MSGID_DESCRIPTION_SHOWUSAGE,
- "Display usage information.");
+ "Display this usage information");
registerMessage(MSGID_DESCRIPTION_CONTROLS,
- "The OID, criticality and value of the control to apply.");
+ "Use a request control with the provided information");
registerMessage(MSGID_DESCRIPTION_CONTINUE_ON_ERROR,
- "Continue processing even if there are errors.");
+ "Continue processing even if there are errors");
registerMessage(MSGID_DESCRIPTION_USE_SSL,
- "Make an SSL connection to the server.");
+ "Use SSL for secure communication with the server");
registerMessage(MSGID_DESCRIPTION_START_TLS,
- "Use a TLS connection to the server.");
+ "Use StartTLS to secure communication with the server");
registerMessage(MSGID_DESCRIPTION_USE_SASL_EXTERNAL,
- "Use the SASL EXTERNAL authentication mechanism.");
+ "Use the SASL EXTERNAL authentication mechanism");
registerMessage(MSGID_DESCRIPTION_ENCODING,
- "Character set for command line input " +
- "(default taken from locale)");
+ "Use the specified character set for command-line input");
registerMessage(MSGID_DELETE_DESCRIPTION_FILENAME,
- "The name of the file that contains a list of the DNs of " +
- "the entries to delete.");
+ "File containing the DNs of the entries to delete");
registerMessage(MSGID_SEARCH_DESCRIPTION_FILENAME,
- "The name of the file that contains a list of filter " +
- "strings.");
+ "File containing a list of search filter strings");
registerMessage(MSGID_COMPARE_DESCRIPTION_FILENAME,
- "The name of the file that contains a list of the DNs of " +
- "the entries to compare.");
+ "File containing the DNs of the entries to compare");
registerMessage(MSGID_DELETE_DESCRIPTION_DELETE_SUBTREE,
- "Delete the specified entry and all entries below it.");
+ "Delete the specified entry and all entries below it");
registerMessage(MSGID_MODIFY_DESCRIPTION_DEFAULT_ADD,
- "Add entries as the default action.");
+ "Treat records with no changetype as add operations");
registerMessage(MSGID_DESCRIPTION_ASSERTION_FILTER,
- "Use the LDAP assertion control so that the operation is " +
- "only processed if the target entry matches the provided " +
- "assertion filter.");
+ "Use the LDAP assertion control with the provided filter");
registerMessage(MSGID_DESCRIPTION_PREREAD_ATTRS,
- "Use the LDAP ReadEntry pre-read control to retrieve " +
- "a copy of the entry immediately before a delete, " +
- "modify, or modify DN operation.");
+ "Use the LDAP ReadEntry pre-read control");
registerMessage(MSGID_DESCRIPTION_POSTREAD_ATTRS,
- "Use the LDAP ReadEntry post-read control to retrieve " +
- "a copy of the entry immediately after an add, modify, " +
- "or modify DN operation.");
- registerMessage(MSGID_DESCRIPTION_SEARCH_ASSERTION_FILTER,
- "Use the LDAP assertion control so that the search is " +
- "only processed if the base entry matches the provided " +
- "assertion filter.");
+ "Use the LDAP ReadEntry post-read control");
registerMessage(MSGID_DESCRIPTION_MATCHED_VALUES_FILTER,
- "Use the matched values control to only return " +
- "attribute values matching the specified filter. " +
- "This option may be provided multiple times to specify " +
- "multiple filters.");
- registerMessage(MSGID_DESCRIPTION_COMPARE_ASSERTION_FILTER,
- "Use the LDAP assertion control so that the compare is " +
- "only processed if the target entry matches the provided " +
- "assertion filter.");
+ "Use the LDAP matched values control with the provided " +
+ "filter");
registerMessage(MSGID_COMPARE_CANNOT_BASE64_DECODE_ASSERTION_VALUE,
"The assertion value was indicated to be base64-encoded, " +
"but an error occurred while trying to decode the value.");
@@ -7295,19 +7560,17 @@
"Unable to read the assertion value from the specified " +
"file: %s.");
registerMessage(MSGID_SEARCH_DESCRIPTION_BASEDN,
- "The base DN for the search.");
+ "Search base DN");
registerMessage(MSGID_SEARCH_DESCRIPTION_SIZE_LIMIT,
- "The size limit (in entries) for search " +
- "(default is no limit)");
+ "Maximum number of entries to return from the search");
registerMessage(MSGID_SEARCH_DESCRIPTION_TIME_LIMIT,
- "The time limit (in seconds) for search " +
- "(default is no limit)");
+ "Maximum length of time in seconds to allow for the " +
+ "search");
registerMessage(MSGID_SEARCH_DESCRIPTION_SEARCH_SCOPE,
- "The scope for the search which is one of " +
- "base, one, sub, or subordinate. (default is sub)");
+ "Search scope ('base', 'one', 'sub', or 'subordinate')");
registerMessage(MSGID_SEARCH_DESCRIPTION_DEREFERENCE_POLICY,
- "Alias dereferencing policy. The value is one of never, " +
- "always, search, or find (default is never).");
+ "Alias dereference policy ('never', 'always', 'search', " +
+ "or 'find')");
registerMessage(MSGID_LDAPAUTH_CANNOT_SEND_SIMPLE_BIND,
@@ -7464,9 +7727,9 @@
registerMessage(MSGID_LDAPAUTH_PROPERTY_DESCRIPTION_AUTHZID,
"Specifies the authorization ID to use for the bind.");
registerMessage(MSGID_DESCRIPTION_SASL_PROPERTIES,
- "Specifies the SASL properties to use for the bind.");
+ "SASL bind options");
registerMessage(MSGID_DESCRIPTION_DONT_WRAP,
- "Indicates that long lines should not be wrapped.");
+ "Do not wrap long lines");
registerMessage(MSGID_LDAPAUTH_PROPERTY_DESCRIPTION_KDC,
"Specifies the KDC to use for the Kerberos " +
"authentication.");
@@ -7695,42 +7958,28 @@
"Specifies the path to the Directory Server " +
"configuration file.");
registerMessage(MSGID_BACKUPDB_DESCRIPTION_BACKEND_ID,
- "Specifies the backend ID for the backend that should " +
- "be archived. Multiple backends may be archived by " +
- "providing this argument multiple times.");
+ "Backend ID for the backend to archive");
registerMessage(MSGID_BACKUPDB_DESCRIPTION_BACKUP_ALL,
- "Indicates that all backends defined in the server " +
- "should be backed up.");
+ "Back up all backends in the server");
registerMessage(MSGID_BACKUPDB_DESCRIPTION_BACKUP_ID,
- "Specifies the backup ID that will be used to identify " +
- "the backup that is created.");
+ "Use the provided identifier for the backup");
registerMessage(MSGID_BACKUPDB_DESCRIPTION_BACKUP_DIR,
- "Specifies the path to the directory in which the " +
- "backup file(s) should be placed.");
+ "Path to the target directory for the backup file(s)");
registerMessage(MSGID_BACKUPDB_DESCRIPTION_INCREMENTAL,
- "Indicates whether to generate an incremental backup " +
- "or a full backup.");
+ "Perform an incremental backup rather than a full backup");
registerMessage(MSGID_BACKUPDB_DESCRIPTION_INCREMENTAL_BASE_ID,
- "Specifies the backup ID of the backup against which an " +
- "incremental backup should be taken. If none is " +
- "provided, then the backend will automatically choose an " +
- "appropriate backup on which to base the incremental " +
- "backup.");
+ "Backup ID of the source archive for an incremental " +
+ "backup");
registerMessage(MSGID_BACKUPDB_DESCRIPTION_COMPRESS,
- "Indicates whether the backup file(s) should be " +
- "compressed.");
+ "Compress the backup contents");
registerMessage(MSGID_BACKUPDB_DESCRIPTION_ENCRYPT,
- "Indicates whether the backup file(s) should be " +
- "encrypted.");
+ "Encrypt the backup contents");
registerMessage(MSGID_BACKUPDB_DESCRIPTION_HASH,
- "Indicates whether to generate a hash of the backup " +
- "file(s) so that their integrity can be verified on " +
- "restore.");
+ "Generate a hash of the backup contents");
registerMessage(MSGID_BACKUPDB_DESCRIPTION_SIGN_HASH,
- "Indicates whether the hash of the archive file(s) " +
- "should be digitally signed to provide tamper detection.");
+ "Sign the hash of the backup contents");
registerMessage(MSGID_BACKUPDB_DESCRIPTION_USAGE,
- "Displays this usage information.");
+ "Display this usage information");
registerMessage(MSGID_BACKUPDB_CANNOT_INITIALIZE_ARGS,
"An unexpected error occurred while attempting to " +
"initialize the command-line arguments: %s.");
@@ -7851,25 +8100,17 @@
"Specifies the path to the Directory Server " +
"configuration file.");
registerMessage(MSGID_RESTOREDB_DESCRIPTION_BACKEND_ID,
- "Specifies the backend ID for the backend that should " +
- "be restored.");
+ "Backend ID for the backend to restore");
registerMessage(MSGID_RESTOREDB_DESCRIPTION_BACKUP_ID,
- "Specifies the backup ID that will be used to identify " +
- "which backup should be restored. If this is not " +
- "provided, then the latest backup in the directory will " +
- "be restored.");
+ "Backup ID of the backup to restore");
registerMessage(MSGID_RESTOREDB_DESCRIPTION_BACKUP_DIR,
- "Specifies the path to the directory in which the " +
- "backup file(s) are located.");
+ "Path to the directory containing the backup file(s)");
registerMessage(MSGID_RESTOREDB_DESCRIPTION_LIST_BACKUPS,
- "Indicates that this utility should display a list of " +
- "the available backups and exit.");
+ "List available backups in the backup directory");
registerMessage(MSGID_RESTOREDB_DESCRIPTION_VERIFY_ONLY,
- "Indicates that the contents of the specified backup " +
- "should be verified to the best of the backend's ability " +
- "but should not be restored.");
+ "Verify the contents of the backup but do not restore it");
registerMessage(MSGID_RESTOREDB_DESCRIPTION_USAGE,
- "Displays this usage information.");
+ "Display this usage information");
registerMessage(MSGID_RESTOREDB_CANNOT_INITIALIZE_ARGS,
"An unexpected error occurred while attempting to " +
"initialize the command-line arguments: %s.");
@@ -7966,11 +8207,9 @@
"Cannot determine the backend ID for the backend defined " +
"in configuration entry %s: %s.");
registerMessage(MSGID_DESCRIPTION_NOOP,
- "No-op mode used to show what the tool would do with the " +
- "given input but not perform any operations.");
+ "Show what would be done but do not perform any operation");
registerMessage(MSGID_DESCRIPTION_TYPES_ONLY,
- "Specify that the search retrieve only attribute names, " +
- "not the attribute values.");
+ "Only retrieve attribute names but not their values");
registerMessage(MSGID_LDIF_FILE_CANNOT_OPEN_FOR_READ,
"An error occurred while attempting to open the " +
"LDIF file %s for reading: %s.");
@@ -7982,57 +8221,46 @@
registerMessage(MSGID_STOPDS_DESCRIPTION_HOST,
- "The address of the Directory Server to shut down.");
+ "Directory server hostname or IP address");
registerMessage(MSGID_STOPDS_DESCRIPTION_PORT,
- "The port of the Directory Server to shut down.");
+ "Directory server port number");
registerMessage(MSGID_STOPDS_DESCRIPTION_USESSL,
- "Use SSL to communicate with the Directory Server.");
+ "Use SSL for secure communication with the server");
registerMessage(MSGID_STOPDS_DESCRIPTION_USESTARTTLS,
- "Use StartTLS to communicate with the Directory Server.");
+ "Use StartTLS for secure communication with the server");
registerMessage(MSGID_STOPDS_DESCRIPTION_BINDDN,
- "The DN to use when performing a simple bind to the " +
- "Directory Server.");
+ "Bind DN");
registerMessage(MSGID_STOPDS_DESCRIPTION_BINDPW,
- "The password to use to bind to the Directory Server.");
+ "Bind password");
registerMessage(MSGID_STOPDS_DESCRIPTION_BINDPWFILE,
- "The path to a file containing the password to use to " +
- "bind to the Directory Server.");
+ "Bind password file");
registerMessage(MSGID_STOPDS_DESCRIPTION_SASLOPTIONS,
- "A SASL option to use for authentication in the form " +
- "name=value. At least one SASL option must be given " +
- "with a name of mech to specify which SASL mechanism to " +
- "use. Multiple SASL options may be provided by using " +
- "multiple instances of this argument.");
+ "SASL bind options");
registerMessage(MSGID_STOPDS_DESCRIPTION_PROXYAUTHZID,
- "Use the proxied authorization control with the provided " +
- "authorization ID.");
+ "Use the proxied authorization control with the given " +
+ "authorization ID");
registerMessage(MSGID_STOPDS_DESCRIPTION_STOP_REASON,
- "A human-readable reason explaining why the Directory " +
- "Server is being stopped.");
+ "Reason the server is being stopped or restarted");
registerMessage(MSGID_STOPDS_DESCRIPTION_RESTART,
"Attempt to automatically restart the server once it has " +
- "stopped.");
+ "stopped");
registerMessage(MSGID_STOPDS_DESCRIPTION_STOP_TIME,
- "The time that the Directory Server should be stopped if " +
- "it should be some time in the future. The value should " +
- "be in the form YYYYMMDDhhmmssZ for UTC time or " +
- "YYYYMMDDhhmmss for local time.");
+ "Time to begin the shutdown in YYYYMMDDhhmmss format " +
+ "(local time)");
registerMessage(MSGID_STOPDS_DESCRIPTION_TRUST_ALL,
- "Blindly trust all server certificates.");
+ "Trust all server SSL certificates");
registerMessage(MSGID_STOPDS_DESCRIPTION_KSFILE,
- "The path to the SSL key store file.");
+ "Certificate keystore path");
registerMessage(MSGID_STOPDS_DESCRIPTION_KSPW,
- "The password needed to access the key store content.");
+ "Certificate keystore PIN");
registerMessage(MSGID_STOPDS_DESCRIPTION_KSPWFILE,
- "The path to the file containing the password needed to " +
- "access the key store content.");
+ "Certificate keystore PIN file");
registerMessage(MSGID_STOPDS_DESCRIPTION_TSFILE,
- "The path to the SSL trust store file.");
+ "Certificate trust store path");
registerMessage(MSGID_STOPDS_DESCRIPTION_TSPW,
- "The password needed to access the trust store content.");
+ "Certificate trust store PIN");
registerMessage(MSGID_STOPDS_DESCRIPTION_TSPWFILE,
- "The path to the file containing the password needed to " +
- "access the trust store content.");
+ "Certificate trust store PIN file");
registerMessage(MSGID_STOPDS_DESCRIPTION_SHOWUSAGE,
"Display this usage information.");
registerMessage(MSGID_STOPDS_CANNOT_INITIALIZE_ARGS,
@@ -8064,9 +8292,10 @@
"ERROR: Cannot establish a connection to the " +
"Directory Server: %s.");
registerMessage(MSGID_STOPDS_UNEXPECTED_CONNECTION_CLOSURE,
- "ERROR: The connection to the Directory Server was " +
- "unexpectedly closed while waiting for a response to the " +
- "shutdown request.");
+ "NOTICE: The connection to the Directory Server was " +
+ "closed while waiting for a response to the shutdown " +
+ "request. This likely means that the server has started " +
+ "the shudown process.");
registerMessage(MSGID_STOPDS_IO_ERROR,
"ERROR: An I/O error occurred while attempting to " +
"communicate with the Directory Server: %s.");
@@ -8896,6 +9125,116 @@
registerMessage(MSGID_LDAPCOMPARE_NO_DNS,
"No entry DNs provided for the compare operation.");
+ registerMessage(MSGID_LDAPCOMPARE_NO_ATTR,
+ "No attribute was specified to use as the target for " +
+ "the comparison.");
+ registerMessage(MSGID_LDAPCOMPARE_INVALID_ATTR_STRING,
+ "Invalid attribute string '%s'. The attribute string " +
+ "must be in one of the following forms: " +
+ "'attribute:value', 'attribute::base64value', or " +
+ "'attribute:<valueFilePath'");
+
+
+ registerMessage(MSGID_LDAPSEARCH_PSEARCH_CHANGE_TYPE,
+ "# Persistent search change type: %s");
+ registerMessage(MSGID_LDAPSEARCH_PSEARCH_PREVIOUS_DN,
+ "# Persistent search previous entry DN: %s");
+ registerMessage(MSGID_LDAPSEARCH_ACCTUSABLE_HEADER,
+ "# Account Usability Response Control");
+ registerMessage(MSGID_LDAPSEARCH_ACCTUSABLE_IS_USABLE,
+ "# The account is usable.");
+ registerMessage(MSGID_LDAPSEARCH_ACCTUSABLE_TIME_UNTIL_EXPIRATION,
+ "# Time until password expiration: %s.");
+ registerMessage(MSGID_LDAPSEARCH_ACCTUSABLE_NOT_USABLE,
+ "# The account is not usable.");
+ registerMessage(MSGID_LDAPSEARCH_ACCTUSABLE_ACCT_INACTIVE,
+ "# The account has been deactivated.");
+ registerMessage(MSGID_LDAPSEARCH_ACCTUSABLE_PW_RESET,
+ "# The password has been reset.");
+ registerMessage(MSGID_LDAPSEARCH_ACCTUSABLE_PW_EXPIRED,
+ "# The password has expired.");
+ registerMessage(MSGID_LDAPSEARCH_ACCTUSABLE_REMAINING_GRACE,
+ "# Number of grace logins remaining: %d.");
+ registerMessage(MSGID_LDAPSEARCH_ACCTUSABLE_LOCKED,
+ "# The account is locked.");
+ registerMessage(MSGID_LDAPSEARCH_ACCTUSABLE_TIME_UNTIL_UNLOCK,
+ "# Time until the account is unlocked: %s.");
+
+
+ registerMessage(MSGID_TOOL_CONFLICTING_ARGS,
+ "You may not provide both the --%s and the --%s " +
+ "arguments.");
+ registerMessage(MSGID_TOOL_INVALID_CONTROL_STRING,
+ "Invalid control specification '%s'.");
+ registerMessage(MSGID_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS,
+ "SASL EXTERNAL authentication may only be requested if " +
+ "SSL or StartTLS is used.");
+ registerMessage(MSGID_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE,
+ "SASL EXTERNAL authentication may only be used if a " +
+ "client certificate keystore is specified.");
+
+
+ registerMessage(MSGID_BACKUPDB_TOOL_DESCRIPTION,
+ "This utility may be used to back up one or more " +
+ "Directory Server backends.");
+ registerMessage(MSGID_CONFIGDS_TOOL_DESCRIPTION,
+ "This utility may be used to define a base configuration " +
+ "for the Directory Server.");
+ registerMessage(MSGID_ENCPW_TOOL_DESCRIPTION,
+ "This utility may be used to encode user passwords with " +
+ "a specified storage scheme, or to determine whether a " +
+ "given clear-text value matches a provided encoded " +
+ "password.");
+ registerMessage(MSGID_LDIFEXPORT_TOOL_DESCRIPTION,
+ "This utility may be used to export data from a " +
+ "Directory Server backend in LDIF form.");
+ registerMessage(MSGID_LDIFIMPORT_TOOL_DESCRIPTION,
+ "This utility may be used to import LDIF data into a " +
+ "Directory Server backend.");
+ registerMessage(MSGID_INSTALLDS_TOOL_DESCRIPTION,
+ "This utility may be used to define a base configuration " +
+ "for the Directory Server.");
+ registerMessage(MSGID_LDAPCOMPARE_TOOL_DESCRIPTION,
+ "This utility may be used to perform LDAP compare " +
+ "operations in the Directory Server.");
+ registerMessage(MSGID_LDAPDELETE_TOOL_DESCRIPTION,
+ "This utility may be used to perform LDAP delete " +
+ "operations in the Directory Server.");
+ registerMessage(MSGID_LDAPMODIFY_TOOL_DESCRIPTION,
+ "This utility may be used to perform LDAP modify, add, " +
+ "delete, and modify DN operations in the Directory " +
+ "Server.");
+ registerMessage(MSGID_LDAPPWMOD_TOOL_DESCRIPTION,
+ "This utility may be used to perform LDAP password " +
+ "modify operations in the Directory Server.");
+ registerMessage(MSGID_LDAPSEARCH_TOOL_DESCRIPTION,
+ "This utility may be used to perform LDAP search " +
+ "operations in the Directory Server.");
+ registerMessage(MSGID_LDIFDIFF_TOOL_DESCRIPTION,
+ "This utility may be used to compare two LDIF files " +
+ "and report the differences in LDIF format.");
+ registerMessage(MSGID_LDIFMODIFY_TOOL_DESCRIPTION,
+ "This utility may be used to apply a set of modify, add, " +
+ "and delete operations against data in an LDIF file.");
+ registerMessage(MSGID_LDIFSEARCH_TOOL_DESCRIPTION,
+ "This utility may be used to perform search operations " +
+ "against data in an LDIF file.");
+ registerMessage(MSGID_MAKELDIF_TOOL_DESCRIPTION,
+ "This utility may be used to generate LDIF data based on " +
+ "a definition in a template file.");
+ registerMessage(MSGID_RESTOREDB_TOOL_DESCRIPTION,
+ "This utility may be used to restore a backup of a " +
+ "Directory Server backend.");
+ registerMessage(MSGID_STOPDS_TOOL_DESCRIPTION,
+ "This utility may be used to request that the Directory " +
+ "Server stop running or perform a restart.");
+ registerMessage(MSGID_VERIFYINDEX_TOOL_DESCRIPTION,
+ "This utility may be used to ensure that index data is " +
+ "consistent within a backend based on the Berkeley DB " +
+ "Java Edition.");
+ registerMessage(MSGID_WAIT4DEL_TOOL_DESCRIPTION,
+ "This utility may be used to wait for a file to be " +
+ "removed from the filesystem.");
}
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfileViewer.java b/opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfileViewer.java
index c94b466..f848f82 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfileViewer.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfileViewer.java
@@ -108,9 +108,10 @@
// Create the command-line argument parser for use with this program.
+ String toolDescription = getMessage(MSGID_PROFILEVIEWER_TOOL_DESCRIPTION);
ArgumentParser argParser =
new ArgumentParser("org.opends.server.plugins.profiler.ProfileViewer",
- false);
+ toolDescription, false);
// Initialize all the command-line argument types and register them with the
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/BackUpDB.java b/opendj-sdk/opends/src/server/org/opends/server/tools/BackUpDB.java
index 6120189..e95b401 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/BackUpDB.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/BackUpDB.java
@@ -84,7 +84,6 @@
*
* @param args The command-line arguments provided to this program.
*/
-
public static void main(String[] args)
{
int retCode = mainBackUpDB(args);
@@ -121,8 +120,10 @@
// Create the command-line argument parser for use with this program.
+ String toolDescription = getMessage(MSGID_BACKUPDB_TOOL_DESCRIPTION);
ArgumentParser argParser =
- new ArgumentParser("org.opends.server.tools.BackUpDB", false);
+ new ArgumentParser("org.opends.server.tools.BackUpDB", toolDescription,
+ false);
// Initialize all the command-line argument types and register them with the
@@ -216,7 +217,7 @@
int msgID = MSGID_BACKUPDB_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -231,7 +232,7 @@
int msgID = MSGID_BACKUPDB_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.err.println(argParser.getUsage());
return 1;
}
@@ -253,7 +254,7 @@
int msgID = MSGID_BACKUPDB_CANNOT_MIX_BACKUP_ALL_AND_BACKEND_ID;
String message = getMessage(msgID, backUpAll.getLongIdentifier(),
backendID.getLongIdentifier());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -262,7 +263,7 @@
int msgID = MSGID_BACKUPDB_NEED_BACKUP_ALL_OR_BACKEND_ID;
String message = getMessage(msgID, backUpAll.getLongIdentifier(),
backendID.getLongIdentifier());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -292,7 +293,7 @@
String message = getMessage(msgID,
incrementalBaseID.getLongIdentifier(),
incremental.getLongIdentifier());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -311,7 +312,7 @@
int msgID = MSGID_BACKUPDB_SIGN_REQUIRES_HASH;
String message = getMessage(msgID, signHash.getLongIdentifier(),
hash.getLongIdentifier());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -329,7 +330,7 @@
int msgID = MSGID_BACKUPDB_CANNOT_CREATE_BACKUP_DIR;
String message = getMessage(msgID, backupDirectory.getValue(),
stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -348,7 +349,7 @@
{
int msgID = MSGID_BACKUPDB_SERVER_BOOTSTRAP_ERROR;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -361,14 +362,14 @@
{
int msgID = MSGID_BACKUPDB_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_BACKUPDB_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -383,21 +384,21 @@
{
int msgID = MSGID_BACKUPDB_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_BACKUPDB_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_BACKUPDB_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -412,21 +413,21 @@
{
int msgID = MSGID_BACKUPDB_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_BACKUPDB_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_BACKUPDB_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -440,21 +441,21 @@
{
int msgID = MSGID_BACKUPDB_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_BACKUPDB_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_BACKUPDB_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/ConfigureDS.java b/opendj-sdk/opends/src/server/org/opends/server/tools/ConfigureDS.java
index d646e70..3268b62 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/ConfigureDS.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/ConfigureDS.java
@@ -147,7 +147,9 @@
StringArgument rootPassword;
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false);
+ String toolDescription = getMessage(MSGID_CONFIGDS_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false);
try
{
configFile = new StringArgument("configfile", 'c', "configFile", true,
@@ -201,7 +203,7 @@
{
int msgID = MSGID_CONFIGDS_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -216,7 +218,7 @@
int msgID = MSGID_CONFIGDS_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.err.println(argParser.getUsage());
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
@@ -235,7 +237,7 @@
{
int msgID = MSGID_CONFIGDS_NO_CONFIG_CHANGES;
String message = getMessage(msgID);
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.err.println(argParser.getUsage());
return 1;
}
@@ -256,7 +258,7 @@
String message = getMessage(msgID,
String.valueOf(configFile.getValue()),
e.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -271,7 +273,7 @@
String message = getMessage(msgID,
String.valueOf(configFile.getValue()),
e.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -285,7 +287,7 @@
String message = getMessage(msgID,
String.valueOf(configFile.getValue()),
e.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -300,7 +302,7 @@
int msgID = MSGID_CONFIGDS_CANNOT_ACQUIRE_SERVER_LOCK;
String message = getMessage(msgID, String.valueOf(serverLockFileName),
String.valueOf(failureReason));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -324,7 +326,7 @@
int msgID = MSGID_CONFIGDS_CANNOT_PARSE_BASE_DN;
String message = getMessage(msgID, String.valueOf(dnString),
de.getErrorMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -347,7 +349,7 @@
String message = getMessage(msgID,
String.valueOf(rootDNString.getValue()),
de.getErrorMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -363,7 +365,7 @@
{
int msgID = MSGID_CONFIGDS_NO_ROOT_PW;
String message = getMessage(msgID);
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -393,7 +395,7 @@
{
int msgID = MSGID_CONFIGDS_CANNOT_UPDATE_BASE_DN;
String message = getMessage(msgID, String.valueOf(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -419,7 +421,7 @@
{
int msgID = MSGID_CONFIGDS_CANNOT_UPDATE_LDAP_PORT;
String message = getMessage(msgID, String.valueOf(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -453,7 +455,7 @@
{
int msgID = MSGID_CONFIGDS_CANNOT_UPDATE_ROOT_USER;
String message = getMessage(msgID, String.valueOf(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -466,13 +468,13 @@
int msgID = MSGID_CONFIGDS_WROTE_UPDATED_CONFIG;
String message = getMessage(msgID);
- System.out.println(message);
+ System.out.println(wrapText(message, MAX_LINE_WIDTH));
}
catch (DirectoryException de)
{
int msgID = MSGID_CONFIGDS_CANNOT_WRITE_UPDATED_CONFIG;
String message = getMessage(msgID, de.getErrorMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/EncodePassword.java b/opendj-sdk/opends/src/server/org/opends/server/tools/EncodePassword.java
index 35bd9ec..c0ba48d 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/EncodePassword.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/EncodePassword.java
@@ -52,6 +52,7 @@
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.ToolMessages.*;
+import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -87,8 +88,10 @@
// Create the command-line argument parser for use with this program.
+ String toolDescription = getMessage(MSGID_ENCPW_TOOL_DESCRIPTION);
ArgumentParser argParser =
- new ArgumentParser("org.opends.server.tools.EncodePassword", false);
+ new ArgumentParser("org.opends.server.tools.EncodePassword",
+ toolDescription, false);
// Initialize all the command-line argument types and register them with the
@@ -165,7 +168,7 @@
int msgID = MSGID_ENCPW_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -180,7 +183,7 @@
int msgID = MSGID_ENCPW_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.err.println(argParser.getUsage());
System.exit(1);
}
@@ -211,7 +214,7 @@
int msgID = MSGID_ENCPW_NO_CLEAR_PW;
String message = getMessage(msgID, clearPassword.getLongIdentifier(),
clearPasswordFile.getLongIdentifier());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.err.println(argParser.getUsage());
System.exit(1);
}
@@ -220,7 +223,7 @@
{
int msgID = MSGID_ENCPW_NO_SCHEME;
String message = getMessage(msgID, schemeName.getLongIdentifier());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.err.println(argParser.getUsage());
System.exit(1);
}
@@ -255,7 +258,7 @@
{
int msgID = MSGID_ENCPW_SERVER_BOOTSTRAP_ERROR;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -268,14 +271,14 @@
{
int msgID = MSGID_ENCPW_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (Exception e)
{
int msgID = MSGID_ENCPW_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -290,21 +293,21 @@
{
int msgID = MSGID_ENCPW_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (InitializationException ie)
{
int msgID = MSGID_ENCPW_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (Exception e)
{
int msgID = MSGID_ENCPW_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -319,21 +322,21 @@
{
int msgID = MSGID_ENCPW_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (InitializationException ie)
{
int msgID = MSGID_ENCPW_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (Exception e)
{
int msgID = MSGID_ENCPW_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -349,21 +352,21 @@
{
int msgID = MSGID_ENCPW_CANNOT_INITIALIZE_STORAGE_SCHEMES;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (InitializationException ie)
{
int msgID = MSGID_ENCPW_CANNOT_INITIALIZE_STORAGE_SCHEMES;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (Exception e)
{
int msgID = MSGID_ENCPW_CANNOT_INITIALIZE_STORAGE_SCHEMES;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -379,7 +382,7 @@
{
int msgID = MSGID_ENCPW_NO_STORAGE_SCHEMES;
String message = getMessage(msgID);
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
}
else
{
@@ -411,7 +414,7 @@
{
int msgID = MSGID_ENCPW_NO_STORAGE_SCHEMES;
String message = getMessage(msgID);
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
}
else
{
@@ -448,7 +451,7 @@
{
int msgID = MSGID_ENCPW_NO_SUCH_AUTH_SCHEME;
String message = getMessage(msgID, scheme);
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
}
@@ -460,7 +463,7 @@
{
int msgID = MSGID_ENCPW_NO_SUCH_SCHEME;
String message = getMessage(msgID, scheme);
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
}
@@ -486,14 +489,14 @@
{
int msgID = MSGID_ENCPW_INVALID_ENCODED_AUTHPW;
String message = getMessage(msgID, de.getErrorMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (Exception e)
{
int msgID = MSGID_ENCPW_INVALID_ENCODED_AUTHPW;
String message = getMessage(msgID, e);
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -501,13 +504,13 @@
{
int msgID = MSGID_ENCPW_PASSWORDS_MATCH;
String message = getMessage(msgID);
- System.out.println(message);
+ System.out.println(wrapText(message, MAX_LINE_WIDTH));
}
else
{
int msgID = MSGID_ENCPW_PASSWORDS_DO_NOT_MATCH;
String message = getMessage(msgID);
- System.out.println(message);
+ System.out.println(wrapText(message, MAX_LINE_WIDTH));
}
}
else
@@ -516,13 +519,13 @@
{
int msgID = MSGID_ENCPW_PASSWORDS_MATCH;
String message = getMessage(msgID);
- System.out.println(message);
+ System.out.println(wrapText(message, MAX_LINE_WIDTH));
}
else
{
int msgID = MSGID_ENCPW_PASSWORDS_DO_NOT_MATCH;
String message = getMessage(msgID);
- System.out.println(message);
+ System.out.println(wrapText(message, MAX_LINE_WIDTH));
}
}
}
@@ -542,14 +545,14 @@
{
int msgID = MSGID_ENCPW_CANNOT_ENCODE;
String message = getMessage(msgID, de.getErrorMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (Exception e)
{
int msgID = MSGID_ENCPW_CANNOT_ENCODE;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
}
@@ -567,14 +570,14 @@
{
int msgID = MSGID_ENCPW_CANNOT_ENCODE;
String message = getMessage(msgID, de.getErrorMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (Exception e)
{
int msgID = MSGID_ENCPW_CANNOT_ENCODE;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/ExportLDIF.java b/opendj-sdk/opends/src/server/org/opends/server/tools/ExportLDIF.java
index 10e83d6..90d515e 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/ExportLDIF.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/ExportLDIF.java
@@ -63,6 +63,7 @@
import static org.opends.server.messages.ConfigMessages.*;
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.ToolMessages.*;
+import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -120,8 +121,10 @@
// Create the command-line argument parser for use with this program.
+ String toolDescription = getMessage(MSGID_LDIFEXPORT_TOOL_DESCRIPTION);
ArgumentParser argParser =
- new ArgumentParser("org.opends.server.tools.ExportLDIF", false);
+ new ArgumentParser("org.opends.server.tools.ExportLDIF",
+ toolDescription, false);
// Initialize all the command-line argument types and register them with the
@@ -243,7 +246,7 @@
int msgID = MSGID_LDIFEXPORT_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -258,7 +261,7 @@
int msgID = MSGID_LDIFEXPORT_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.err.println(argParser.getUsage());
return 1;
}
@@ -284,7 +287,7 @@
{
int msgID = MSGID_LDIFEXPORT_SERVER_BOOTSTRAP_ERROR;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -297,14 +300,14 @@
{
int msgID = MSGID_LDIFEXPORT_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_LDIFEXPORT_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -319,21 +322,21 @@
{
int msgID = MSGID_LDIFEXPORT_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_LDIFEXPORT_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_LDIFEXPORT_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -348,21 +351,21 @@
{
int msgID = MSGID_LDIFEXPORT_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_LDIFEXPORT_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_LDIFEXPORT_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -376,21 +379,21 @@
{
int msgID = MSGID_LDIFEXPORT_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_LDIFEXPORT_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_LDIFEXPORT_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -413,21 +416,21 @@
{
int msgID = MSGID_LDIFEXPORT_CANNOT_INITIALIZE_PLUGINS;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_LDIFEXPORT_CANNOT_INITIALIZE_PLUGINS;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_LDIFEXPORT_CANNOT_INITIALIZE_PLUGINS;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/ImportLDIF.java b/opendj-sdk/opends/src/server/org/opends/server/tools/ImportLDIF.java
index 9782fa3..33a3790 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/ImportLDIF.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/ImportLDIF.java
@@ -66,6 +66,7 @@
import static org.opends.server.messages.ConfigMessages.*;
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.ToolMessages.*;
+import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -136,8 +137,10 @@
// Create the command-line argument parser for use with this program.
+ String toolDescription = getMessage(MSGID_LDIFIMPORT_TOOL_DESCRIPTION);
ArgumentParser argParser =
- new ArgumentParser("org.opends.server.tools.ImportLDIF", false);
+ new ArgumentParser("org.opends.server.tools.ImportLDIF",
+ toolDescription, false);
// Initialize all the command-line argument types and register them with the
@@ -290,7 +293,7 @@
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -305,7 +308,7 @@
int msgID = MSGID_LDIFIMPORT_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.err.println(argParser.getUsage());
return 1;
}
@@ -327,7 +330,7 @@
int msgID = MSGID_LDIFIMPORT_CONFLICTING_OPTIONS;
String message = getMessage(msgID, ldifFiles.getLongIdentifier(),
templateFile.getLongIdentifier());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -336,7 +339,7 @@
int msgID = MSGID_LDIFIMPORT_MISSING_REQUIRED_ARGUMENT;
String message = getMessage(msgID, ldifFiles.getLongIdentifier(),
templateFile.getLongIdentifier());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -354,7 +357,7 @@
{
int msgID = MSGID_LDIFIMPORT_SERVER_BOOTSTRAP_ERROR;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -367,14 +370,14 @@
{
int msgID = MSGID_LDIFIMPORT_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -389,21 +392,21 @@
{
int msgID = MSGID_LDIFIMPORT_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -418,21 +421,21 @@
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -446,21 +449,21 @@
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -484,21 +487,21 @@
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_PWPOLICY;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_PWPOLICY;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_PWPOLICY;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -514,21 +517,21 @@
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_PLUGINS;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_PLUGINS;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_PLUGINS;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/InstallDS.java b/opendj-sdk/opends/src/server/org/opends/server/tools/InstallDS.java
index 5a86eab..fb66501 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/InstallDS.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/InstallDS.java
@@ -52,6 +52,7 @@
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.ToolMessages.*;
+import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -77,13 +78,6 @@
/**
- * The position at which to wrap long lines.
- */
- public static final int MAX_LINE_WIDTH = 79;
-
-
-
- /**
* Indicates whether we think we're running on a Windows system.
*/
private static boolean isWindows = false;
@@ -154,7 +148,9 @@
// Create and initialize the argument parser for this program.
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false);
+ String toolDescription = getMessage(MSGID_INSTALLDS_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false);
BooleanArgument addBaseEntry;
BooleanArgument testOnly;
BooleanArgument showUsage;
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java
index 0424c39..35bf220 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java
@@ -65,6 +65,7 @@
import static org.opends.server.messages.ToolMessages.*;
import static org.opends.server.protocols.ldap.LDAPResultCode.*;
import static org.opends.server.util.ServerConstants.*;
+import static org.opends.server.util.StaticUtils.*;
/**
@@ -201,8 +202,7 @@
{
LDAPMessage message = new LDAPMessage(nextMessageID.getAndIncrement(),
protocolOp, controls);
- int numBytes =
- connection.getASN1Writer().writeElement(message.encode());
+ connection.getASN1Writer().writeElement(message.encode());
ASN1Element element = connection.getASN1Reader().readElement();
responseMessage =
LDAPMessage.decode(ASN1Sequence.decodeAsSequence(element));
@@ -216,7 +216,7 @@
{
msgID = MSGID_OPERATION_FAILED;
String msg = getMessage(msgID, "COMPARE", line, ae.getMessage());
- err.println(msg);
+ err.println(wrapText(msg, MAX_LINE_WIDTH));
return;
}
}
@@ -246,7 +246,7 @@
{
msgID = MSGID_OPERATION_FAILED;
String msg = getMessage(msgID, "COMPARE", line, errorMessage);
- err.println(msg);
+ err.println(wrapText(msg, MAX_LINE_WIDTH));
}
}
}
@@ -327,29 +327,31 @@
LDAPCompareOptions compareOptions = new LDAPCompareOptions();
LDAPConnection connection = null;
- BooleanArgument noop = null;
- BooleanArgument trustAll = null;
- StringArgument assertionFilter = null;
- StringArgument bindDN = null;
- StringArgument bindPassword = null;
- FileBasedArgument bindPasswordFile = null;
- StringArgument encodingStr = null;
- StringArgument keyStorePath = null;
- StringArgument keyStorePassword = null;
- StringArgument trustStorePath = null;
- StringArgument trustStorePassword = null;
- StringArgument hostName = null;
- IntegerArgument port = null;
- IntegerArgument version = null;
- BooleanArgument showUsage = null;
- StringArgument controlStr = null;
- BooleanArgument verbose = null;
- BooleanArgument continueOnError = null;
- BooleanArgument useSSL = null;
- BooleanArgument startTLS = null;
- BooleanArgument saslExternal = null;
- StringArgument filename = null;
- StringArgument saslOptions = null;
+ BooleanArgument continueOnError = null;
+ BooleanArgument noop = null;
+ BooleanArgument saslExternal = null;
+ BooleanArgument showUsage = null;
+ BooleanArgument startTLS = null;
+ BooleanArgument trustAll = null;
+ BooleanArgument useSSL = null;
+ BooleanArgument verbose = null;
+ FileBasedArgument bindPasswordFile = null;
+ FileBasedArgument keyStorePasswordFile = null;
+ FileBasedArgument trustStorePasswordFile = null;
+ IntegerArgument port = null;
+ IntegerArgument version = null;
+ StringArgument assertionFilter = null;
+ StringArgument bindDN = null;
+ StringArgument bindPassword = null;
+ StringArgument controlStr = null;
+ StringArgument encodingStr = null;
+ StringArgument filename = null;
+ StringArgument hostName = null;
+ StringArgument keyStorePath = null;
+ StringArgument keyStorePassword = null;
+ StringArgument saslOptions = null;
+ StringArgument trustStorePath = null;
+ StringArgument trustStorePassword = null;
ArrayList<String> dnStrings = new ArrayList<String> ();
String attributeType = null;
@@ -357,113 +359,151 @@
Reader rdr = null;
// Create the command-line argument parser for use with this program.
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false, true,
- 1, 0, " \'attribute:value\' \"DN\" ...");
+ String toolDescription = getMessage(MSGID_LDAPCOMPARE_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false, true, 1, 0,
+ " \'attribute:value\' \"DN\" ...");
try
{
- trustAll = new BooleanArgument("trustAll", 'X', "trustAll",
- MSGID_DESCRIPTION_TRUSTALL);
- argParser.addArgument(trustAll);
- bindDN = new StringArgument("bindDN", 'D', "bindDN", false, false,
- true, "{bindDN}", null, null,
+ hostName = new StringArgument("host", 'h', "host", false, false, true,
+ "{host}", "localhost", null,
+ MSGID_DESCRIPTION_HOST);
+ argParser.addArgument(hostName);
+
+ port = new IntegerArgument("port", 'p', "port", false, false, true,
+ "{port}", 389, null, MSGID_DESCRIPTION_PORT);
+ argParser.addArgument(port);
+
+ useSSL = new BooleanArgument("useSSL", 'Z', "useSSL",
+ MSGID_DESCRIPTION_USE_SSL);
+ argParser.addArgument(useSSL);
+
+ startTLS = new BooleanArgument("startTLS", 'q', "startTLS",
+ MSGID_DESCRIPTION_START_TLS);
+ argParser.addArgument(startTLS);
+
+ bindDN = new StringArgument("bindDN", 'D', "bindDN", false, false, true,
+ "{bindDN}", null, null,
MSGID_DESCRIPTION_BINDDN);
argParser.addArgument(bindDN);
+
bindPassword = new StringArgument("bindPassword", 'w', "bindPassword",
- false, false,
- true, "{bindPassword}", null, null,
- MSGID_DESCRIPTION_BINDPASSWORD);
+ false, false, true, "{bindPassword}",
+ null, null,
+ MSGID_DESCRIPTION_BINDPASSWORD);
argParser.addArgument(bindPassword);
- bindPasswordFile = new FileBasedArgument("bindPasswordFile", 'j',
- "bindPasswordFile", false, false,
- "{bindPasswordFilename}", null, null,
- MSGID_DESCRIPTION_BINDPASSWORDFILE);
+
+ bindPasswordFile =
+ new FileBasedArgument("bindPasswordFile", 'j',"bindPasswordFile",
+ false, false, "{bindPasswordFilename}", null,
+ null, MSGID_DESCRIPTION_BINDPASSWORDFILE);
argParser.addArgument(bindPasswordFile);
- encodingStr = new StringArgument("encoding", 'i', "encoding",
- false, false,
- true, "{encoding}", null, null,
- MSGID_DESCRIPTION_ENCODING);
- argParser.addArgument(encodingStr);
- keyStorePath = new StringArgument("keyStorePath", 'K',
- "keyStorePath", false, false, true,
- "{keyStorePath}", null, null,
- MSGID_DESCRIPTION_KEYSTOREPATH);
+
+ filename = new StringArgument("filename", 'f', "filename", false, false,
+ true, "{filename}", null, null,
+ MSGID_COMPARE_DESCRIPTION_FILENAME);
+ argParser.addArgument(filename);
+
+ saslExternal = new BooleanArgument("useSASLExternal", 'r',
+ "useSASLExternal",
+ MSGID_DESCRIPTION_USE_SASL_EXTERNAL);
+ argParser.addArgument(saslExternal);
+
+ saslOptions = new StringArgument("saslOptions", 'o', "saslOptions", false,
+ true, true, "{name=value}", null, null,
+ MSGID_DESCRIPTION_SASL_PROPERTIES);
+ argParser.addArgument(saslOptions);
+
+ trustAll = new BooleanArgument("trustAll", 'X', "trustAll",
+ MSGID_DESCRIPTION_TRUSTALL);
+ argParser.addArgument(trustAll);
+
+ keyStorePath = new StringArgument("keyStorePath", 'K', "keyStorePath",
+ false, false, true, "{keyStorePath}",
+ null, null,
+ MSGID_DESCRIPTION_KEYSTOREPATH);
argParser.addArgument(keyStorePath);
- trustStorePath = new StringArgument("trustStorePath", 'P',
- "trustStorePath", false, false, true,
- "{trustStorePath}", null, null,
- MSGID_DESCRIPTION_TRUSTSTOREPATH);
- argParser.addArgument(trustStorePath);
+
keyStorePassword = new StringArgument("keyStorePassword", 'W',
"keyStorePassword", false, false,
true, "{keyStorePassword}", null, null,
MSGID_DESCRIPTION_KEYSTOREPASSWORD);
argParser.addArgument(keyStorePassword);
- hostName = new StringArgument("host", 'h', "host",
- false, false,
- true, "{host}", "localhost", null,
- MSGID_DESCRIPTION_HOST);
- argParser.addArgument(hostName);
- port = new IntegerArgument("port", 'p', "port",
- false, false, true, "{port}", 389, null,
- MSGID_DESCRIPTION_PORT);
- argParser.addArgument(port);
+
+ keyStorePasswordFile =
+ new FileBasedArgument("keyStorePasswordFile", null,
+ "keyStorePasswordFile", false, false, "{path}",
+ null, null,
+ MSGID_DESCRIPTION_KEYSTOREPASSWORD_FILE);
+ argParser.addArgument(keyStorePasswordFile);
+
+ trustStorePath = new StringArgument("trustStorePath", 'P',
+ "trustStorePath", false, false, true,
+ "{trustStorePath}", null, null,
+ MSGID_DESCRIPTION_TRUSTSTOREPATH);
+ argParser.addArgument(trustStorePath);
+
+ trustStorePassword =
+ new StringArgument("trustStorePassword", null, "trustStorePassword",
+ false, false, true, "{trustStorePassword}", null,
+ null, MSGID_DESCRIPTION_TRUSTSTOREPASSWORD);
+ argParser.addArgument(trustStorePassword);
+
+ trustStorePasswordFile =
+ new FileBasedArgument("trustStorePasswordFile", null,
+ "trustStorePasswordFile", false, false,
+ "{path}", null, null,
+ MSGID_DESCRIPTION_TRUSTSTOREPASSWORD_FILE);
+ argParser.addArgument(trustStorePasswordFile);
+
+ assertionFilter = new StringArgument("assertionfilter", null,
+ "assertionFilter", false, false, true,
+ "{filter}", null, null,
+ MSGID_DESCRIPTION_ASSERTION_FILTER);
+ argParser.addArgument(assertionFilter);
+
+ controlStr =
+ new StringArgument("controls", 'J', "controls", false, false, true,
+ "{controloid[:criticality[:value|::b64value|:<filePath]]}",
+ null, null, MSGID_DESCRIPTION_CONTROLS);
+ argParser.addArgument(controlStr);
+
version = new IntegerArgument("version", 'V', "version",
false, false, true, "{version}", 3, null,
MSGID_DESCRIPTION_VERSION);
argParser.addArgument(version);
- filename = new StringArgument("filename", 'f',
- "filename", false, false, true,
- "{filename}", null, null,
- MSGID_COMPARE_DESCRIPTION_FILENAME);
- argParser.addArgument(filename);
- showUsage = new BooleanArgument("showUsage", 'H', "help",
- MSGID_DESCRIPTION_SHOWUSAGE);
- argParser.addArgument(showUsage);
- argParser.setUsageArgument(showUsage, out);
- controlStr = new StringArgument("controls", 'J', "controls", false,
- false, true,
- "{controloid[:criticality[:value|::b64value|:<filePath]]}",
- null, null, MSGID_DESCRIPTION_CONTROLS);
- argParser.addArgument(controlStr);
- verbose = new BooleanArgument("verbose", 'v', "verbose",
- MSGID_DESCRIPTION_VERBOSE);
- argParser.addArgument(verbose);
+
+ encodingStr = new StringArgument("encoding", 'i', "encoding",
+ false, false,
+ true, "{encoding}", null, null,
+ MSGID_DESCRIPTION_ENCODING);
+ argParser.addArgument(encodingStr);
+
continueOnError = new BooleanArgument("continueOnError", 'c',
"continueOnError",
MSGID_DESCRIPTION_CONTINUE_ON_ERROR);
argParser.addArgument(continueOnError);
- useSSL = new BooleanArgument("useSSL", 'Z',
- "useSSL",
- MSGID_DESCRIPTION_USE_SSL);
- argParser.addArgument(useSSL);
- startTLS = new BooleanArgument("startTLS", 'q',
- "startTLS",
- MSGID_DESCRIPTION_START_TLS);
- argParser.addArgument(startTLS);
- saslExternal = new BooleanArgument("useSASLExternal", 'r',
- "useSASLExternal",
- MSGID_DESCRIPTION_USE_SASL_EXTERNAL);
- argParser.addArgument(saslExternal);
- saslOptions = new StringArgument("saslOptions", 'o', "saslOptions",
- false, true, true, "{name=value}", null, null,
- MSGID_DESCRIPTION_SASL_PROPERTIES);
- argParser.addArgument(saslOptions);
+
noop = new BooleanArgument("no-op", 'n',
"noop",
MSGID_DESCRIPTION_NOOP);
argParser.addArgument(noop);
- assertionFilter = new StringArgument("assertionfilter", null,
- "assertionFilter", false, false, true,
- "{filter}", null, null,
- MSGID_DESCRIPTION_COMPARE_ASSERTION_FILTER);
- argParser.addArgument(assertionFilter);
+
+ verbose = new BooleanArgument("verbose", 'v', "verbose",
+ MSGID_DESCRIPTION_VERBOSE);
+ argParser.addArgument(verbose);
+
+ showUsage = new BooleanArgument("showUsage", 'H', "help",
+ MSGID_DESCRIPTION_SHOWUSAGE);
+ argParser.addArgument(showUsage);
+ argParser.setUsageArgument(showUsage, out);
} catch (ArgumentException ae)
{
int msgID = MSGID_ENCPW_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -477,7 +517,7 @@
int msgID = MSGID_ENCPW_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
err.println(argParser.getUsage());
return 1;
}
@@ -490,8 +530,10 @@
if(bindPassword.isPresent() && bindPasswordFile.isPresent())
{
- err.println("ERROR: Both -w and -j flags specified. " +
- "Please specify one.");
+ int msgID = MSGID_TOOL_CONFLICTING_ARGS;
+ String message = getMessage(msgID, bindPassword.getLongIdentifier(),
+ bindPasswordFile.getLongIdentifier());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -499,7 +541,9 @@
if(attrAndDNStrings.isEmpty())
{
- err.println("No Attributes specified for comparison");
+ int msgID = MSGID_LDAPCOMPARE_NO_ATTR;
+ String message = getMessage(msgID);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -516,7 +560,7 @@
if (dnStrings.isEmpty())
{
int msgID = MSGID_LDAPCOMPARE_NO_DNS;
- err.println(getMessage(msgID));
+ err.println(wrapText(getMessage(msgID), MAX_LINE_WIDTH));
return 1;
}
@@ -524,10 +568,9 @@
int idx = attributeString.indexOf(":");
if(idx == -1)
{
- err.println("Invalid attribute string:" + attributeString);
- err.println("Attribute string must be in one of the " +
- "following forms: attribute:value, attribute::base64value, " +
- "attribute:<filePath" );
+ int msgID = MSGID_LDAPCOMPARE_INVALID_ATTR_STRING;
+ String message = getMessage(msgID, attributeString);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
attributeType = attributeString.substring(0, idx);
@@ -548,7 +591,7 @@
assert debugException(CLASS_NAME, "main", e);
int msgID = MSGID_COMPARE_CANNOT_BASE64_DECODE_ASSERTION_VALUE;
- err.println(getMessage(msgID));
+ err.println(wrapText(getMessage(msgID), MAX_LINE_WIDTH));
return 1;
}
} else if(nextChar == '<')
@@ -561,7 +604,8 @@
catch (Exception e)
{
int msgID = MSGID_COMPARE_CANNOT_READ_ASSERTION_VALUE_FROM_FILE;
- err.println(getMessage(msgID, String.valueOf(e)));
+ err.println(wrapText(getMessage(msgID, String.valueOf(e)),
+ MAX_LINE_WIDTH));
return 1;
}
} else
@@ -582,7 +626,7 @@
} catch (ArgumentException ae)
{
assert debugException(CLASS_NAME, "main", ae);
- err.println(ae.getMessage());
+ err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return 1;
}
@@ -592,14 +636,14 @@
if(versionNumber != 2 && versionNumber != 3)
{
int msgID = MSGID_DESCRIPTION_INVALID_VERSION;
- err.println(getMessage(msgID, versionNumber));
+ err.println(wrapText(getMessage(msgID, versionNumber), MAX_LINE_WIDTH));
return 1;
}
connectionOptions.setVersionNumber(versionNumber);
} catch(ArgumentException ae)
{
assert debugException(CLASS_NAME, "main", ae);
- err.println(ae.getMessage());
+ err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return 1;
}
@@ -618,7 +662,7 @@
} catch(Exception ex)
{
assert debugException(CLASS_NAME, "main", ex);
- err.println(ex.getMessage());
+ err.println(wrapText(ex.getMessage(), MAX_LINE_WIDTH));
return 1;
}
} else if(bindPasswordValue == null)
@@ -628,9 +672,27 @@
}
String keyStorePathValue = keyStorePath.getValue();
- String keyStorePasswordValue = keyStorePassword.getValue();
String trustStorePathValue = trustStorePath.getValue();
+
+ String keyStorePasswordValue = null;
+ if (keyStorePassword.isPresent())
+ {
+ keyStorePasswordValue = keyStorePassword.getValue();
+ }
+ else if (keyStorePasswordFile.isPresent())
+ {
+ keyStorePasswordValue = keyStorePasswordFile.getValue();
+ }
+
String trustStorePasswordValue = null;
+ if (trustStorePassword.isPresent())
+ {
+ trustStorePasswordValue = trustStorePassword.getValue();
+ }
+ else if (trustStorePasswordFile.isPresent())
+ {
+ trustStorePasswordValue = trustStorePasswordFile.getValue();
+ }
compareOptions.setShowOperations(noop.isPresent());
compareOptions.setVerbose(verbose.isPresent());
@@ -642,7 +704,9 @@
LDAPControl ctrl = LDAPToolUtils.getControl(ctrlString, err);
if(ctrl == null)
{
- err.println("Invalid control specified:" + ctrlString);
+ int msgID = MSGID_TOOL_INVALID_CONTROL_STRING;
+ String message = getMessage(msgID, ctrlString);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
err.println(argParser.getUsage());
return 1;
}
@@ -664,8 +728,9 @@
}
catch (LDAPException le)
{
- err.println(getMessage(MSGID_LDAP_ASSERTION_INVALID_FILTER,
- le.getMessage()));
+ int msgID = MSGID_LDAP_ASSERTION_INVALID_FILTER;
+ String message = getMessage(msgID, le.getMessage());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -702,14 +767,16 @@
{
if(!connectionOptions.useSSL() && !connectionOptions.useStartTLS())
{
- err.println("SASL External requires either SSL or StartTLS " +
- "options to be requested.");
+ int msgID = MSGID_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS;
+ String message = getMessage(msgID);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
if(keyStorePathValue == null)
{
- err.println("SASL External requires a path to the SSL " +
- "client certificate keystore.");
+ int msgID = MSGID_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE;
+ String message = getMessage(msgID);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -760,19 +827,19 @@
} catch(LDAPException le)
{
assert debugException(CLASS_NAME, "main", le);
- err.println(le.getMessage());
+ err.println(wrapText(le.getMessage(), MAX_LINE_WIDTH));
int code = le.getResultCode();
return code;
} catch(LDAPConnectionException lce)
{
assert debugException(CLASS_NAME, "main", lce);
- err.println(lce.getMessage());
+ err.println(wrapText(lce.getMessage(), MAX_LINE_WIDTH));
int code = lce.getErrorCode();
return code;
} catch(Exception e)
{
assert debugException(CLASS_NAME, "main", e);
- err.println(e.getMessage());
+ err.println(wrapText(e.getMessage(), MAX_LINE_WIDTH));
return 1;
} finally
{
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPDelete.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPDelete.java
index d5b04e0..acfede2 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPDelete.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPDelete.java
@@ -58,10 +58,11 @@
import org.opends.server.util.args.StringArgument;
import static org.opends.server.loggers.Debug.*;
-import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.ToolMessages.*;
import static org.opends.server.protocols.ldap.LDAPResultCode.*;
+import static org.opends.server.util.ServerConstants.*;
+import static org.opends.server.util.StaticUtils.*;
/**
@@ -199,7 +200,7 @@
{
msgID = MSGID_OPERATION_FAILED;
String msg = getMessage(msgID, "DELETE", line, ae.getMessage());
- err.println(msg);
+ err.println(wrapText(msg, MAX_LINE_WIDTH));
return;
}
}
@@ -220,7 +221,7 @@
{
msgID = MSGID_OPERATION_FAILED;
String msg = getMessage(msgID, "DELETE", line, errorMessage);
- err.println(msg);
+ err.println(wrapText(msg, MAX_LINE_WIDTH));
} else
{
msgID = MSGID_OPERATION_SUCCESSFUL;
@@ -306,131 +307,176 @@
LDAPDeleteOptions deleteOptions = new LDAPDeleteOptions();
LDAPConnection connection = null;
- BooleanArgument trustAll = null;
- BooleanArgument noop = null;
- StringArgument bindDN = null;
- StringArgument bindPassword = null;
- FileBasedArgument bindPasswordFile = null;
- StringArgument encodingStr = null;
- StringArgument keyStorePath = null;
- StringArgument keyStorePassword = null;
- StringArgument trustStorePath = null;
- StringArgument trustStorePassword = null;
- StringArgument hostName = null;
- IntegerArgument port = null;
- IntegerArgument version = null;
- BooleanArgument showUsage = null;
- StringArgument controlStr = null;
- BooleanArgument verbose = null;
- BooleanArgument continueOnError = null;
- BooleanArgument useSSL = null;
- BooleanArgument startTLS = null;
- BooleanArgument saslExternal = null;
- BooleanArgument deleteSubtree = null;
- StringArgument filename = null;
- StringArgument saslOptions = null;
+ BooleanArgument continueOnError = null;
+ BooleanArgument deleteSubtree = null;
+ BooleanArgument noop = null;
+ BooleanArgument saslExternal = null;
+ BooleanArgument showUsage = null;
+ BooleanArgument startTLS = null;
+ BooleanArgument trustAll = null;
+ BooleanArgument useSSL = null;
+ BooleanArgument verbose = null;
+ FileBasedArgument bindPasswordFile = null;
+ FileBasedArgument keyStorePasswordFile = null;
+ FileBasedArgument trustStorePasswordFile = null;
+ IntegerArgument port = null;
+ IntegerArgument version = null;
+ StringArgument bindDN = null;
+ StringArgument bindPassword = null;
+ StringArgument controlStr = null;
+ StringArgument encodingStr = null;
+ StringArgument filename = null;
+ StringArgument hostName = null;
+ StringArgument keyStorePath = null;
+ StringArgument keyStorePassword = null;
+ StringArgument saslOptions = null;
+ StringArgument trustStorePath = null;
+ StringArgument trustStorePassword = null;
Reader rdr = null;
ArrayList<String> dnStrings = new ArrayList<String> ();
// Create the command-line argument parser for use with this program.
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false, true,
- 0, 1, "\"DN\"");
+ String toolDescription = getMessage(MSGID_LDAPDELETE_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false, true, 0, 1, "\"DN\"");
try
{
- trustAll = new BooleanArgument("trustAll", 'X', "trustAll",
- MSGID_DESCRIPTION_TRUSTALL);
- argParser.addArgument(trustAll);
- bindDN = new StringArgument("bindDN", 'D', "bindDN", false, false,
- true, "{bindDN}", null, null,
+ hostName = new StringArgument("host", 'h', "host", false, false, true,
+ "{host}", "localhost", null,
+ MSGID_DESCRIPTION_HOST);
+ argParser.addArgument(hostName);
+
+ port = new IntegerArgument("port", 'p', "port", false, false, true,
+ "{port}", 389, null, MSGID_DESCRIPTION_PORT);
+ argParser.addArgument(port);
+
+ useSSL = new BooleanArgument("useSSL", 'Z', "useSSL",
+ MSGID_DESCRIPTION_USE_SSL);
+ argParser.addArgument(useSSL);
+
+ startTLS = new BooleanArgument("startTLS", 'q', "startTLS",
+ MSGID_DESCRIPTION_START_TLS);
+ argParser.addArgument(startTLS);
+
+ bindDN = new StringArgument("bindDN", 'D', "bindDN", false, false, true,
+ "{bindDN}", null, null,
MSGID_DESCRIPTION_BINDDN);
argParser.addArgument(bindDN);
+
bindPassword = new StringArgument("bindPassword", 'w', "bindPassword",
false, false, true, "{bindPassword}",
null, null,
MSGID_DESCRIPTION_BINDPASSWORD);
argParser.addArgument(bindPassword);
- bindPasswordFile = new FileBasedArgument("bindPasswordFile", 'j',
- "bindPasswordFile", false, false,
- "{bindPasswordFilename}", null, null,
- MSGID_DESCRIPTION_BINDPASSWORDFILE);
+
+ bindPasswordFile =
+ new FileBasedArgument("bindPasswordFile", 'j', "bindPasswordFile",
+ false, false, "{bindPasswordFilename}", null,
+ null, MSGID_DESCRIPTION_BINDPASSWORDFILE);
argParser.addArgument(bindPasswordFile);
- encodingStr = new StringArgument("encoding", 'i', "encoding", false,
- false, true, "{encoding}", null, null,
- MSGID_DESCRIPTION_ENCODING);
- argParser.addArgument(encodingStr);
+
+ filename = new StringArgument("filename", 'f', "filename", false, false,
+ true, "{filename}", null, null,
+ MSGID_DELETE_DESCRIPTION_FILENAME);
+ argParser.addArgument(filename);
+
+ saslExternal = new BooleanArgument("useSASLExternal", 'r',
+ "useSASLExternal",
+ MSGID_DESCRIPTION_USE_SASL_EXTERNAL);
+ argParser.addArgument(saslExternal);
+
+ saslOptions = new StringArgument("saslOptions", 'o', "saslOptions",
+ false, true, true, "{name=value}", null,
+ null, MSGID_DESCRIPTION_SASL_PROPERTIES);
+ argParser.addArgument(saslOptions);
+
+ trustAll = new BooleanArgument("trustAll", 'X', "trustAll",
+ MSGID_DESCRIPTION_TRUSTALL);
+ argParser.addArgument(trustAll);
+
keyStorePath = new StringArgument("keyStorePath", 'K', "keyStorePath",
false, false, true, "{keyStorePath}",
null, null,
MSGID_DESCRIPTION_KEYSTOREPATH);
argParser.addArgument(keyStorePath);
- trustStorePath = new StringArgument("trustStorePath", 'P',
- "trustStorePath", false, false, true,
- "{trustStorePath}", null, null,
- MSGID_DESCRIPTION_TRUSTSTOREPATH);
- argParser.addArgument(trustStorePath);
+
keyStorePassword = new StringArgument("keyStorePassword", 'W',
"keyStorePassword", false, false,
true, "{keyStorePassword}", null,
null,
MSGID_DESCRIPTION_KEYSTOREPASSWORD);
argParser.addArgument(keyStorePassword);
- hostName = new StringArgument("host", 'h', "host", false, false, true,
- "{host}", "localhost", null,
- MSGID_DESCRIPTION_HOST);
- argParser.addArgument(hostName);
- port = new IntegerArgument("port", 'p', "port", false, false, true,
- "{port}", 389, null, MSGID_DESCRIPTION_PORT);
- argParser.addArgument(port);
+
+ keyStorePasswordFile =
+ new FileBasedArgument("keyStorePasswordFile", null,
+ "keyStorePasswordFile", false, false, "{path}",
+ null, null,
+ MSGID_DESCRIPTION_KEYSTOREPASSWORD_FILE);
+ argParser.addArgument(keyStorePasswordFile);
+
+ trustStorePath = new StringArgument("trustStorePath", 'P',
+ "trustStorePath", false, false, true,
+ "{trustStorePath}", null, null,
+ MSGID_DESCRIPTION_TRUSTSTOREPATH);
+ argParser.addArgument(trustStorePath);
+
+ trustStorePassword =
+ new StringArgument("trustStorePassword", null, "trustStorePassword",
+ false, false, true, "{trustStorePassword}", null,
+ null, MSGID_DESCRIPTION_TRUSTSTOREPASSWORD);
+ argParser.addArgument(trustStorePassword);
+
+ trustStorePasswordFile =
+ new FileBasedArgument("trustStorePasswordFile", null,
+ "trustStorePasswordFile", false, false,
+ "{path}", null, null,
+ MSGID_DESCRIPTION_TRUSTSTOREPASSWORD_FILE);
+ argParser.addArgument(trustStorePasswordFile);
+
+ deleteSubtree =
+ new BooleanArgument("deleteSubtree", 'x', "deleteSubtree",
+ MSGID_DELETE_DESCRIPTION_DELETE_SUBTREE);
+ argParser.addArgument(deleteSubtree);
+
+ controlStr =
+ new StringArgument("controls", 'J', "controls", false, false, true,
+ "{controloid[:criticality[:value|::b64value|:<fileurl]]}",
+ null, null, MSGID_DESCRIPTION_CONTROLS);
+ argParser.addArgument(controlStr);
+
version = new IntegerArgument("version", 'V', "version", false, false,
true, "{version}", 3, null,
MSGID_DESCRIPTION_VERSION);
argParser.addArgument(version);
- filename = new StringArgument("filename", 'f', "filename", false, false,
- true, "{filename}", null, null,
- MSGID_DELETE_DESCRIPTION_FILENAME);
- argParser.addArgument(filename);
+
+ encodingStr = new StringArgument("encoding", 'i', "encoding", false,
+ false, true, "{encoding}", null, null,
+ MSGID_DESCRIPTION_ENCODING);
+ argParser.addArgument(encodingStr);
+
+ continueOnError =
+ new BooleanArgument("continueOnError", 'c', "continueOnError",
+ MSGID_DESCRIPTION_CONTINUE_ON_ERROR);
+ argParser.addArgument(continueOnError);
+
+ noop = new BooleanArgument("no-op", 'n', "noop", MSGID_DESCRIPTION_NOOP);
+ argParser.addArgument(noop);
+
+ verbose = new BooleanArgument("verbose", 'v', "verbose",
+ MSGID_DESCRIPTION_VERBOSE);
+ argParser.addArgument(verbose);
+
showUsage = new BooleanArgument("showUsage", 'H', "help",
MSGID_DESCRIPTION_SHOWUSAGE);
argParser.addArgument(showUsage);
argParser.setUsageArgument(showUsage, out);
- controlStr = new StringArgument("controls", 'J', "controls", false, false,
- true, "{controloid[:criticality[:value|::b64value|:<fileurl]]}",
- null, null, MSGID_DESCRIPTION_CONTROLS);
- argParser.addArgument(controlStr);
- verbose = new BooleanArgument("verbose", 'v', "verbose",
- MSGID_DESCRIPTION_VERBOSE);
- argParser.addArgument(verbose);
- continueOnError = new BooleanArgument("continueOnError", 'c',
- "continueOnError",
- MSGID_DESCRIPTION_CONTINUE_ON_ERROR);
- argParser.addArgument(continueOnError);
- useSSL = new BooleanArgument("useSSL", 'Z', "useSSL",
- MSGID_DESCRIPTION_USE_SSL);
- argParser.addArgument(useSSL);
- startTLS = new BooleanArgument("startTLS", 'q', "startTLS",
- MSGID_DESCRIPTION_START_TLS);
- argParser.addArgument(startTLS);
- saslExternal = new BooleanArgument("useSASLExternal", 'r',
- "useSASLExternal",
- MSGID_DESCRIPTION_USE_SASL_EXTERNAL);
- argParser.addArgument(saslExternal);
- deleteSubtree = new BooleanArgument("deleteSubtree", 'x', "deleteSubtree",
- MSGID_DELETE_DESCRIPTION_DELETE_SUBTREE);
- argParser.addArgument(deleteSubtree);
-
- saslOptions = new StringArgument("saslOptions", 'o', "saslOptions",
- false, true, true, "{name=value}", null,
- null, MSGID_DESCRIPTION_SASL_PROPERTIES);
- argParser.addArgument(saslOptions);
- noop = new BooleanArgument("no-op", 'n', "noop", MSGID_DESCRIPTION_NOOP);
- argParser.addArgument(noop);
} catch (ArgumentException ae)
{
int msgID = MSGID_ENCPW_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -444,7 +490,7 @@
int msgID = MSGID_ENCPW_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
err.println(argParser.getUsage());
return 1;
}
@@ -458,8 +504,10 @@
if(bindPassword.isPresent() && bindPasswordFile.isPresent())
{
- err.println("ERROR: Both -w and -j flags specified. " +
- "Please specify one.");
+ int msgID = MSGID_TOOL_CONFLICTING_ARGS;
+ String message = getMessage(msgID, bindPassword.getLongIdentifier(),
+ bindPasswordFile.getLongIdentifier());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -471,7 +519,7 @@
} catch(ArgumentException ae)
{
assert debugException(CLASS_NAME, "main", ae);
- err.println(ae.getMessage());
+ err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return 1;
}
@@ -481,14 +529,14 @@
if(versionNumber != 2 && versionNumber != 3)
{
int msgID = MSGID_DESCRIPTION_INVALID_VERSION;
- err.println(getMessage(msgID, versionNumber));
+ err.println(wrapText(getMessage(msgID, versionNumber), MAX_LINE_WIDTH));
return 1;
}
connectionOptions.setVersionNumber(versionNumber);
} catch(ArgumentException ae)
{
assert debugException(CLASS_NAME, "main", ae);
- err.println(ae.getMessage());
+ err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return 1;
}
@@ -506,7 +554,7 @@
} catch(Exception ex)
{
assert debugException(CLASS_NAME, "main", ex);
- err.println(ex.getMessage());
+ err.println(wrapText(ex.getMessage(), MAX_LINE_WIDTH));
return 1;
}
} else if(bindPasswordValue == null)
@@ -516,9 +564,27 @@
}
String keyStorePathValue = keyStorePath.getValue();
- String keyStorePasswordValue = keyStorePassword.getValue();
String trustStorePathValue = trustStorePath.getValue();
+
+ String keyStorePasswordValue = null;
+ if (keyStorePassword.isPresent())
+ {
+ keyStorePasswordValue = keyStorePassword.getValue();
+ }
+ else if (keyStorePasswordFile.isPresent())
+ {
+ keyStorePasswordValue = keyStorePasswordFile.getValue();
+ }
+
String trustStorePasswordValue = null;
+ if (trustStorePassword.isPresent())
+ {
+ trustStorePasswordValue = trustStorePassword.getValue();
+ }
+ else if (trustStorePasswordFile.isPresent())
+ {
+ trustStorePasswordValue = trustStorePasswordFile.getValue();
+ }
deleteOptions.setShowOperations(noop.isPresent());
deleteOptions.setVerbose(verbose.isPresent());
@@ -531,7 +597,9 @@
LDAPControl ctrl = LDAPToolUtils.getControl(ctrlString, err);
if(ctrl == null)
{
- err.println("Invalid control specified:" + ctrlString);
+ int msgID = MSGID_TOOL_INVALID_CONTROL_STRING;
+ String message = getMessage(msgID, ctrlString);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
err.println(argParser.getUsage());
return 1;
}
@@ -581,14 +649,16 @@
{
if(!connectionOptions.useSSL() && !connectionOptions.useStartTLS())
{
- err.println("SASL External requires either SSL or StartTLS " +
- "options to be requested.");
+ int msgID = MSGID_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS;
+ String message = getMessage(msgID);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
if(keyStorePathValue == null)
{
- err.println("SASL External requires a path to the SSL " +
- "client certificate keystore.");
+ int msgID = MSGID_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE;
+ String message = getMessage(msgID);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -637,19 +707,19 @@
} catch(LDAPException le)
{
assert debugException(CLASS_NAME, "main", le);
- err.println(le.getMessage());
+ err.println(wrapText(le.getMessage(), MAX_LINE_WIDTH));
int code = le.getResultCode();
return code;
} catch(LDAPConnectionException lce)
{
assert debugException(CLASS_NAME, "main", lce);
- err.println(lce.getMessage());
+ err.println(wrapText(lce.getMessage(), MAX_LINE_WIDTH));
int code = lce.getErrorCode();
return code;
} catch(Exception e)
{
assert debugException(CLASS_NAME, "main", e);
- err.println(e.getMessage());
+ err.println(wrapText(e.getMessage(), MAX_LINE_WIDTH));
return 1;
} finally
{
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java
index 0c40f4b..d578a2d 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java
@@ -80,6 +80,7 @@
import static org.opends.server.messages.ToolMessages.*;
import static org.opends.server.protocols.ldap.LDAPResultCode.*;
import static org.opends.server.util.ServerConstants.*;
+import static org.opends.server.util.StaticUtils.*;
@@ -195,7 +196,7 @@
int msgID = MSGID_LDIF_FILE_INVALID_LDIF_ENTRY;
String message = getMessage(msgID, le.getLineNumber(), fileName,
String.valueOf(le));
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
continue;
}
} catch (Exception e)
@@ -220,7 +221,7 @@
{
int msgID = MSGID_LDIF_FILE_READ_ERROR;
String message = getMessage(msgID, fileName, String.valueOf(e));
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
continue;
}
}
@@ -318,8 +319,9 @@
{
assert debugException(CLASS_NAME, "readAndExecute", ae);
msgID = MSGID_OPERATION_FAILED;
- err.println(getMessage(msgID, operationType, asn1OctetStr,
- ae.getMessage()));
+ String message = getMessage(msgID, operationType, asn1OctetStr,
+ ae.getMessage());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
if(!modifyOptions.continueOnError())
{
throw new IOException(ae.getMessage());
@@ -389,7 +391,7 @@
if (errorMessage != null)
{
- out.println(errorMessage);
+ out.println(wrapText(errorMessage, MAX_LINE_WIDTH));
}
if (referralURLs != null)
@@ -408,7 +410,7 @@
if (controlValue == null)
{
msgID = MSGID_LDAPMODIFY_PREREAD_NO_VALUE;
- err.println(getMessage(msgID));
+ err.println(wrapText(getMessage(msgID), MAX_LINE_WIDTH));
continue;
}
@@ -423,13 +425,15 @@
catch (ASN1Exception ae)
{
msgID = MSGID_LDAPMODIFY_PREREAD_CANNOT_DECODE_VALUE;
- err.println(getMessage(msgID, ae.getMessage()));
+ err.println(wrapText(getMessage(msgID, ae.getMessage()),
+ MAX_LINE_WIDTH));
continue;
}
catch (LDAPException le)
{
msgID = MSGID_LDAPMODIFY_PREREAD_CANNOT_DECODE_VALUE;
- err.println(getMessage(msgID, le.getMessage()));
+ err.println(wrapText(getMessage(msgID, le.getMessage()),
+ MAX_LINE_WIDTH));
continue;
}
@@ -444,7 +448,7 @@
if (controlValue == null)
{
msgID = MSGID_LDAPMODIFY_POSTREAD_NO_VALUE;
- err.println(getMessage(msgID));
+ err.println(wrapText(getMessage(msgID), MAX_LINE_WIDTH));
continue;
}
@@ -459,13 +463,15 @@
catch (ASN1Exception ae)
{
msgID = MSGID_LDAPMODIFY_POSTREAD_CANNOT_DECODE_VALUE;
- err.println(getMessage(msgID, ae.getMessage()));
+ err.println(wrapText(getMessage(msgID, ae.getMessage()),
+ MAX_LINE_WIDTH));
continue;
}
catch (LDAPException le)
{
msgID = MSGID_LDAPMODIFY_POSTREAD_CANNOT_DECODE_VALUE;
- err.println(getMessage(msgID, le.getMessage()));
+ err.println(wrapText(getMessage(msgID, le.getMessage()),
+ MAX_LINE_WIDTH));
continue;
}
@@ -557,163 +563,208 @@
LDAPModifyOptions modifyOptions = new LDAPModifyOptions();
LDAPConnection connection = null;
- BooleanArgument trustAll = null;
- StringArgument assertionFilter = null;
- StringArgument bindDN = null;
- StringArgument bindPassword = null;
- FileBasedArgument bindPasswordFile = null;
- StringArgument proxyAuthzID = null;
- BooleanArgument reportAuthzID = null;
- StringArgument encodingStr = null;
- StringArgument keyStorePath = null;
- StringArgument keyStorePassword = null;
- StringArgument trustStorePath = null;
-// StringArgument trustStorePassword = null;
- StringArgument hostName = null;
- IntegerArgument port = null;
- BooleanArgument showUsage = null;
- StringArgument controlStr = null;
- BooleanArgument verbose = null;
- BooleanArgument continueOnError = null;
- BooleanArgument useSSL = null;
- BooleanArgument startTLS = null;
- BooleanArgument saslExternal = null;
- BooleanArgument defaultAdd = null;
- StringArgument filename = null;
- StringArgument saslOptions = null;
- StringArgument preReadAttributes = null;
- StringArgument postReadAttributes = null;
- IntegerArgument version = null;
- BooleanArgument noop = null;
+ BooleanArgument continueOnError = null;
+ BooleanArgument defaultAdd = null;
+ BooleanArgument noop = null;
+ BooleanArgument reportAuthzID = null;
+ BooleanArgument saslExternal = null;
+ BooleanArgument showUsage = null;
+ BooleanArgument startTLS = null;
+ BooleanArgument trustAll = null;
+ BooleanArgument useSSL = null;
+ BooleanArgument verbose = null;
+ FileBasedArgument bindPasswordFile = null;
+ FileBasedArgument keyStorePasswordFile = null;
+ FileBasedArgument trustStorePasswordFile = null;
+ IntegerArgument port = null;
+ IntegerArgument version = null;
+ StringArgument assertionFilter = null;
+ StringArgument bindDN = null;
+ StringArgument bindPassword = null;
+ StringArgument controlStr = null;
+ StringArgument encodingStr = null;
+ StringArgument filename = null;
+ StringArgument hostName = null;
+ StringArgument keyStorePath = null;
+ StringArgument keyStorePassword = null;
+ StringArgument postReadAttributes = null;
+ StringArgument preReadAttributes = null;
+ StringArgument proxyAuthzID = null;
+ StringArgument saslOptions = null;
+ StringArgument trustStorePath = null;
+ StringArgument trustStorePassword = null;
// Create the command-line argument parser for use with this program.
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false);
+ String toolDescription = getMessage(MSGID_LDAPMODIFY_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false);
try
{
- trustAll = new BooleanArgument("trustAll", 'X', "trustAll",
- MSGID_DESCRIPTION_TRUSTALL);
- argParser.addArgument(trustAll);
- bindDN = new StringArgument("bindDN", 'D', "bindDN", false, false,
- true, "{bindDN}", null, null,
+ hostName = new StringArgument("host", 'h', "host", false, false, true,
+ "{host}", "localhost", null,
+ MSGID_DESCRIPTION_HOST);
+ argParser.addArgument(hostName);
+
+ port = new IntegerArgument("port", 'p', "port", false, false, true,
+ "{port}", 389, null, MSGID_DESCRIPTION_PORT);
+ argParser.addArgument(port);
+
+ useSSL = new BooleanArgument("useSSL", 'Z', "useSSL",
+ MSGID_DESCRIPTION_USE_SSL);
+ argParser.addArgument(useSSL);
+
+ startTLS = new BooleanArgument("startTLS", 'q', "startTLS",
+ MSGID_DESCRIPTION_START_TLS);
+ argParser.addArgument(startTLS);
+
+ bindDN = new StringArgument("bindDN", 'D', "bindDN", false, false, true,
+ "{bindDN}", null, null,
MSGID_DESCRIPTION_BINDDN);
argParser.addArgument(bindDN);
+
bindPassword = new StringArgument("bindPassword", 'w', "bindPassword",
- false, false,
- true, "{bindPassword}", null, null,
- MSGID_DESCRIPTION_BINDPASSWORD);
+ false, false, true, "{bindPassword}",
+ null, null,
+ MSGID_DESCRIPTION_BINDPASSWORD);
argParser.addArgument(bindPassword);
- bindPasswordFile = new FileBasedArgument("bindPasswordFile", 'j',
- "bindPasswordFile", false, false,
- "{bindPasswordFilename}", null, null,
- MSGID_DESCRIPTION_BINDPASSWORDFILE);
+
+ bindPasswordFile =
+ new FileBasedArgument("bindPasswordFile", 'j', "bindPasswordFile",
+ false, false, "{bindPasswordFilename}", null,
+ null, MSGID_DESCRIPTION_BINDPASSWORDFILE);
argParser.addArgument(bindPasswordFile);
- proxyAuthzID = new StringArgument("proxy_authzid", 'Y', "proxyAs", false,
- false, true, "{authzID}", null, null,
- MSGID_DESCRIPTION_PROXY_AUTHZID);
- argParser.addArgument(proxyAuthzID);
- reportAuthzID = new BooleanArgument("reportauthzid", 'E',
- "reportAuthzID",
- MSGID_DESCRIPTION_REPORT_AUTHZID);
- argParser.addArgument(reportAuthzID);
- encodingStr = new StringArgument("encoding", 'i', "encoding",
- false, false,
- true, "{encoding}", null, null,
- MSGID_DESCRIPTION_ENCODING);
- argParser.addArgument(encodingStr);
- keyStorePath = new StringArgument("keyStorePath", 'K',
- "keyStorePath", false, false, true,
- "{keyStorePath}", null, null,
- MSGID_DESCRIPTION_KEYSTOREPATH);
- argParser.addArgument(keyStorePath);
- trustStorePath = new StringArgument("trustStorePath", 'P',
- "trustStorePath", false, false, true,
- "{trustStorePath}", null, null,
- MSGID_DESCRIPTION_TRUSTSTOREPATH);
- argParser.addArgument(trustStorePath);
- keyStorePassword = new StringArgument("keyStorePassword", 'W',
- "keyStorePassword", false, false,
- true, "{keyStorePassword}", null, null,
- MSGID_DESCRIPTION_KEYSTOREPASSWORD);
- argParser.addArgument(keyStorePassword);
- hostName = new StringArgument("host", 'h', "host",
- false, false,
- true, "{host}", "localhost", null,
- MSGID_DESCRIPTION_HOST);
- argParser.addArgument(hostName);
- port = new IntegerArgument("port", 'p', "port",
- false, false, true, "{port}", 389, null,
- MSGID_DESCRIPTION_PORT);
- argParser.addArgument(port);
- version = new IntegerArgument("version", 'V', "version",
- false, false, true, "{version}", 3, null,
- MSGID_DESCRIPTION_VERSION);
- argParser.addArgument(version);
- filename = new StringArgument("filename", 'f',
- "filename", false, false, true,
- "{filename}", null, null,
- MSGID_DELETE_DESCRIPTION_FILENAME);
- argParser.addArgument(filename);
- showUsage = new BooleanArgument("showUsage", 'H', "help",
- MSGID_DESCRIPTION_SHOWUSAGE);
- argParser.addArgument(showUsage);
- argParser.setUsageArgument(showUsage, out);
- controlStr = new StringArgument("controls", 'J', "controls", false,
- false, true,
- "{controloid[:criticality[:value|::b64value|:<fileurl]]}",
- null, null, MSGID_DESCRIPTION_CONTROLS);
- argParser.addArgument(controlStr);
- verbose = new BooleanArgument("verbose", 'v', "verbose",
- MSGID_DESCRIPTION_VERBOSE);
- argParser.addArgument(verbose);
- continueOnError = new BooleanArgument("continueOnError", 'c',
- "continueOnError",
- MSGID_DESCRIPTION_CONTINUE_ON_ERROR);
- argParser.addArgument(continueOnError);
- useSSL = new BooleanArgument("useSSL", 'Z',
- "useSSL",
- MSGID_DESCRIPTION_USE_SSL);
- argParser.addArgument(useSSL);
- startTLS = new BooleanArgument("startTLS", 'q',
- "startTLS",
- MSGID_DESCRIPTION_START_TLS);
- argParser.addArgument(startTLS);
- saslExternal = new BooleanArgument("useSASLExternal", 'r',
- "useSASLExternal",
- MSGID_DESCRIPTION_USE_SASL_EXTERNAL);
- argParser.addArgument(saslExternal);
- defaultAdd = new BooleanArgument("defaultAdd", 'a',
- "defaultAdd",
- MSGID_MODIFY_DESCRIPTION_DEFAULT_ADD);
+
+ defaultAdd = new BooleanArgument("defaultAdd", 'a', "defaultAdd",
+ MSGID_MODIFY_DESCRIPTION_DEFAULT_ADD);
argParser.addArgument(defaultAdd);
+
+ filename = new StringArgument("filename", 'f', "filename", false, false,
+ true, "{filename}", null, null,
+ MSGID_DELETE_DESCRIPTION_FILENAME);
+ argParser.addArgument(filename);
+
+ saslExternal = new BooleanArgument("useSASLExternal", 'r',
+ "useSASLExternal",
+ MSGID_DESCRIPTION_USE_SASL_EXTERNAL);
+ argParser.addArgument(saslExternal);
+
saslOptions = new StringArgument("saslOptions", 'o', "saslOptions", false,
true, true, "{name=value}", null, null,
MSGID_DESCRIPTION_SASL_PROPERTIES);
argParser.addArgument(saslOptions);
+
+ trustAll = new BooleanArgument("trustAll", 'X', "trustAll",
+ MSGID_DESCRIPTION_TRUSTALL);
+ argParser.addArgument(trustAll);
+
+ keyStorePath = new StringArgument("keyStorePath", 'K', "keyStorePath",
+ false, false, true, "{keyStorePath}",
+ null, null,
+ MSGID_DESCRIPTION_KEYSTOREPATH);
+ argParser.addArgument(keyStorePath);
+
+ keyStorePassword = new StringArgument("keyStorePassword", 'W',
+ "keyStorePassword", false, false,
+ true, "{keyStorePassword}", null,
+ null,
+ MSGID_DESCRIPTION_KEYSTOREPASSWORD);
+ argParser.addArgument(keyStorePassword);
+
+ keyStorePasswordFile =
+ new FileBasedArgument("keystorepasswordfile", null,
+ "keyStorePasswordFile", false, false, "{path}",
+ null, null,
+ MSGID_DESCRIPTION_KEYSTOREPASSWORD_FILE);
+ argParser.addArgument(keyStorePasswordFile);
+
+ trustStorePath = new StringArgument("trustStorePath", 'P',
+ "trustStorePath", false, false, true,
+ "{trustStorePath}", null, null,
+ MSGID_DESCRIPTION_TRUSTSTOREPATH);
+ argParser.addArgument(trustStorePath);
+
+ trustStorePassword =
+ new StringArgument("trustStorePassword", null, "trustStorePassword",
+ false, false, true, "{trustStorePassword}", null,
+ null, MSGID_DESCRIPTION_TRUSTSTOREPASSWORD);
+ argParser.addArgument(trustStorePassword);
+
+ trustStorePasswordFile =
+ new FileBasedArgument("truststorepasswordfile", null,
+ "trustStorePasswordFile", false, false,
+ "{path}", null, null,
+ MSGID_DESCRIPTION_TRUSTSTOREPASSWORD_FILE);
+ argParser.addArgument(trustStorePasswordFile);
+
+ proxyAuthzID = new StringArgument("proxy_authzid", 'Y', "proxyAs", false,
+ false, true, "{authzID}", null, null,
+ MSGID_DESCRIPTION_PROXY_AUTHZID);
+ argParser.addArgument(proxyAuthzID);
+
+ reportAuthzID = new BooleanArgument("reportauthzid", 'E',
+ "reportAuthzID",
+ MSGID_DESCRIPTION_REPORT_AUTHZID);
+ argParser.addArgument(reportAuthzID);
+
assertionFilter = new StringArgument("assertionfilter", null,
"assertionFilter", false, false,
true, "{filter}", null, null,
MSGID_DESCRIPTION_ASSERTION_FILTER);
argParser.addArgument(assertionFilter);
+
preReadAttributes = new StringArgument("prereadattrs", null,
"preReadAttributes", false, false,
true, "{attrList}", null, null,
MSGID_DESCRIPTION_PREREAD_ATTRS);
argParser.addArgument(preReadAttributes);
+
postReadAttributes = new StringArgument("postreadattrs", null,
"postReadAttributes", false,
false, true, "{attrList}", null,
null,
MSGID_DESCRIPTION_POSTREAD_ATTRS);
argParser.addArgument(postReadAttributes);
+
+ controlStr =
+ new StringArgument("controls", 'J', "controls", false, false, true,
+ "{controloid[:criticality[:value|::b64value|:<fileurl]]}",
+ null, null, MSGID_DESCRIPTION_CONTROLS);
+ argParser.addArgument(controlStr);
+
+ version = new IntegerArgument("version", 'V', "version",
+ false, false, true, "{version}", 3, null,
+ MSGID_DESCRIPTION_VERSION);
+ argParser.addArgument(version);
+
+ encodingStr = new StringArgument("encoding", 'i', "encoding",
+ false, false,
+ true, "{encoding}", null, null,
+ MSGID_DESCRIPTION_ENCODING);
+ argParser.addArgument(encodingStr);
+
+ continueOnError = new BooleanArgument("continueOnError", 'c',
+ "continueOnError",
+ MSGID_DESCRIPTION_CONTINUE_ON_ERROR);
+ argParser.addArgument(continueOnError);
+
noop = new BooleanArgument("no-op", 'n', "noop",
MSGID_DESCRIPTION_NOOP);
argParser.addArgument(noop);
+
+ verbose = new BooleanArgument("verbose", 'v', "verbose",
+ MSGID_DESCRIPTION_VERBOSE);
+ argParser.addArgument(verbose);
+
+ showUsage = new BooleanArgument("showUsage", 'H', "help",
+ MSGID_DESCRIPTION_SHOWUSAGE);
+ argParser.addArgument(showUsage);
+ argParser.setUsageArgument(showUsage, out);
} catch (ArgumentException ae)
{
int msgID = MSGID_ENCPW_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -727,7 +778,7 @@
int msgID = MSGID_ENCPW_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
err.println(argParser.getUsage());
return 1;
}
@@ -740,8 +791,10 @@
if(bindPassword.isPresent() && bindPasswordFile.isPresent())
{
- err.println("ERROR: Both -w and -j flags specified. " +
- "Please specify one.");
+ int msgID = MSGID_TOOL_CONFLICTING_ARGS;
+ String message = getMessage(msgID, bindPassword.getLongIdentifier(),
+ bindPasswordFile.getLongIdentifier());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -753,7 +806,7 @@
} catch(ArgumentException ae)
{
assert debugException(CLASS_NAME, "main", ae);
- err.println(ae.getMessage());
+ err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return 1;
}
@@ -763,14 +816,14 @@
if(versionNumber != 2 && versionNumber != 3)
{
int msgID = MSGID_DESCRIPTION_INVALID_VERSION;
- err.println(getMessage(msgID, versionNumber));
+ err.println(wrapText(getMessage(msgID, versionNumber), MAX_LINE_WIDTH));
return 1;
}
connectionOptions.setVersionNumber(versionNumber);
} catch(ArgumentException ae)
{
assert debugException(CLASS_NAME, "main", ae);
- err.println(ae.getMessage());
+ err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return 1;
}
@@ -788,7 +841,7 @@
} catch(Exception ex)
{
assert debugException(CLASS_NAME, "main", ex);
- err.println(ex.getMessage());
+ err.println(wrapText(ex.getMessage(), MAX_LINE_WIDTH));
return 1;
}
} else if(bindPasswordValue == null)
@@ -798,9 +851,27 @@
}
String keyStorePathValue = keyStorePath.getValue();
- String keyStorePasswordValue = keyStorePassword.getValue();
String trustStorePathValue = trustStorePath.getValue();
+
+ String keyStorePasswordValue = null;
+ if (keyStorePassword.isPresent())
+ {
+ keyStorePasswordValue = keyStorePassword.getValue();
+ }
+ else if (keyStorePasswordFile.isPresent())
+ {
+ keyStorePasswordValue = keyStorePasswordFile.getValue();
+ }
+
String trustStorePasswordValue = null;
+ if (trustStorePassword.isPresent())
+ {
+ trustStorePasswordValue = trustStorePassword.getValue();
+ }
+ else if (trustStorePasswordFile.isPresent())
+ {
+ trustStorePasswordValue = trustStorePasswordFile.getValue();
+ }
modifyOptions.setShowOperations(noop.isPresent());
modifyOptions.setVerbose(verbose.isPresent());
@@ -813,7 +884,9 @@
LDAPControl ctrl = LDAPToolUtils.getControl(ctrlString, err);
if(ctrl == null)
{
- err.println("Invalid control specified:" + ctrlString);
+ int msgID = MSGID_TOOL_INVALID_CONTROL_STRING;
+ String message = getMessage(msgID, ctrlString);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
err.println(argParser.getUsage());
return 1;
}
@@ -844,8 +917,9 @@
}
catch (LDAPException le)
{
- err.println(getMessage(MSGID_LDAP_ASSERTION_INVALID_FILTER,
- le.getMessage()));
+ int msgID = MSGID_LDAP_ASSERTION_INVALID_FILTER;
+ String message = getMessage(msgID, le.getMessage());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -919,14 +993,16 @@
{
if(!connectionOptions.useSSL() && !connectionOptions.useStartTLS())
{
- err.println("SASL External requires either SSL or StartTLS " +
- "options to be requested.");
+ int msgID = MSGID_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS;
+ String message = getMessage(msgID);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
if(keyStorePathValue == null)
{
- err.println("SASL External requires a path to the SSL " +
- "client certificate keystore.");
+ int msgID = MSGID_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE;
+ String message = getMessage(msgID);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -966,19 +1042,19 @@
} catch(LDAPException le)
{
assert debugException(CLASS_NAME, "main", le);
- err.println(le.getMessage());
+ err.println(wrapText(le.getMessage(), MAX_LINE_WIDTH));
int code = le.getResultCode();
return code;
} catch(LDAPConnectionException lce)
{
assert debugException(CLASS_NAME, "main", lce);
- err.println(lce.getMessage());
+ err.println(wrapText(lce.getMessage(), MAX_LINE_WIDTH));
int code = lce.getErrorCode();
return code;
} catch(Exception e)
{
assert debugException(CLASS_NAME, "main", e);
- err.println(e.getMessage());
+ err.println(wrapText(e.getMessage(), MAX_LINE_WIDTH));
return 1;
} finally
{
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java
index bff98ee..289ff11 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java
@@ -85,13 +85,6 @@
- /**
- * The position at which to wrap long lines.
- */
- public static final int MAX_LINE_WIDTH = 79;
-
-
-
/**
* Parses the command-line arguments, establishes a connection to the
@@ -190,7 +183,9 @@
// Initialize the argument parser.
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false);
+ String toolDescription = getMessage(MSGID_LDAPPWMOD_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false);
try
{
@@ -206,6 +201,16 @@
argParser.addArgument(ldapPort);
+ useSSL = new BooleanArgument("usessl", 'Z', "useSSL",
+ MSGID_LDAPPWMOD_DESCRIPTION_USE_SSL);
+ argParser.addArgument(useSSL);
+
+
+ useStartTLS = new BooleanArgument("usestarttls", 'q', "useStartTLS",
+ MSGID_LDAPPWMOD_DESCRIPTION_USE_STARTTLS);
+ argParser.addArgument(useStartTLS);
+
+
bindDN = new StringArgument("binddn", 'D', "bindDN", false, false, true,
"{bindDN}", null, null,
MSGID_LDAPPWMOD_DESCRIPTION_BIND_DN);
@@ -263,16 +268,6 @@
argParser.addArgument(currentPWFile);
- useSSL = new BooleanArgument("usessl", 'Z', "useSSL",
- MSGID_LDAPPWMOD_DESCRIPTION_USE_SSL);
- argParser.addArgument(useSSL);
-
-
- useStartTLS = new BooleanArgument("usestarttls", 'q', "useStartTLS",
- MSGID_LDAPPWMOD_DESCRIPTION_USE_STARTTLS);
- argParser.addArgument(useStartTLS);
-
-
sslBlindTrust =
new BooleanArgument("blindtrust", 'X', "trustAllCertificates",
MSGID_LDAPPWMOD_DESCRIPTION_BLIND_TRUST);
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java
index 2c2e9d8..ae28234 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java
@@ -159,8 +159,7 @@
LDAPMessage message = new LDAPMessage(nextMessageID.getAndIncrement(),
protocolOp,
searchOptions.getControls());
- int numBytes =
- connection.getASN1Writer().writeElement(message.encode());
+ connection.getASN1Writer().writeElement(message.encode());
byte opType;
do
@@ -186,13 +185,14 @@
EntryChangeNotificationControl ecn =
EntryChangeNotificationControl.decodeControl(
c.getControl());
- out.println("# Persistent Search Change Type: " +
- ecn.getChangeType().toString());
+ int msgID = MSGID_LDAPSEARCH_PSEARCH_CHANGE_TYPE;
+ out.println(getMessage(msgID,
+ ecn.getChangeType().toString()));
DN previousDN = ecn.getPreviousDN();
if (previousDN != null)
{
- out.println("# Persistent Search Previous DN: " +
- previousDN.toString());
+ msgID = MSGID_LDAPSEARCH_PSEARCH_PREVIOUS_DN;
+ out.println(getMessage(msgID, previousDN.toString()));
}
} catch (Exception e) {}
}
@@ -203,49 +203,58 @@
AccountUsableResponseControl acrc =
AccountUsableResponseControl.decodeControl(
c.getControl());
- out.println("# Account Usable Response Control");
+ int msgID = MSGID_LDAPSEARCH_ACCTUSABLE_HEADER;
+ out.println(getMessage(msgID));
if (acrc.isUsable())
{
- out.println("# Account is usable");
+ msgID = MSGID_LDAPSEARCH_ACCTUSABLE_IS_USABLE;
+ out.println(getMessage(msgID));
if (acrc.getSecondsBeforeExpiration() > 0)
{
int timeToExp = acrc.getSecondsBeforeExpiration();
String timeToExpStr = secondsToTimeString(timeToExp);
- out.println("# Time until expiration: " +
- timeToExpStr);
+ msgID =
+ MSGID_LDAPSEARCH_ACCTUSABLE_TIME_UNTIL_EXPIRATION;
+ out.println(getMessage(msgID, timeToExpStr));
}
}
else
{
- out.println("# Account is not usable");
+ msgID = MSGID_LDAPSEARCH_ACCTUSABLE_NOT_USABLE;
+ out.println(getMessage(msgID));
if (acrc.isInactive())
{
- out.println("# Account is inactive");
+ msgID = MSGID_LDAPSEARCH_ACCTUSABLE_ACCT_INACTIVE;
+ out.println(getMessage(msgID));
}
if (acrc.isReset())
{
- out.println("# Password has been reset");
+ msgID = MSGID_LDAPSEARCH_ACCTUSABLE_PW_RESET;
+ out.println(getMessage(msgID));
}
if (acrc.isExpired())
{
- out.println("# Password is expired");
+ msgID = MSGID_LDAPSEARCH_ACCTUSABLE_PW_EXPIRED;
+ out.println(getMessage(msgID));
if (acrc.getRemainingGraceLogins() > 0)
{
- out.println("# Grace logins remaining: " +
- acrc.getRemainingGraceLogins());
+ msgID = MSGID_LDAPSEARCH_ACCTUSABLE_REMAINING_GRACE;
+ out.println(getMessage(msgID,
+ acrc.getRemainingGraceLogins()));
}
}
if (acrc.isLocked())
{
- out.println("# Account is locked");
+ msgID = MSGID_LDAPSEARCH_ACCTUSABLE_LOCKED;
+ out.println(getMessage(msgID));
if (acrc.getSecondsBeforeUnlock() > 0)
{
int timeToUnlock = acrc.getSecondsBeforeUnlock();
String timeToUnlockStr =
secondsToTimeString(timeToUnlock);
- out.println("# Time until automatic unlock: " +
- timeToUnlockStr);
+ msgID = MSGID_LDAPSEARCH_ACCTUSABLE_TIME_UNTIL_UNLOCK;
+ out.println(getMessage(msgID, timeToUnlockStr));
}
}
}
@@ -276,7 +285,7 @@
// FIXME - throw exception?
int msgID = MSGID_SEARCH_OPERATION_INVALID_PROTOCOL;
String msg = getMessage(msgID, opType);
- err.println(msg);
+ err.println(wrapText(msg, MAX_LINE_WIDTH));
break;
}
@@ -292,7 +301,7 @@
else if (errorMessage != null)
{
out.println();
- out.println(errorMessage);
+ out.println(wrapText(errorMessage, MAX_LINE_WIDTH));
}
} while(opType != OP_TYPE_SEARCH_RESULT_DONE);
@@ -512,199 +521,248 @@
ArrayList<LDAPFilter> filters = new ArrayList<LDAPFilter>();
LinkedHashSet<String> attributes = new LinkedHashSet<String>();
- BooleanArgument trustAll = null;
- BooleanArgument noop = null;
- StringArgument assertionFilter = null;
- StringArgument baseDN = null;
- StringArgument bindDN = null;
- StringArgument bindPassword = null;
- FileBasedArgument bindPasswordFile = null;
- StringArgument proxyAuthzID = null;
- BooleanArgument reportAuthzID = null;
- BooleanArgument usePasswordPolicyControl = null;
- StringArgument encodingStr = null;
- StringArgument keyStorePath = null;
- StringArgument keyStorePassword = null;
- StringArgument trustStorePath = null;
- StringArgument trustStorePassword = null;
- StringArgument hostName = null;
- IntegerArgument port = null;
- IntegerArgument version = null;
- BooleanArgument showUsage = null;
- StringArgument controlStr = null;
- BooleanArgument verbose = null;
- BooleanArgument continueOnError = null;
- BooleanArgument useSSL = null;
- BooleanArgument startTLS = null;
- BooleanArgument saslExternal = null;
- StringArgument filename = null;
- IntegerArgument sizeLimit = null;
- IntegerArgument timeLimit = null;
- StringArgument searchScope = null;
- StringArgument dereferencePolicy = null;
- StringArgument saslOptions = null;
- BooleanArgument dontWrap = null;
- BooleanArgument typesOnly = null;
- StringArgument pSearchInfo = null;
- StringArgument matchedValuesFilter = null;
+ BooleanArgument continueOnError = null;
+ BooleanArgument dontWrap = null;
+ BooleanArgument noop = null;
+ BooleanArgument reportAuthzID = null;
+ BooleanArgument saslExternal = null;
+ BooleanArgument showUsage = null;
+ BooleanArgument trustAll = null;
+ BooleanArgument usePasswordPolicyControl = null;
+ BooleanArgument useSSL = null;
+ BooleanArgument startTLS = null;
+ BooleanArgument typesOnly = null;
+ BooleanArgument verbose = null;
+ FileBasedArgument bindPasswordFile = null;
+ FileBasedArgument keyStorePasswordFile = null;
+ FileBasedArgument trustStorePasswordFile = null;
+ IntegerArgument port = null;
+ IntegerArgument sizeLimit = null;
+ IntegerArgument timeLimit = null;
+ IntegerArgument version = null;
+ StringArgument assertionFilter = null;
+ StringArgument baseDN = null;
+ StringArgument bindDN = null;
+ StringArgument bindPassword = null;
+ StringArgument controlStr = null;
+ StringArgument dereferencePolicy = null;
+ StringArgument encodingStr = null;
+ StringArgument filename = null;
+ StringArgument hostName = null;
+ StringArgument keyStorePath = null;
+ StringArgument keyStorePassword = null;
+ StringArgument matchedValuesFilter = null;
+ StringArgument proxyAuthzID = null;
+ StringArgument pSearchInfo = null;
+ StringArgument saslOptions = null;
+ StringArgument searchScope = null;
+ StringArgument trustStorePath = null;
+ StringArgument trustStorePassword = null;
// Create the command-line argument parser for use with this program.
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false, true, 0, 0,
+ String toolDescription = getMessage(MSGID_LDAPSEARCH_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false, true, 0, 0,
"[filter] [attributes ...]");
try
{
+ hostName = new StringArgument("host", 'h', "host", false, false, true,
+ "{host}", "localhost", null,
+ MSGID_DESCRIPTION_HOST);
+ argParser.addArgument(hostName);
+
+ port = new IntegerArgument("port", 'p', "port", false, false, true,
+ "{port}", 389, null, MSGID_DESCRIPTION_PORT);
+ argParser.addArgument(port);
+
+ useSSL = new BooleanArgument("useSSL", 'Z', "useSSL",
+ MSGID_DESCRIPTION_USE_SSL);
+ argParser.addArgument(useSSL);
+
+ startTLS = new BooleanArgument("startTLS", 'q', "startTLS",
+ MSGID_DESCRIPTION_START_TLS);
+ argParser.addArgument(startTLS);
+
+ bindDN = new StringArgument("bindDN", 'D', "bindDN", false, false, true,
+ "{bindDN}", null, null,
+ MSGID_DESCRIPTION_BINDDN);
+ argParser.addArgument(bindDN);
+
+ bindPassword = new StringArgument("bindPassword", 'w', "bindPassword",
+ false, false, true, "{bindPassword}",
+ null, null,
+ MSGID_DESCRIPTION_BINDPASSWORD);
+ argParser.addArgument(bindPassword);
+
+ bindPasswordFile =
+ new FileBasedArgument("bindPasswordFile", 'j', "bindPasswordFile",
+ false, false, "{bindPasswordFilename}", null,
+ null, MSGID_DESCRIPTION_BINDPASSWORDFILE);
+ argParser.addArgument(bindPasswordFile);
+
+ baseDN = new StringArgument("baseDN", 'b', "baseDN", true, false, true,
+ "{baseDN}", null, null,
+ MSGID_SEARCH_DESCRIPTION_BASEDN);
+ argParser.addArgument(baseDN);
+
+ searchScope = new StringArgument("searchScope", 's', "searchScope", false,
+ false, true, "{searchScope}", null, null,
+ MSGID_SEARCH_DESCRIPTION_SEARCH_SCOPE);
+ argParser.addArgument(searchScope);
+
+ filename = new StringArgument("filename", 'f', "filename", false, false,
+ true, "{filename}", null, null,
+ MSGID_SEARCH_DESCRIPTION_FILENAME);
+ argParser.addArgument(filename);
+
+ saslExternal = new BooleanArgument("useSASLExternal", 'r',
+ "useSASLExternal",
+ MSGID_DESCRIPTION_USE_SASL_EXTERNAL);
+ argParser.addArgument(saslExternal);
+
+ saslOptions = new StringArgument("saslOptions", 'o', "saslOptions", false,
+ true, true, "{name=value}", null, null,
+ MSGID_DESCRIPTION_SASL_PROPERTIES);
+ argParser.addArgument(saslOptions);
+
trustAll = new BooleanArgument("trustAll", 'X', "trustAll",
MSGID_DESCRIPTION_TRUSTALL);
argParser.addArgument(trustAll);
- baseDN = new StringArgument("baseDN", 'b', "baseDN", true, false,
- true, "{baseDN}", null, null,
- MSGID_SEARCH_DESCRIPTION_BASEDN);
- argParser.addArgument(baseDN);
- bindDN = new StringArgument("bindDN", 'D', "bindDN", false, false,
- true, "{bindDN}", null, null,
- MSGID_DESCRIPTION_BINDDN);
- argParser.addArgument(bindDN);
- bindPassword = new StringArgument("bindPassword", 'w', "bindPassword",
- false, false,
- true, "{bindPassword}", null, null,
- MSGID_DESCRIPTION_BINDPASSWORD);
- argParser.addArgument(bindPassword);
- bindPasswordFile = new FileBasedArgument("bindPasswordFile", 'j',
- "bindPasswordFile", false, false,
- "{bindPasswordFilename}", null, null,
- MSGID_DESCRIPTION_BINDPASSWORDFILE);
- argParser.addArgument(bindPasswordFile);
- proxyAuthzID = new StringArgument("proxy_authzid", 'Y', "proxyAs", false,
- false, true, "{authzID}", null, null,
- MSGID_DESCRIPTION_PROXY_AUTHZID);
- argParser.addArgument(proxyAuthzID);
- reportAuthzID = new BooleanArgument("reportauthzid", 'E',
- "reportAuthzID",
- MSGID_DESCRIPTION_REPORT_AUTHZID);
- argParser.addArgument(reportAuthzID);
- usePasswordPolicyControl = new BooleanArgument("usepwpolicycontrol", null,
- "usePasswordPolicyControl",
- MSGID_DESCRIPTION_USE_PWP_CONTROL);
- argParser.addArgument(usePasswordPolicyControl);
- encodingStr = new StringArgument("encoding", 'i', "encoding",
- false, false,
- true, "{encoding}", null, null,
- MSGID_DESCRIPTION_ENCODING);
- argParser.addArgument(encodingStr);
+
keyStorePath = new StringArgument("keyStorePath", 'K',
"keyStorePath", false, false, true,
"{keyStorePath}", null, null,
MSGID_DESCRIPTION_KEYSTOREPATH);
argParser.addArgument(keyStorePath);
- trustStorePath = new StringArgument("trustStorePath", 'P',
- "trustStorePath", false, false, true,
- "{trustStorePath}", null, null,
- MSGID_DESCRIPTION_TRUSTSTOREPATH);
- argParser.addArgument(trustStorePath);
+
keyStorePassword = new StringArgument("keyStorePassword", 'W',
"keyStorePassword", false, false,
true, "{keyStorePassword}", null, null,
MSGID_DESCRIPTION_KEYSTOREPASSWORD);
argParser.addArgument(keyStorePassword);
- hostName = new StringArgument("host", 'h', "host",
- false, false,
- true, "{host}", "localhost", null,
- MSGID_DESCRIPTION_HOST);
- argParser.addArgument(hostName);
- port = new IntegerArgument("port", 'p', "port",
- false, false, true, "{port}", 389, null,
- MSGID_DESCRIPTION_PORT);
- argParser.addArgument(port);
- version = new IntegerArgument("version", 'V', "version",
- false, false, true, "{version}", 3, null,
- MSGID_DESCRIPTION_VERSION);
- argParser.addArgument(version);
- filename = new StringArgument("filename", 'f',
- "filename", false, false, true,
- "{filename}", null, null,
- MSGID_SEARCH_DESCRIPTION_FILENAME);
- argParser.addArgument(filename);
- showUsage = new BooleanArgument("showUsage", 'H', "help",
- MSGID_DESCRIPTION_SHOWUSAGE);
- argParser.addArgument(showUsage);
- argParser.setUsageArgument(showUsage, out);
- controlStr = new StringArgument("controls", 'J', "controls", false,
- false, true,
- "{controloid[:criticality[:value|::b64value|:<fileurl]]}",
- null, null, MSGID_DESCRIPTION_CONTROLS);
- argParser.addArgument(controlStr);
- verbose = new BooleanArgument("verbose", 'v', "verbose",
- MSGID_DESCRIPTION_VERBOSE);
- argParser.addArgument(verbose);
- continueOnError = new BooleanArgument("continueOnError", 'c',
- "continueOnError",
- MSGID_DESCRIPTION_CONTINUE_ON_ERROR);
- argParser.addArgument(continueOnError);
- useSSL = new BooleanArgument("useSSL", 'Z',
- "useSSL",
- MSGID_DESCRIPTION_USE_SSL);
- argParser.addArgument(useSSL);
- startTLS = new BooleanArgument("startTLS", 'q',
- "startTLS",
- MSGID_DESCRIPTION_START_TLS);
- argParser.addArgument(startTLS);
- saslExternal = new BooleanArgument("useSASLExternal", 'r',
- "useSASLExternal",
- MSGID_DESCRIPTION_USE_SASL_EXTERNAL);
- argParser.addArgument(saslExternal);
- sizeLimit = new IntegerArgument("sizeLimit", 'z', "sizeLimit",
- false, false, true, "{sizeLimit}", 0, null,
- MSGID_SEARCH_DESCRIPTION_SIZE_LIMIT);
- argParser.addArgument(sizeLimit);
- timeLimit = new IntegerArgument("timeLimit", 'l', "timeLimit",
- false, false, true, "{timeLimit}", 0, null,
- MSGID_SEARCH_DESCRIPTION_TIME_LIMIT);
- argParser.addArgument(timeLimit);
- searchScope = new StringArgument("searchScope", 's',
- "searchScope", false, false, true,
- "{searchScope}", null, null,
- MSGID_SEARCH_DESCRIPTION_SEARCH_SCOPE);
- argParser.addArgument(searchScope);
- dereferencePolicy = new StringArgument("dereferencePolicy", 'a',
- "dereferencePolicy", false, false, true,
- "{dereferencePolicy}", null, null,
- MSGID_SEARCH_DESCRIPTION_DEREFERENCE_POLICY);
- argParser.addArgument(dereferencePolicy);
- saslOptions = new StringArgument("saslOptions", 'o', "saslOptions", false,
- true, true, "{name=value}", null, null,
- MSGID_DESCRIPTION_SASL_PROPERTIES);
- argParser.addArgument(saslOptions);
+
+ keyStorePasswordFile =
+ new FileBasedArgument("keystorepasswordfile", null,
+ "keyStorePasswordFile", false, false, "{path}",
+ null, null,
+ MSGID_DESCRIPTION_KEYSTOREPASSWORD_FILE);
+ argParser.addArgument(keyStorePasswordFile);
+
+ trustStorePath = new StringArgument("trustStorePath", 'P',
+ "trustStorePath", false, false, true,
+ "{trustStorePath}", null, null,
+ MSGID_DESCRIPTION_TRUSTSTOREPATH);
+ argParser.addArgument(trustStorePath);
+
+ trustStorePassword =
+ new StringArgument("trustStorePassword", null, "trustStorePassword",
+ false, false, true, "{trustStorePassword}", null,
+ null, MSGID_DESCRIPTION_TRUSTSTOREPASSWORD);
+ argParser.addArgument(trustStorePassword);
+
+ trustStorePasswordFile =
+ new FileBasedArgument("truststorepasswordfile", null,
+ "trustStorePasswordFile", false, false,
+ "{path}", null, null,
+ MSGID_DESCRIPTION_TRUSTSTOREPASSWORD_FILE);
+ argParser.addArgument(trustStorePasswordFile);
+
+ proxyAuthzID = new StringArgument("proxy_authzid", 'Y', "proxyAs", false,
+ false, true, "{authzID}", null, null,
+ MSGID_DESCRIPTION_PROXY_AUTHZID);
+ argParser.addArgument(proxyAuthzID);
+
+ reportAuthzID = new BooleanArgument("reportauthzid", 'E', "reportAuthzID",
+ MSGID_DESCRIPTION_REPORT_AUTHZID);
+ argParser.addArgument(reportAuthzID);
+
+ usePasswordPolicyControl = new BooleanArgument("usepwpolicycontrol", null,
+ "usePasswordPolicyControl",
+ MSGID_DESCRIPTION_USE_PWP_CONTROL);
+ argParser.addArgument(usePasswordPolicyControl);
+
pSearchInfo = new StringArgument("psearchinfo", 'C', "persistentSearch",
false, false, true,
"ps[:changetype[:changesonly[:entrychgcontrols]]]",
null, null, MSGID_DESCRIPTION_PSEARCH_INFO);
argParser.addArgument(pSearchInfo);
- dontWrap = new BooleanArgument("dontwrap", 'T', "dontWrap",
- MSGID_DESCRIPTION_DONT_WRAP);
- argParser.addArgument(dontWrap);
- noop = new BooleanArgument("no-op", 'n', "noop", MSGID_DESCRIPTION_NOOP);
- argParser.addArgument(noop);
- typesOnly = new BooleanArgument("typesOnly", 'A', "typesOnly",
- MSGID_DESCRIPTION_TYPES_ONLY);
- argParser.addArgument(typesOnly);
+
assertionFilter = new StringArgument("assertionfilter", null,
- "assertionFilter", false, false, true,
- "{filter}", null, null,
- MSGID_DESCRIPTION_SEARCH_ASSERTION_FILTER);
+ "assertionFilter", false, false,
+ true, "{filter}", null, null,
+ MSGID_DESCRIPTION_ASSERTION_FILTER);
argParser.addArgument(assertionFilter);
+
matchedValuesFilter = new StringArgument("matchedvalues", null,
"matchedValuesFilter", false, true, true,
"{filter}", null, null,
MSGID_DESCRIPTION_MATCHED_VALUES_FILTER);
argParser.addArgument(matchedValuesFilter);
+
+ controlStr =
+ new StringArgument("controls", 'J', "controls", false, false, true,
+ "{controloid[:criticality[:value|::b64value|:<fileurl]]}",
+ null, null, MSGID_DESCRIPTION_CONTROLS);
+ argParser.addArgument(controlStr);
+
+ version = new IntegerArgument("version", 'V', "version", false, false,
+ true, "{version}", 3, null,
+ MSGID_DESCRIPTION_VERSION);
+ argParser.addArgument(version);
+
+ encodingStr = new StringArgument("encoding", 'i', "encoding", false,
+ false, true, "{encoding}", null, null,
+ MSGID_DESCRIPTION_ENCODING);
+ argParser.addArgument(encodingStr);
+
+ dereferencePolicy =
+ new StringArgument("derefpolicy", 'a', "dereferencePolicy", false,
+ false, true, "{dereferencePolicy}", null, null,
+ MSGID_SEARCH_DESCRIPTION_DEREFERENCE_POLICY);
+ argParser.addArgument(dereferencePolicy);
+
+ typesOnly = new BooleanArgument("typesOnly", 'A', "typesOnly",
+ MSGID_DESCRIPTION_TYPES_ONLY);
+ argParser.addArgument(typesOnly);
+
+ sizeLimit = new IntegerArgument("sizeLimit", 'z', "sizeLimit", false,
+ false, true, "{sizeLimit}", 0, null,
+ MSGID_SEARCH_DESCRIPTION_SIZE_LIMIT);
+ argParser.addArgument(sizeLimit);
+
+ timeLimit = new IntegerArgument("timeLimit", 'l', "timeLimit", false,
+ false, true, "{timeLimit}", 0, null,
+ MSGID_SEARCH_DESCRIPTION_TIME_LIMIT);
+ argParser.addArgument(timeLimit);
+
+ dontWrap = new BooleanArgument("dontwrap", 'T', "dontWrap",
+ MSGID_DESCRIPTION_DONT_WRAP);
+ argParser.addArgument(dontWrap);
+
+ continueOnError =
+ new BooleanArgument("continueOnError", 'c', "continueOnError",
+ MSGID_DESCRIPTION_CONTINUE_ON_ERROR);
+ argParser.addArgument(continueOnError);
+
+ noop = new BooleanArgument("noop", 'n', "noop", MSGID_DESCRIPTION_NOOP);
+ argParser.addArgument(noop);
+
+ verbose = new BooleanArgument("verbose", 'v', "verbose",
+ MSGID_DESCRIPTION_VERBOSE);
+ argParser.addArgument(verbose);
+
+ showUsage = new BooleanArgument("showUsage", 'H', "help",
+ MSGID_DESCRIPTION_SHOWUSAGE);
+ argParser.addArgument(showUsage);
+ argParser.setUsageArgument(showUsage, out);
} catch (ArgumentException ae)
{
int msgID = MSGID_ENCPW_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -718,7 +776,7 @@
int msgID = MSGID_ENCPW_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
err.println(argParser.getUsage());
return 1;
}
@@ -740,7 +798,7 @@
} catch(LDAPException le)
{
assert debugException(CLASS_NAME, "main", le);
- err.println(le.getMessage());
+ err.println(wrapText(le.getMessage(), MAX_LINE_WIDTH));
return 1;
}
// The rest are attributes
@@ -753,8 +811,37 @@
if(bindPassword.isPresent() && bindPasswordFile.isPresent())
{
- err.println("ERROR: Both -w and -j flags specified. " +
- "Please specify one.");
+ int msgID = MSGID_TOOL_CONFLICTING_ARGS;
+ String message = getMessage(msgID, bindPassword.getLongIdentifier(),
+ bindPasswordFile.getLongIdentifier());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
+ return 1;
+ }
+
+ if (useSSL.isPresent() && startTLS.isPresent())
+ {
+ int msgID = MSGID_TOOL_CONFLICTING_ARGS;
+ String message = getMessage(msgID, useSSL.getLongIdentifier(),
+ startTLS.getLongIdentifier());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
+ return 1;
+ }
+
+ if (keyStorePassword.isPresent() && keyStorePasswordFile.isPresent())
+ {
+ int msgID = MSGID_TOOL_CONFLICTING_ARGS;
+ String message = getMessage(msgID, keyStorePassword.getLongIdentifier(),
+ keyStorePasswordFile.getLongIdentifier());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
+ return 1;
+ }
+
+ if (trustStorePassword.isPresent() && trustStorePasswordFile.isPresent())
+ {
+ int msgID = MSGID_TOOL_CONFLICTING_ARGS;
+ String message = getMessage(msgID, trustStorePassword.getLongIdentifier(),
+ trustStorePasswordFile.getLongIdentifier());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -766,7 +853,7 @@
} catch(ArgumentException ae)
{
assert debugException(CLASS_NAME, "main", ae);
- err.println(ae.getMessage());
+ err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return 1;
}
@@ -777,14 +864,14 @@
if(versionNumber != 2 && versionNumber != 3)
{
int msgID = MSGID_DESCRIPTION_INVALID_VERSION;
- err.println(getMessage(msgID, versionNumber));
+ err.println(wrapText(getMessage(msgID, versionNumber), MAX_LINE_WIDTH));
return 1;
}
connectionOptions.setVersionNumber(versionNumber);
} catch(ArgumentException ae)
{
assert debugException(CLASS_NAME, "main", ae);
- err.println(ae.getMessage());
+ err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return 1;
}
@@ -811,7 +898,7 @@
} catch(Exception ex)
{
assert debugException(CLASS_NAME, "main", ex);
- err.println(ex.getMessage());
+ err.println(wrapText(ex.getMessage(), MAX_LINE_WIDTH));
return 1;
}
} else if(bindPasswordValue == null)
@@ -821,9 +908,27 @@
}
String keyStorePathValue = keyStorePath.getValue();
- String keyStorePasswordValue = keyStorePassword.getValue();
String trustStorePathValue = trustStorePath.getValue();
+
+ String keyStorePasswordValue = null;
+ if (keyStorePassword.isPresent())
+ {
+ keyStorePasswordValue = keyStorePassword.getValue();
+ }
+ else if (keyStorePasswordFile.isPresent())
+ {
+ keyStorePasswordValue = keyStorePasswordFile.getValue();
+ }
+
String trustStorePasswordValue = null;
+ if (trustStorePassword.isPresent())
+ {
+ trustStorePasswordValue = trustStorePassword.getValue();
+ }
+ else if (trustStorePasswordFile.isPresent())
+ {
+ trustStorePasswordValue = trustStorePasswordFile.getValue();
+ }
searchOptions.setTypesOnly(typesOnly.isPresent());
searchOptions.setShowOperations(noop.isPresent());
@@ -836,7 +941,7 @@
searchOptions.setSizeLimit(sizeLimit.getIntValue());
} catch(ArgumentException ex1)
{
- err.println(ex1.getMessage());
+ err.println(wrapText(ex1.getMessage(), MAX_LINE_WIDTH));
return 1;
}
boolean val = searchOptions.setSearchScope(searchScope.getValue(), err);
@@ -856,7 +961,9 @@
LDAPControl ctrl = LDAPToolUtils.getControl(ctrlString, err);
if(ctrl == null)
{
- err.println("Invalid control specified:" + ctrlString);
+ int msgID = MSGID_TOOL_INVALID_CONTROL_STRING;
+ String message = getMessage(msgID, ctrlString);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
err.println(argParser.getUsage());
return 1;
}
@@ -886,7 +993,7 @@
{
int msgID = MSGID_PSEARCH_MISSING_DESCRIPTOR;
String message = getMessage(msgID);
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
else
@@ -896,7 +1003,7 @@
{
int msgID = MSGID_PSEARCH_DOESNT_START_WITH_PS;
String message = getMessage(msgID, String.valueOf(infoString));
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -935,7 +1042,7 @@
{
int msgID = MSGID_PSEARCH_INVALID_CHANGE_TYPE;
String message = getMessage(msgID, String.valueOf(token));
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -965,7 +1072,7 @@
{
int msgID = MSGID_PSEARCH_INVALID_CHANGESONLY;
String message = getMessage(msgID, String.valueOf(token));
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -986,7 +1093,7 @@
{
int msgID = MSGID_PSEARCH_INVALID_RETURN_ECS;
String message = getMessage(msgID, String.valueOf(token));
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -1013,8 +1120,9 @@
}
catch (LDAPException le)
{
- err.println(getMessage(MSGID_LDAP_ASSERTION_INVALID_FILTER,
- le.getMessage()));
+ int msgID = MSGID_LDAP_ASSERTION_INVALID_FILTER;
+ String message = getMessage(msgID, le.getMessage());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -1033,8 +1141,9 @@
}
catch (LDAPException le)
{
- err.println(getMessage(MSGID_LDAP_MATCHEDVALUES_INVALID_FILTER,
- le.getMessage()));
+ int msgID = MSGID_LDAP_MATCHEDVALUES_INVALID_FILTER;
+ String message = getMessage(msgID, le.getMessage());
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -1074,14 +1183,16 @@
{
if(!connectionOptions.useSSL() && !connectionOptions.useStartTLS())
{
- err.println("SASL External requires either SSL or StartTLS " +
- "options to be requested.");
+ int msgID = MSGID_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS;
+ String message = getMessage(msgID);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
if(keyStorePathValue == null)
{
- err.println("SASL External requires a path to the SSL " +
- "client certificate keystore.");
+ int msgID = MSGID_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE;
+ String message = getMessage(msgID);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
@@ -1108,7 +1219,7 @@
} catch(Exception e)
{
assert debugException(CLASS_NAME, "main", e);
- err.println(e.getMessage());
+ err.println(wrapText(e.getMessage(), MAX_LINE_WIDTH));
return 1;
}
finally
@@ -1127,7 +1238,7 @@
if(filters.isEmpty())
{
int msgid = MSGID_SEARCH_NO_FILTERS;
- err.println(getMessage(msgid));
+ err.println(wrapText(getMessage(msgid), MAX_LINE_WIDTH));
err.println(argParser.getUsage());
return 1;
}
@@ -1169,19 +1280,19 @@
} catch(LDAPException le)
{
assert debugException(CLASS_NAME, "main", le);
- err.println(le.getMessage());
+ err.println(wrapText(le.getMessage(), MAX_LINE_WIDTH));
int code = le.getResultCode();
return code;
} catch(LDAPConnectionException lce)
{
assert debugException(CLASS_NAME, "main", lce);
- err.println(lce.getMessage());
+ err.println(wrapText(lce.getMessage(), MAX_LINE_WIDTH));
int code = lce.getErrorCode();
return code;
} catch(Exception e)
{
assert debugException(CLASS_NAME, "main", e);
- err.println(e.getMessage());
+ err.println(wrapText(e.getMessage(), MAX_LINE_WIDTH));
return 1;
} finally
{
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFDiff.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFDiff.java
index 838b048..25562f8 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFDiff.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFDiff.java
@@ -133,7 +133,9 @@
StringArgument targetLDIF;
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false);
+ String toolDescription = getMessage(MSGID_LDIFDIFF_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false);
try
{
sourceLDIF = new StringArgument("sourceldif", 's', "sourceLDIF", true,
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFModify.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFModify.java
index 1539f0c..979adca 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFModify.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFModify.java
@@ -422,7 +422,9 @@
StringArgument sourceFile;
StringArgument targetFile;
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false);
+ String toolDescription = getMessage(MSGID_LDIFMODIFY_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false);
try
{
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFSearch.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFSearch.java
index f5efca8..dae5818 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFSearch.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDIFSearch.java
@@ -157,7 +157,9 @@
StringArgument outputFile;
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false, true, 0, 0,
+ String toolDescription = getMessage(MSGID_LDIFSEARCH_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false, true, 0, 0,
"[filter] [attributes ...]");
try
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/RestoreDB.java b/opendj-sdk/opends/src/server/org/opends/server/tools/RestoreDB.java
index fa56369..befdf5a 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/RestoreDB.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/RestoreDB.java
@@ -112,8 +112,10 @@
// Create the command-line argument parser for use with this program.
+ String toolDescription = getMessage(MSGID_RESTOREDB_TOOL_DESCRIPTION);
ArgumentParser argParser =
- new ArgumentParser("org.opends.server.tools.RestoreDB", false);
+ new ArgumentParser("org.opends.server.tools.RestoreDB",
+ toolDescription, false);
// Initialize all the command-line argument types and register them with the
@@ -172,7 +174,7 @@
int msgID = MSGID_RESTOREDB_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -187,7 +189,7 @@
int msgID = MSGID_RESTOREDB_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.err.println(argParser.getUsage());
return 1;
}
@@ -213,7 +215,7 @@
{
int msgID = MSGID_RESTOREDB_SERVER_BOOTSTRAP_ERROR;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -226,14 +228,14 @@
{
int msgID = MSGID_RESTOREDB_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_RESTOREDB_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -248,21 +250,21 @@
{
int msgID = MSGID_RESTOREDB_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_RESTOREDB_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_RESTOREDB_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -277,21 +279,21 @@
{
int msgID = MSGID_RESTOREDB_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_RESTOREDB_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_RESTOREDB_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
@@ -305,21 +307,21 @@
{
int msgID = MSGID_RESTOREDB_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (InitializationException ie)
{
int msgID = MSGID_RESTOREDB_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
catch (Exception e)
{
int msgID = MSGID_RESTOREDB_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/StopDS.java b/opendj-sdk/opends/src/server/org/opends/server/tools/StopDS.java
index b73890d..7b92c0e 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/StopDS.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/StopDS.java
@@ -68,6 +68,7 @@
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.ToolMessages.*;
import static org.opends.server.util.ServerConstants.*;
+import static org.opends.server.util.StaticUtils.*;
@@ -159,7 +160,9 @@
// Define all the arguments that may be used with this program.
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false);
+ String toolDescription = getMessage(MSGID_STOPDS_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME,
+ toolDescription, false);
BooleanArgument restart;
BooleanArgument showUsage;
BooleanArgument trustAll;
@@ -293,7 +296,7 @@
int msgID = MSGID_STOPDS_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
@@ -308,7 +311,7 @@
int msgID = MSGID_STOPDS_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
err.println(argParser.getUsage());
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
@@ -329,7 +332,7 @@
int msgID = MSGID_STOPDS_MUTUALLY_EXCLUSIVE_ARGUMENTS;
String message = getMessage(msgID, bindPW.getLongIdentifier(),
bindPWFile.getLongIdentifier());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
@@ -341,7 +344,7 @@
int msgID = MSGID_STOPDS_MUTUALLY_EXCLUSIVE_ARGUMENTS;
String message = getMessage(msgID, keyStorePW.getLongIdentifier(),
keyStorePWFile.getLongIdentifier());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
@@ -353,7 +356,7 @@
int msgID = MSGID_STOPDS_MUTUALLY_EXCLUSIVE_ARGUMENTS;
String message = getMessage(msgID, trustStorePW.getLongIdentifier(),
trustStorePWFile.getLongIdentifier());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
@@ -378,7 +381,7 @@
{
int msgID = MSGID_STOPDS_CANNOT_DECODE_STOP_TIME;
String message = getMessage(msgID);
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
}
@@ -396,7 +399,7 @@
{
int msgID = MSGID_STOPDS_CANNOT_DECODE_STOP_TIME;
String message = getMessage(msgID);
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
}
@@ -419,7 +422,7 @@
int msgID = MSGID_STOPDS_MUTUALLY_EXCLUSIVE_ARGUMENTS;
String message = getMessage(msgID, useSSL.getLongIdentifier(),
useStartTLS.getLongIdentifier());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
else
@@ -451,7 +454,7 @@
{
int msgID = MSGID_STOPDS_CANNOT_INITIALIZE_SSL;
String message = getMessage(msgID, sce.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_LOCAL_ERROR;
}
}
@@ -471,7 +474,7 @@
{
int msgID = MSGID_STOPDS_CANNOT_PARSE_SASL_OPTION;
String message = getMessage(msgID, s);
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
else
@@ -494,7 +497,7 @@
{
int msgID = MSGID_STOPDS_NO_SASL_MECHANISM;
String message = getMessage(msgID);
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
@@ -522,14 +525,14 @@
int msgID = MSGID_STOPDS_CANNOT_DETERMINE_PORT;
String message = getMessage(msgID, port.getLongIdentifier(),
ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_PARAM_ERROR;
}
catch (LDAPConnectionException lce)
{
int msgID = MSGID_STOPDS_CANNOT_CONNECT;
String message = getMessage(msgID, lce.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_CONNECT_ERROR;
}
@@ -613,7 +616,7 @@
{
int msgID = MSGID_STOPDS_UNEXPECTED_CONNECTION_CLOSURE;
String message = getMessage(msgID);
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_SERVER_DOWN;
}
@@ -623,21 +626,21 @@
{
int msgID = MSGID_STOPDS_IO_ERROR;
String message = getMessage(msgID, String.valueOf(ioe));
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_SERVER_DOWN;
}
catch (ASN1Exception ae)
{
int msgID = MSGID_STOPDS_DECODE_ERROR;
String message = getMessage(msgID, ae.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_DECODING_ERROR;
}
catch (LDAPException le)
{
int msgID = MSGID_STOPDS_DECODE_ERROR;
String message = getMessage(msgID, le.getMessage());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_DECODING_ERROR;
}
@@ -659,7 +662,7 @@
String message = extendedResponse.getErrorMessage();
if (message != null)
{
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
}
return extendedResponse.getResultCode();
@@ -669,7 +672,7 @@
int msgID = MSGID_STOPDS_INVALID_RESPONSE_TYPE;
String message = getMessage(msgID, responseMessage.getProtocolOpName());
- err.println(message);
+ err.println(wrapText(message, MAX_LINE_WIDTH));
return LDAPResultCode.CLIENT_SIDE_LOCAL_ERROR;
}
@@ -679,7 +682,7 @@
String errorMessage = addResponse.getErrorMessage();
if (errorMessage != null)
{
- err.println(errorMessage);
+ err.println(wrapText(errorMessage, MAX_LINE_WIDTH));
}
return addResponse.getResultCode();
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/VerifyIndex.java b/opendj-sdk/opends/src/server/org/opends/server/tools/VerifyIndex.java
index 1a07704..ae89764 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/VerifyIndex.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/VerifyIndex.java
@@ -54,11 +54,12 @@
import java.util.List;
import static org.opends.server.messages.ToolMessages.*;
-import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.loggers.Error.*;
import static org.opends.server.messages.ConfigMessages.*;
import static org.opends.server.messages.MessageHandler.*;
+import static org.opends.server.util.ServerConstants.*;
+import static org.opends.server.util.StaticUtils.*;
@@ -87,8 +88,10 @@
// Create the command-line argument parser for use with this program.
+ String toolDescription = getMessage(MSGID_VERIFYINDEX_TOOL_DESCRIPTION);
ArgumentParser argParser =
- new ArgumentParser("org.opends.server.tools.VerifyIndex", false);
+ new ArgumentParser("org.opends.server.tools.VerifyIndex",
+ toolDescription, false);
// Initialize all the command-line argument types and register them with the
@@ -143,7 +146,7 @@
int msgID = MSGID_VERIFYINDEX_CANNOT_INITIALIZE_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -158,7 +161,7 @@
int msgID = MSGID_VERIFYINDEX_ERROR_PARSING_ARGS;
String message = getMessage(msgID, ae.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.err.println(argParser.getUsage());
System.exit(1);
}
@@ -187,7 +190,7 @@
int msgID = MSGID_VERIFYINDEX_VERIFY_CLEAN_REQUIRES_SINGLE_INDEX;
String message = getMessage(msgID);
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.out.println(argParser.getUsage());
System.exit(1);
}
@@ -205,7 +208,7 @@
{
int msgID = MSGID_VERIFYINDEX_SERVER_BOOTSTRAP_ERROR;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -218,14 +221,14 @@
{
int msgID = MSGID_VERIFYINDEX_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (Exception e)
{
int msgID = MSGID_VERIFYINDEX_CANNOT_LOAD_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -240,21 +243,21 @@
{
int msgID = MSGID_VERIFYINDEX_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (InitializationException ie)
{
int msgID = MSGID_VERIFYINDEX_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (Exception e)
{
int msgID = MSGID_VERIFYINDEX_CANNOT_LOAD_SCHEMA;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -269,21 +272,21 @@
{
int msgID = MSGID_VERIFYINDEX_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (InitializationException ie)
{
int msgID = MSGID_VERIFYINDEX_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (Exception e)
{
int msgID = MSGID_VERIFYINDEX_CANNOT_INITIALIZE_CORE_CONFIG;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
@@ -297,21 +300,21 @@
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, ce.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (InitializationException ie)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, ie.getMessage());
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
catch (Exception e)
{
int msgID = MSGID_LDIFIMPORT_CANNOT_INITIALIZE_CRYPTO_MANAGER;
String message = getMessage(msgID, stackTraceToSingleLineString(e));
- System.err.println(message);
+ System.err.println(wrapText(message, MAX_LINE_WIDTH));
System.exit(1);
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/WaitForFileDelete.java b/opendj-sdk/opends/src/server/org/opends/server/tools/WaitForFileDelete.java
index c3760a0..09ed4b6 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/WaitForFileDelete.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/WaitForFileDelete.java
@@ -39,6 +39,7 @@
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.ToolMessages.*;
+import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -83,13 +84,6 @@
/**
- * The position at which to wrap long lines.
- */
- public static final int MAX_LINE_WIDTH = 79;
-
-
-
- /**
* Processes the command-line arguments and initiates the process of waiting
* for the file to be removed.
*
@@ -131,7 +125,9 @@
StringArgument logFilePath = null;
StringArgument targetFilePath = null;
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false);
+ String toolDescription = getMessage(MSGID_WAIT4DEL_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false);
try
{
diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/MakeLDIF.java b/opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/MakeLDIF.java
index 3d57c01..1676b44 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/MakeLDIF.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/MakeLDIF.java
@@ -46,6 +46,7 @@
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.ToolMessages.*;
+import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -65,13 +66,6 @@
- /**
- * The position at which to wrap long lines of console output.
- */
- public static final int MAX_LINE_WIDTH = 79;
-
-
-
// The LDIF writer that will be used to write the entries.
private LDIFWriter ldifWriter;
@@ -122,7 +116,9 @@
public int makeLDIFMain(String[] args)
{
// Create and initialize the argument parser for this program.
- ArgumentParser argParser = new ArgumentParser(CLASS_NAME, false);
+ String toolDescription = getMessage(MSGID_MAKELDIF_TOOL_DESCRIPTION);
+ ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
+ false);
BooleanArgument showUsage;
IntegerArgument randomSeed;
StringArgument configClass;
diff --git a/opendj-sdk/opends/src/server/org/opends/server/util/ServerConstants.java b/opendj-sdk/opends/src/server/org/opends/server/util/ServerConstants.java
index b456776..4190996 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/util/ServerConstants.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/util/ServerConstants.java
@@ -2019,10 +2019,25 @@
/**
+ * The name of a command-line script used to launch an administrative tool.
+ */
+ public static final String PROPERTY_SCRIPT_NAME =
+ "org.opends.server.scriptName";
+
+
+
+ /**
* The name of the system property that can be used to specify the path to the
* server root.
*/
public static final String PROPERTY_SERVER_ROOT =
"org.opends.server.ServerRoot";
+
+
+
+ /**
+ * The column at which to wrap long lines of output in the command-line tools.
+ */
+ public static final int MAX_LINE_WIDTH = 79;
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/util/args/ArgumentParser.java b/opendj-sdk/opends/src/server/org/opends/server/util/args/ArgumentParser.java
index b2b8413..8a2d12b 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/util/args/ArgumentParser.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/util/args/ArgumentParser.java
@@ -94,6 +94,10 @@
// the program with which this argument parser is associated.
private String mainClassName;
+ // A human-readable description for the tool, which will be included when
+ // displaying usage information.
+ private String toolDescription;
+
// The display name that will be used for the trailing arguments in the usage
// information.
private String trailingArgsDisplayName;
@@ -111,13 +115,17 @@
* class that should be invoked to launch
* the program with which this argument
* parser is associated.
+ * @param toolDescription A human-readable description for the
+ * tool, which will be included when
+ * displaying usage information.
* @param longArgumentsCaseSensitive Indicates whether long arguments should
* be treated in a case-sensitive manner.
*/
- public ArgumentParser(String mainClassName,
+ public ArgumentParser(String mainClassName, String toolDescription,
boolean longArgumentsCaseSensitive)
{
this.mainClassName = mainClassName;
+ this.toolDescription = toolDescription;
this.longArgumentsCaseSensitive = longArgumentsCaseSensitive;
argumentList = new LinkedList<Argument>();
@@ -144,6 +152,9 @@
* class that should be invoked to launch
* the program with which this argument
* parser is associated.
+ * @param toolDescription A human-readable description for the
+ * tool, which will be included when
+ * displaying usage information.
* @param longArgumentsCaseSensitive Indicates whether long arguments should
* be treated in a case-sensitive manner.
* @param allowsTrailingArguments Indicates whether this parser allows
@@ -164,13 +175,14 @@
* arguments in the generated usage
* information.
*/
- public ArgumentParser(String mainClassName,
+ public ArgumentParser(String mainClassName, String toolDescription,
boolean longArgumentsCaseSensitive,
boolean allowsTrailingArguments,
int minTrailingArguments, int maxTrailingArguments,
String trailingArgsDisplayName)
{
this.mainClassName = mainClassName;
+ this.toolDescription = toolDescription;
this.longArgumentsCaseSensitive = longArgumentsCaseSensitive;
this.allowsTrailingArguments = allowsTrailingArguments;
this.minTrailingArguments = minTrailingArguments;
@@ -205,6 +217,20 @@
/**
+ * Retrieves a human-readable description for this tool, which should be
+ * included at the top of the command-line usage information.
+ *
+ * @return A human-readable description for this tool, or {@code null} if
+ * none is available.
+ */
+ public String getToolDescription()
+ {
+ return toolDescription;
+ }
+
+
+
+ /**
* Indicates whether this parser will allow unnamed trailing arguments. These
* will be arguments at the end of the list that are not preceded by either a
* long or short identifier and will need to be manually parsed by the
@@ -912,8 +938,24 @@
*/
public void getUsage(StringBuilder buffer)
{
- buffer.append("Usage: java ");
- buffer.append(mainClassName);
+ if ((toolDescription != null) && (toolDescription.length() > 0))
+ {
+ buffer.append(wrapText(toolDescription, 79));
+ buffer.append(EOL);
+ }
+
+ String scriptName = System.getProperty(PROPERTY_SCRIPT_NAME);
+ if ((scriptName == null) || (scriptName.length() == 0))
+ {
+ buffer.append("Usage: java ");
+ buffer.append(mainClassName);
+ }
+ else
+ {
+ buffer.append("Usage: ");
+ buffer.append(scriptName);
+ }
+
buffer.append(" {options}");
if (allowsTrailingArguments)
@@ -1010,21 +1052,21 @@
// indent the description five characters and try our best to wrap at or
// before column 79 so it will be friendly to 80-column displays.
String description = a.getDescription();
- if (description.length() <= 74)
+ if (description.length() <= 75)
{
- buffer.append(" ");
+ buffer.append(" ");
buffer.append(description);
buffer.append(EOL);
}
else
{
String s = description;
- while (s.length() > 74)
+ while (s.length() > 75)
{
- int spacePos = s.lastIndexOf(' ', 74);
+ int spacePos = s.lastIndexOf(' ', 75);
if (spacePos > 0)
{
- buffer.append(" ");
+ buffer.append(" ");
buffer.append(s.substring(0, spacePos).trim());
s = s.substring(spacePos+1).trim();
buffer.append(EOL);
@@ -1037,14 +1079,14 @@
spacePos = s.indexOf(' ');
if (spacePos > 0)
{
- buffer.append(" ");
+ buffer.append(" ");
buffer.append(s.substring(0, spacePos).trim());
s = s.substring(spacePos+1).trim();
buffer.append(EOL);
}
else
{
- buffer.append(" ");
+ buffer.append(" ");
buffer.append(s);
s = "";
buffer.append(EOL);
@@ -1054,13 +1096,11 @@
if (s.length() > 0)
{
- buffer.append(" ");
+ buffer.append(" ");
buffer.append(s);
buffer.append(EOL);
}
}
-
- buffer.append(EOL);
}
}
diff --git a/opendj-sdk/opends/src/server/org/opends/server/util/args/SubCommandArgumentParser.java b/opendj-sdk/opends/src/server/org/opends/server/util/args/SubCommandArgumentParser.java
index c008de1..76bb8ec 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/util/args/SubCommandArgumentParser.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/util/args/SubCommandArgumentParser.java
@@ -88,6 +88,10 @@
// the program with which this argument parser is associated.
private String mainClassName;
+ // A human-readable description for the tool, which will be included when
+ // displaying usage information.
+ private String toolDescription;
+
// The raw set of command-line arguments that were provided.
private String[] rawArguments;
@@ -104,14 +108,18 @@
* class that should be invoked to launch
* the program with which this argument
* parser is associated.
+ * @param toolDescription A human-readable description for the
+ * tool, which will be included when
+ * displaying usage information.
* @param longArgumentsCaseSensitive Indicates whether subcommand and long
* argument names should be treated in a
* case-sensitive manner.
*/
- public SubCommandArgumentParser(String mainClassName,
+ public SubCommandArgumentParser(String mainClassName, String toolDescription,
boolean longArgumentsCaseSensitive)
{
this.mainClassName = mainClassName;
+ this.toolDescription = toolDescription;
this.longArgumentsCaseSensitive = longArgumentsCaseSensitive;
globalArgumentList = new LinkedList<Argument>();
@@ -143,6 +151,20 @@
/**
+ * Retrieves a human-readable description for this tool, which should be
+ * included at the top of the command-line usage information.
+ *
+ * @return A human-readable description for this tool, or {@code null} if
+ * none is available.
+ */
+ public String getToolDescription()
+ {
+ return toolDescription;
+ }
+
+
+
+ /**
* Indicates whether subcommand names and long argument strings should be
* treated in a case-sensitive manner.
*
@@ -1050,8 +1072,24 @@
*/
public void getFullUsage(StringBuilder buffer)
{
- buffer.append("Usage: java ");
- buffer.append(mainClassName);
+ if ((toolDescription != null) && (toolDescription.length() > 0))
+ {
+ buffer.append(wrapText(toolDescription, 79));
+ buffer.append(EOL);
+ }
+
+ String scriptName = System.getProperty(PROPERTY_SCRIPT_NAME);
+ if ((scriptName == null) || (scriptName.length() == 0))
+ {
+ buffer.append("Usage: java ");
+ buffer.append(mainClassName);
+ }
+ else
+ {
+ buffer.append("Usage: ");
+ buffer.append(scriptName);
+ }
+
buffer.append(" {subcommand} {options}");
buffer.append(EOL);
buffer.append(EOL);
@@ -1109,8 +1147,6 @@
buffer.append(value);
}
}
-
- buffer.append(EOL);
}
buffer.append(EOL);
@@ -1175,8 +1211,6 @@
buffer.append(EOL);
}
-
- buffer.append(EOL);
}
}
@@ -1193,8 +1227,18 @@
*/
public void getSubCommandUsage(StringBuilder buffer, SubCommand subCommand)
{
- buffer.append("Usage: java ");
- buffer.append(mainClassName);
+ String scriptName = System.getProperty(PROPERTY_SCRIPT_NAME);
+ if ((scriptName == null) || (scriptName.length() == 0))
+ {
+ buffer.append("Usage: java ");
+ buffer.append(mainClassName);
+ }
+ else
+ {
+ buffer.append("Usage: ");
+ buffer.append(scriptName);
+ }
+
buffer.append(" ");
buffer.append(subCommand.getName());
buffer.append(" {options}");
@@ -1262,21 +1306,21 @@
// indent the description five characters and try our best to wrap at or
// before column 79 so it will be friendly to 80-column displays.
String description = a.getDescription();
- if (description.length() <= 74)
+ if (description.length() <= 75)
{
- buffer.append(" ");
+ buffer.append(" ");
buffer.append(description);
buffer.append(EOL);
}
else
{
String s = description;
- while (s.length() > 74)
+ while (s.length() > 75)
{
- int spacePos = s.lastIndexOf(' ', 74);
+ int spacePos = s.lastIndexOf(' ', 75);
if (spacePos > 0)
{
- buffer.append(" ");
+ buffer.append(" ");
buffer.append(s.substring(0, spacePos).trim());
s = s.substring(spacePos+1).trim();
buffer.append(EOL);
@@ -1289,14 +1333,14 @@
spacePos = s.indexOf(' ');
if (spacePos > 0)
{
- buffer.append(" ");
+ buffer.append(" ");
buffer.append(s.substring(0, spacePos).trim());
s = s.substring(spacePos+1).trim();
buffer.append(EOL);
}
else
{
- buffer.append(" ");
+ buffer.append(" ");
buffer.append(s);
s = "";
buffer.append(EOL);
@@ -1306,7 +1350,7 @@
if (s.length() > 0)
{
- buffer.append(" ");
+ buffer.append(" ");
buffer.append(s);
buffer.append(EOL);
}
@@ -1441,8 +1485,6 @@
buffer.append(EOL);
}
}
-
- buffer.append(EOL);
}
}
--
Gitblit v1.10.0