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.
- Issue #979 -- Re-order LDAP tool arguments
When displaying usage information for many of the LDAP tools (e.g.,
ldapsearch, ldapmodify, etc.), the arguments were not provided in any kind of
logical grouping. This has been corrected so that the arguments are listed
in a more logical ordering.
- Issue #983 -- Add tool description to argument parser
When displaying usage information for administrative tools, it now includes a
small summary of what the tool does at the top of the argument list.
- Issue #984 -- Make tool usage more compact
Previously, the tool usage included a blank line between each argument, which
made the usage information seem too verbose, especially for tools like
ldapsearch with a lot of arguments. This extra space has been removed.
Also, many of the argument descriptions have been rewritten in an attempt to
avoid requiring multiple lines.
- Issue #985 -- Wrap long output in administrative tools when appropriate
Update most of the output for the administrative tools so that it is easier
to read on 80-column displays. This primarily impacts error message, and
cases in which the format of the output is important (e.g., LDIF output from
ldapsearch) no changes were made.
- Issue #986 -- Eliminate hard-coded strings in tools
Some of the tools had hard-coded strings used for error and warning messages.
They have been replaced with localizeable output from the messages files.
- Issue #990 -- LDAP tools don't use trust store password
The LDAP tools didn't provide any mechanism for specifying the PIN needed to
access the contents of an SSL trust store. Some types of trust stores may
require a PIN to access them, so it is now possible to either directly
specify the PIN or to provide the path to a PIN file.
- Issue #991 -- Disconnect when running stop-ds shouldn't be an error
When using the stop-ds script, if the server began shutting down before it
returned a response to the client, the client would provide an error message
making it sound like something went wrong. The output has now been updated
to indicate that the server is likely in the course of shutting down.
- Issue #992 -- Tool usage should include the tool name rather than the class
When displaying usage information for the administrative tools, the
fully-qualified class name for the Java class was displayed, where the name
of the shell script or batch file would have been more useful.
| | |
| | | |
| | | set PATH=%SystemRoot% |
| | | |
| | | %JAVA_BIN% %JAVA_ARGS% %OPENDS_INVOKE_CLASS% %* |
| | | %JAVA_BIN% %JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDS_INVOKE_CLASS% %* |
| | | |
| | | |
| | | :end |
| | |
| | | |
| | | |
| | | # Launch the appropriate server utility. |
| | | "${JAVA_BIN}" ${JAVA_ARGS} "${OPENDS_INVOKE_CLASS}" "${@}" |
| | | "${JAVA_BIN}" ${JAVA_ARGS} ${SCRIPT_NAME_ARG} "${OPENDS_INVOKE_CLASS}" "${@}" |
| | |
| | | |
| | | 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 |
| | |
| | | |
| | | |
| | | # 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" "${@}" |
| | |
| | | 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" "${@}" |
| | |
| | | setlocal |
| | | |
| | | set OPENDS_INVOKE_CLASS="org.opends.server.tools.BackUpDB" |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=backup" |
| | | call "%~dP0\_server-script.bat" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | 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" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | 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" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | 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" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | 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" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | setlocal |
| | | |
| | | set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPCompare" |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapcompare" |
| | | call "%~dP0\_client-script.bat" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | setlocal |
| | | |
| | | set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPDelete" |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapdelete" |
| | | call "%~dP0\_client-script.bat" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | setlocal |
| | | |
| | | set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPModify" |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapmodify" |
| | | call "%~dP0\_client-script.bat" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | setlocal |
| | | |
| | | set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPPasswordModify" |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldappasswordmodify" |
| | | call "%~dP0\_client-script.bat" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | setlocal |
| | | |
| | | set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDAPSearch" |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldapsearch" |
| | | call "%~dP0\_client-script.bat" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | 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" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | setlocal |
| | | |
| | | set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDIFModify" |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldifmodify" |
| | | call "%~dP0\_server-script.bat" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | setlocal |
| | | |
| | | set OPENDS_INVOKE_CLASS="org.opends.server.tools.LDIFSearch" |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=ldifsearch" |
| | | call "%~dP0\_client-script.bat" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | 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" %* |
| | | |
| | |
| | | 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" "${@}" |
| | |
| | | setlocal |
| | | |
| | | set OPENDS_INVOKE_CLASS="org.opends.server.tools.RestoreDB" |
| | | set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=restore" |
| | | call "%~dP0\_server-script.bat" %* |
| | | |
| | |
| | | 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. |
| | |
| | | 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 & |
| | |
| | | |
| | | 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 |
| | |
| | | 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. |
| | |
| | | |
| | | |
| | | # 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 "${@}" |
| | |
| | | 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" %* |
| | |
| | | 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" "${@}" |
| | |
| | | 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" %* |
| | | |
| | |
| | | |
| | | 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 |
| | |
| | | |
| | | |
| | | # 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}" "${@}" |
| | | |
| | |
| | | |
| | | |
| | | // 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 |
| | |
| | | |
| | | systemInfo = new BooleanArgument("systeminfo", 's', "systemInfo", |
| | | MSGID_DSCORE_DESCRIPTION_SYSINFO); |
| | | systemInfo.setHidden(true); |
| | | argParser.addArgument(systemInfo); |
| | | |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 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. |
| | | */ |
| | |
| | | "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."); |
| | |
| | | "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."); |
| | |
| | | |
| | | |
| | | /** |
| | | * 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. |
| | | */ |
| | |
| | | "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 " + |
| | |
| | | |
| | | /** |
| | | * 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 = |
| | |
| | | |
| | | |
| | | /** |
| | | * 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. |
| | | */ |
| | |
| | | |
| | | |
| | | 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 " + |
| | |
| | | "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, |
| | |
| | | "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."); |
| | |
| | | "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."); |
| | |
| | | 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, |
| | |
| | | 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."); |
| | |
| | | "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, |
| | |
| | | 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."); |
| | |
| | | "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."); |
| | |
| | | "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."); |
| | |
| | | "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."); |
| | |
| | | |
| | | |
| | | 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, |
| | |
| | | "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."); |
| | |
| | | |
| | | 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."); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | // 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 |
| | |
| | | * |
| | | * @param args The command-line arguments provided to this program. |
| | | */ |
| | | |
| | | public static void main(String[] args) |
| | | { |
| | | int retCode = mainBackUpDB(args); |
| | |
| | | |
| | | |
| | | // 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 |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | String message = getMessage(msgID, |
| | | incrementalBaseID.getLongIdentifier(), |
| | | incremental.getLongIdentifier()); |
| | | System.err.println(message); |
| | | System.err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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, |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | |
| | | String message = getMessage(msgID, |
| | | String.valueOf(configFile.getValue()), |
| | | e.getMessage()); |
| | | System.err.println(message); |
| | | System.err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | String message = getMessage(msgID, |
| | | String.valueOf(configFile.getValue()), |
| | | e.getMessage()); |
| | | System.err.println(message); |
| | | System.err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | String message = getMessage(msgID, |
| | | String.valueOf(configFile.getValue()), |
| | | e.getMessage()); |
| | | System.err.println(message); |
| | | System.err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | String message = getMessage(msgID, |
| | | String.valueOf(rootDNString.getValue()), |
| | | de.getErrorMessage()); |
| | | System.err.println(message); |
| | | System.err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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.*; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | // 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 |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | { |
| | | 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); |
| | | } |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | |
| | | { |
| | | int msgID = MSGID_ENCPW_NO_STORAGE_SCHEMES; |
| | | String message = getMessage(msgID); |
| | | System.err.println(message); |
| | | System.err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | int msgID = MSGID_ENCPW_NO_STORAGE_SCHEMES; |
| | | String message = getMessage(msgID); |
| | | System.err.println(message); |
| | | System.err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | |
| | | { |
| | | 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 |
| | |
| | | { |
| | | 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)); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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.*; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | // 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 |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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.*; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | // 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 |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | |
| | | 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.*; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 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; |
| | |
| | | |
| | | |
| | | // 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; |
| | |
| | | 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.*; |
| | | |
| | | |
| | | /** |
| | |
| | | { |
| | | 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)); |
| | |
| | | { |
| | | msgID = MSGID_OPERATION_FAILED; |
| | | String msg = getMessage(msgID, "COMPARE", line, ae.getMessage()); |
| | | err.println(msg); |
| | | err.println(wrapText(msg, MAX_LINE_WIDTH)); |
| | | return; |
| | | } |
| | | } |
| | |
| | | { |
| | | msgID = MSGID_OPERATION_FAILED; |
| | | String msg = getMessage(msgID, "COMPARE", line, errorMessage); |
| | | err.println(msg); |
| | | err.println(wrapText(msg, MAX_LINE_WIDTH)); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | |
| | | 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(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; |
| | | } |
| | | |
| | |
| | | if (dnStrings.isEmpty()) |
| | | { |
| | | int msgID = MSGID_LDAPCOMPARE_NO_DNS; |
| | | err.println(getMessage(msgID)); |
| | | err.println(wrapText(getMessage(msgID), MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | 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); |
| | |
| | | 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 == '<') |
| | |
| | | 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 |
| | |
| | | } catch (ArgumentException ae) |
| | | { |
| | | assert debugException(CLASS_NAME, "main", ae); |
| | | err.println(ae.getMessage()); |
| | | err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | } 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) |
| | |
| | | } |
| | | |
| | | 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()); |
| | |
| | | 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; |
| | | } |
| | |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | } 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 |
| | | { |
| | |
| | | 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.*; |
| | | |
| | | |
| | | /** |
| | |
| | | { |
| | | msgID = MSGID_OPERATION_FAILED; |
| | | String msg = getMessage(msgID, "DELETE", line, ae.getMessage()); |
| | | err.println(msg); |
| | | err.println(wrapText(msg, MAX_LINE_WIDTH)); |
| | | return; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | } catch(ArgumentException ae) |
| | | { |
| | | assert debugException(CLASS_NAME, "main", ae); |
| | | err.println(ae.getMessage()); |
| | | err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | } 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) |
| | |
| | | } |
| | | |
| | | 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()); |
| | |
| | | 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; |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | } 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 |
| | | { |
| | |
| | | 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.*; |
| | | |
| | | |
| | | |
| | |
| | | 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) |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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()); |
| | |
| | | |
| | | if (errorMessage != null) |
| | | { |
| | | out.println(errorMessage); |
| | | out.println(wrapText(errorMessage, MAX_LINE_WIDTH)); |
| | | } |
| | | |
| | | if (referralURLs != null) |
| | |
| | | if (controlValue == null) |
| | | { |
| | | msgID = MSGID_LDAPMODIFY_PREREAD_NO_VALUE; |
| | | err.println(getMessage(msgID)); |
| | | err.println(wrapText(getMessage(msgID), MAX_LINE_WIDTH)); |
| | | continue; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | if (controlValue == null) |
| | | { |
| | | msgID = MSGID_LDAPMODIFY_POSTREAD_NO_VALUE; |
| | | err.println(getMessage(msgID)); |
| | | err.println(wrapText(getMessage(msgID), MAX_LINE_WIDTH)); |
| | | continue; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | } catch(ArgumentException ae) |
| | | { |
| | | assert debugException(CLASS_NAME, "main", ae); |
| | | err.println(ae.getMessage()); |
| | | err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | } 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) |
| | |
| | | } |
| | | |
| | | 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()); |
| | |
| | | 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; |
| | | } |
| | |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | } 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 |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 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 |
| | |
| | | |
| | | |
| | | // 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 |
| | | { |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | LDAPMessage message = new LDAPMessage(nextMessageID.getAndIncrement(), |
| | | protocolOp, |
| | | searchOptions.getControls()); |
| | | int numBytes = |
| | | connection.getASN1Writer().writeElement(message.encode()); |
| | | connection.getASN1Writer().writeElement(message.encode()); |
| | | |
| | | byte opType; |
| | | do |
| | |
| | | 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) {} |
| | | } |
| | |
| | | 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)); |
| | | } |
| | | } |
| | | } |
| | |
| | | // 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; |
| | | } |
| | | |
| | |
| | | else if (errorMessage != null) |
| | | { |
| | | out.println(); |
| | | out.println(errorMessage); |
| | | out.println(wrapText(errorMessage, MAX_LINE_WIDTH)); |
| | | } |
| | | |
| | | } while(opType != OP_TYPE_SEARCH_RESULT_DONE); |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | } 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 |
| | |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | } catch(ArgumentException ae) |
| | | { |
| | | assert debugException(CLASS_NAME, "main", ae); |
| | | err.println(ae.getMessage()); |
| | | err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | } 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) |
| | |
| | | } |
| | | |
| | | 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()); |
| | |
| | | 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); |
| | |
| | | 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; |
| | | } |
| | |
| | | { |
| | | int msgID = MSGID_PSEARCH_MISSING_DESCRIPTOR; |
| | | String message = getMessage(msgID); |
| | | err.println(message); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | else |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | } catch(Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "main", e); |
| | | err.println(e.getMessage()); |
| | | err.println(wrapText(e.getMessage(), MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | finally |
| | |
| | | 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; |
| | | } |
| | |
| | | } 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 |
| | | { |
| | |
| | | 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, |
| | |
| | | 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 |
| | | { |
| | |
| | | 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 |
| | |
| | | |
| | | |
| | | // 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 |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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.*; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | // 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; |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | { |
| | | 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 |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | } |
| | | |
| | |
| | | String message = extendedResponse.getErrorMessage(); |
| | | if (message != null) |
| | | { |
| | | err.println(message); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | } |
| | | |
| | | return extendedResponse.getResultCode(); |
| | |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | String errorMessage = addResponse.getErrorMessage(); |
| | | if (errorMessage != null) |
| | | { |
| | | err.println(errorMessage); |
| | | err.println(wrapText(errorMessage, MAX_LINE_WIDTH)); |
| | | } |
| | | |
| | | return addResponse.getResultCode(); |
| | |
| | | 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.*; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | // 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 |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | |
| | | { |
| | | 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); |
| | | } |
| | | |
| | |
| | | |
| | | 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.*; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 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. |
| | | * |
| | |
| | | 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 |
| | | { |
| | |
| | | |
| | | 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.*; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 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; |
| | | |
| | |
| | | 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; |
| | |
| | | |
| | | |
| | | /** |
| | | * 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; |
| | | } |
| | | |
| | |
| | | // 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; |
| | |
| | | * 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>(); |
| | |
| | | * 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 |
| | |
| | | * 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; |
| | |
| | | |
| | | |
| | | /** |
| | | * 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 |
| | |
| | | */ |
| | | 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) |
| | |
| | | // 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); |
| | |
| | | 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); |
| | |
| | | |
| | | if (s.length() > 0) |
| | | { |
| | | buffer.append(" "); |
| | | buffer.append(" "); |
| | | buffer.append(s); |
| | | buffer.append(EOL); |
| | | } |
| | | } |
| | | |
| | | buffer.append(EOL); |
| | | } |
| | | } |
| | | |
| | |
| | | // 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; |
| | | |
| | |
| | | * 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>(); |
| | |
| | | |
| | | |
| | | /** |
| | | * 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. |
| | | * |
| | |
| | | */ |
| | | 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); |
| | |
| | | buffer.append(value); |
| | | } |
| | | } |
| | | |
| | | buffer.append(EOL); |
| | | } |
| | | |
| | | buffer.append(EOL); |
| | |
| | | |
| | | buffer.append(EOL); |
| | | } |
| | | |
| | | buffer.append(EOL); |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | 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}"); |
| | |
| | | // 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); |
| | |
| | | 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); |
| | |
| | | |
| | | if (s.length() > 0) |
| | | { |
| | | buffer.append(" "); |
| | | buffer.append(" "); |
| | | buffer.append(s); |
| | | buffer.append(EOL); |
| | | } |
| | |
| | | buffer.append(EOL); |
| | | } |
| | | } |
| | | |
| | | buffer.append(EOL); |
| | | } |
| | | } |
| | | |