mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
13.24.2014 6acb5680cc685afc071ca5bcc358d31690bb1786
opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java
@@ -45,7 +45,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getShowUsage() throws ArgumentException {
    public static BooleanArgument getShowUsage() throws ArgumentException {
        return new BooleanArgument("showUsage", OPTION_SHORT_HELP, OPTION_LONG_HELP, INFO_DESCRIPTION_SHOWUSAGE.get());
    }
@@ -56,7 +56,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getVerbose() throws ArgumentException {
    public static BooleanArgument getVerbose() throws ArgumentException {
        final BooleanArgument verbose = new BooleanArgument("verbose", 'v', "verbose", INFO_DESCRIPTION_VERBOSE.get());
        verbose.setPropertyName("verbose");
        return verbose;
@@ -69,7 +69,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getPropertiesFile() throws ArgumentException {
    public static StringArgument getPropertiesFile() throws ArgumentException {
        return new StringArgument("propertiesFilePath", null, OPTION_LONG_PROP_FILE_PATH, false, false, true,
                INFO_PROP_FILE_PATH_PLACEHOLDER.get(), null, null, INFO_DESCRIPTION_PROP_FILE_PATH.get());
    }
@@ -81,7 +81,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getNoPropertiesFile() throws ArgumentException {
    public static BooleanArgument getNoPropertiesFile() throws ArgumentException {
        return new BooleanArgument("noPropertiesFile", null, OPTION_LONG_NO_PROP_FILE,
                INFO_DESCRIPTION_NO_PROP_FILE.get());
    }
@@ -93,7 +93,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getContinueOnError() throws ArgumentException {
    public static BooleanArgument getContinueOnError() throws ArgumentException {
        final BooleanArgument continueOnError = new BooleanArgument("continueOnError", 'c', "continueOnError",
                INFO_DESCRIPTION_CONTINUE_ON_ERROR.get());
        continueOnError.setPropertyName("continueOnError");
@@ -107,7 +107,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final IntegerArgument getVersion() throws ArgumentException {
    public static IntegerArgument getVersion() throws ArgumentException {
        final IntegerArgument version = new IntegerArgument("version", OPTION_SHORT_PROTOCOL_VERSION,
                OPTION_LONG_PROTOCOL_VERSION, false, false, true, INFO_PROTOCOL_VERSION_PLACEHOLDER.get(), 3, null,
                INFO_DESCRIPTION_VERSION.get());
@@ -122,7 +122,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getQuiet() throws ArgumentException {
    public static BooleanArgument getQuiet() throws ArgumentException {
        final BooleanArgument quiet = new BooleanArgument(OPTION_LONG_QUIET, OPTION_SHORT_QUIET, OPTION_LONG_QUIET,
                INFO_DESCRIPTION_QUIET.get());
        quiet.setPropertyName(OPTION_LONG_QUIET);
@@ -137,7 +137,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getNoPrompt() throws ArgumentException {
    public static BooleanArgument getNoPrompt() throws ArgumentException {
        return new BooleanArgument(OPTION_LONG_NO_PROMPT, OPTION_SHORT_NO_PROMPT, OPTION_LONG_NO_PROMPT,
                INFO_DESCRIPTION_NO_PROMPT.get());
    }
@@ -149,7 +149,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getAcceptLicense() throws ArgumentException {
    public static BooleanArgument getAcceptLicense() throws ArgumentException {
        return new BooleanArgument(OPTION_LONG_ACCEPT_LICENSE, null, OPTION_LONG_ACCEPT_LICENSE,
                INFO_OPTION_ACCEPT_LICENSE.get());
    }
@@ -161,7 +161,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getTestOnly() throws ArgumentException {
    public static BooleanArgument getTestOnly() throws ArgumentException {
        final BooleanArgument testOnly = new BooleanArgument("testOnly".toLowerCase(), 't', "testOnly",
                INFO_ARGUMENT_DESCRIPTION_TESTONLY.get());
        testOnly.setHidden(true);
@@ -178,7 +178,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final IntegerArgument getConnectTimeOut(final int defaultTimeout) throws ArgumentException {
    public static IntegerArgument getConnectTimeOut(final int defaultTimeout) throws ArgumentException {
        final IntegerArgument connectTimeout = new IntegerArgument(OPTION_LONG_CONNECT_TIMEOUT, null,
                OPTION_LONG_CONNECT_TIMEOUT, false, false, true, INFO_TIMEOUT_PLACEHOLDER.get(), defaultTimeout, null,
                true, 1, true, 65535, INFO_DESCRIPTION_CONNECTION_TIMEOUT.get());
@@ -194,7 +194,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getCLI() throws ArgumentException {
    public static BooleanArgument getCLI() throws ArgumentException {
        final BooleanArgument cli = new BooleanArgument(OPTION_LONG_CLI.toLowerCase(), OPTION_SHORT_CLI,
                OPTION_LONG_CLI, INFO_ARGUMENT_DESCRIPTION_CLI.get());
        cli.setPropertyName(OPTION_LONG_CLI);
@@ -208,7 +208,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getBaseDN() throws ArgumentException {
    public static StringArgument getBaseDN() throws ArgumentException {
        return new StringArgument(OPTION_LONG_BASEDN.toLowerCase(), OPTION_SHORT_BASEDN, OPTION_LONG_BASEDN, false,
                true, true, INFO_BASEDN_PLACEHOLDER.get(), null, OPTION_LONG_BASEDN,
                INFO_ARGUMENT_DESCRIPTION_BASEDN.get());
@@ -221,7 +221,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getAddBaseEntry() throws ArgumentException {
    public static BooleanArgument getAddBaseEntry() throws ArgumentException {
        final BooleanArgument addBaseEntryArg = new BooleanArgument("addBaseEntry".toLowerCase(), 'a', "addBaseEntry",
                INFO_ARGUMENT_DESCRIPTION_ADDBASE.get());
        addBaseEntryArg.setPropertyName("addBaseEntry");
@@ -235,7 +235,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getImportLDIF() throws ArgumentException {
    public static StringArgument getImportLDIF() throws ArgumentException {
        return new StringArgument(OPTION_LONG_LDIF_FILE.toLowerCase(), OPTION_SHORT_LDIF_FILE, OPTION_LONG_LDIF_FILE,
                false, true, true, INFO_LDIFFILE_PLACEHOLDER.get(), null, OPTION_LONG_LDIF_FILE,
                INFO_ARGUMENT_DESCRIPTION_IMPORTLDIF.get());
@@ -248,7 +248,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getRejectedImportLdif() throws ArgumentException {
    public static StringArgument getRejectedImportLdif() throws ArgumentException {
        return new StringArgument("rejectFile".toLowerCase(), 'R', "rejectFile", false, false, true,
                INFO_REJECT_FILE_PLACEHOLDER.get(), null, "rejectFile", INFO_GENERAL_DESCRIPTION_REJECTED_FILE.get());
    }
@@ -260,7 +260,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getSkippedImportFile() throws ArgumentException {
    public static StringArgument getSkippedImportFile() throws ArgumentException {
        return new StringArgument("skipFile".toLowerCase(), null, "skipFile", false, false, true,
                INFO_SKIP_FILE_PLACEHOLDER.get(), null, "skipFile", INFO_GENERAL_DESCRIPTION_SKIPPED_FILE.get());
    }
@@ -272,7 +272,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final IntegerArgument getSampleData() throws ArgumentException {
    public static IntegerArgument getSampleData() throws ArgumentException {
        return new IntegerArgument("sampleData".toLowerCase(), 'd', "sampleData", false, false, true,
                INFO_NUM_ENTRIES_PLACEHOLDER.get(), 0, "sampleData", true, 0, false, 0,
                INFO_SETUP_DESCRIPTION_SAMPLE_DATA.get());
@@ -287,7 +287,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final IntegerArgument getLDAPPort(final int defaultLdapPort) throws ArgumentException {
    public static IntegerArgument getLDAPPort(final int defaultLdapPort) throws ArgumentException {
        return new IntegerArgument("ldapPort".toLowerCase(), OPTION_SHORT_PORT, "ldapPort", false, false, true,
                INFO_PORT_PLACEHOLDER.get(), defaultLdapPort, "ldapPort", true, 1, true, 65535,
                INFO_ARGUMENT_DESCRIPTION_LDAPPORT.get());
@@ -302,7 +302,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final IntegerArgument getAdminLDAPPort(final int defaultAdminPort) throws ArgumentException {
    public static IntegerArgument getAdminLDAPPort(final int defaultAdminPort) throws ArgumentException {
        return new IntegerArgument("adminConnectorPort".toLowerCase(), null, "adminConnectorPort", false, false, true,
                INFO_PORT_PLACEHOLDER.get(), defaultAdminPort, "adminConnectorPort", true, 1, true, 65535,
                INFO_ARGUMENT_DESCRIPTION_ADMINCONNECTORPORT.get());
@@ -317,7 +317,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final IntegerArgument getJMXPort(final int defaultJMXPort) throws ArgumentException {
    public static IntegerArgument getJMXPort(final int defaultJMXPort) throws ArgumentException {
        return new IntegerArgument("jmxPort".toLowerCase(), 'x', "jmxPort", false, false, true,
                INFO_JMXPORT_PLACEHOLDER.get(), defaultJMXPort, "jmxPort", true, 1, true, 65535,
                INFO_ARGUMENT_DESCRIPTION_SKIPPORT.get());
@@ -330,7 +330,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getSkipPortCheck() throws ArgumentException {
    public static BooleanArgument getSkipPortCheck() throws ArgumentException {
        final BooleanArgument skipPortCheck = new BooleanArgument("skipPortCheck".toLowerCase(), 'S', "skipPortCheck",
                INFO_ARGUMENT_DESCRIPTION_SKIPPORT.get());
        skipPortCheck.setPropertyName("skipPortCheck");
@@ -344,7 +344,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getRootDN() throws ArgumentException {
    public static StringArgument getRootDN() throws ArgumentException {
        return new StringArgument(OPTION_LONG_ROOT_USER_DN.toLowerCase(), OPTION_SHORT_ROOT_USER_DN,
                OPTION_LONG_ROOT_USER_DN, false, false, true, INFO_ROOT_USER_DN_PLACEHOLDER.get(),
                "cn=Directory Manager", OPTION_LONG_ROOT_USER_DN, INFO_ARGUMENT_DESCRIPTION_ROOTDN.get());
@@ -357,7 +357,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getRootDNPwd() throws ArgumentException {
    public static StringArgument getRootDNPwd() throws ArgumentException {
        return new StringArgument("rootUserPassword".toLowerCase(), OPTION_SHORT_BINDPWD, "rootUserPassword", false,
                false, true, INFO_ROOT_USER_PWD_PLACEHOLDER.get(), null, "rootUserPassword",
                INFO_ROOT_USER_PWD_PLACEHOLDER.get());
@@ -370,7 +370,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final FileBasedArgument getRootDNPwdFile() throws ArgumentException {
    public static FileBasedArgument getRootDNPwdFile() throws ArgumentException {
        return new FileBasedArgument("rootUserPasswordFile".toLowerCase(), OPTION_SHORT_BINDPWD_FILE,
                "rootUserPasswordFile", false, false, INFO_ROOT_USER_PWD_FILE_PLACEHOLDER.get(), null,
                "rootUserPasswordFile", INFO_ARGUMENT_DESCRIPTION_ROOTPWFILE.get());
@@ -383,7 +383,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getEnableWindowsService() throws ArgumentException {
    public static BooleanArgument getEnableWindowsService() throws ArgumentException {
        final BooleanArgument enableWindowsServiceArg = new BooleanArgument("enableWindowsService".toLowerCase(), 'e',
                "enableWindowsService", INFO_ARGUMENT_DESCRIPTION_ENABLE_WINDOWS_SERVICE.get());
        enableWindowsServiceArg.setPropertyName("enableWindowsService");
@@ -397,7 +397,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getDoNotStart() throws ArgumentException {
    public static BooleanArgument getDoNotStart() throws ArgumentException {
        final BooleanArgument doNotStartArg = new BooleanArgument("doNotStart".toLowerCase(), 'O', "doNotStart",
                INFO_SETUP_DESCRIPTION_DO_NOT_START.get());
        doNotStartArg.setPropertyName("doNotStart");
@@ -411,7 +411,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getEnableTLS() throws ArgumentException {
    public static BooleanArgument getEnableTLS() throws ArgumentException {
        final BooleanArgument enableStartTLS = new BooleanArgument("enableStartTLS".toLowerCase(),
                OPTION_SHORT_START_TLS, "enableStartTLS", INFO_SETUP_DESCRIPTION_ENABLE_STARTTLS.get());
        enableStartTLS.setPropertyName("enableStartTLS");
@@ -427,7 +427,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final IntegerArgument getLDAPSPort(final int defaultSecurePort) throws ArgumentException {
    public static IntegerArgument getLDAPSPort(final int defaultSecurePort) throws ArgumentException {
        return new IntegerArgument("ldapsPort".toLowerCase(), OPTION_SHORT_USE_SSL, "ldapsPort", false, false, true,
                INFO_PORT_PLACEHOLDER.get(), defaultSecurePort, "ldapsPort", true, 1, true, 65535,
                INFO_ARGUMENT_DESCRIPTION_LDAPSPORT.get());
@@ -440,7 +440,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getGenerateSelfSigned() throws ArgumentException {
    public static BooleanArgument getGenerateSelfSigned() throws ArgumentException {
        final BooleanArgument generateSelfSigned = new BooleanArgument("generateSelfSignedCertificate".toLowerCase(),
                null, "generateSelfSignedCertificate", INFO_ARGUMENT_DESCRIPTION_USE_SELF_SIGNED_CERTIFICATE.get());
        generateSelfSigned.setPropertyName("generateSelfSignedCertificate");
@@ -456,7 +456,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getHostName(final String defaultHostName) throws ArgumentException {
    public static StringArgument getHostName(final String defaultHostName) throws ArgumentException {
        final StringArgument hostName = new StringArgument(OPTION_LONG_HOST.toLowerCase(), OPTION_SHORT_HOST,
                OPTION_LONG_HOST, false, false, true, INFO_HOST_PLACEHOLDER.get(), defaultHostName, null,
                INFO_ARGUMENT_DESCRIPTION_HOST_NAME.get());
@@ -471,7 +471,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final BooleanArgument getUsePKCS11Keystore() throws ArgumentException {
    public static BooleanArgument getUsePKCS11Keystore() throws ArgumentException {
        final BooleanArgument usePkcs11 = new BooleanArgument("usePkcs11Keystore".toLowerCase(), null,
                "usePkcs11Keystore", INFO_ARGUMENT_DESCRIPTION_USE_PKCS11.get());
        usePkcs11.setPropertyName("usePkcs11Keystore");
@@ -485,7 +485,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getUseJavaKeyStore() throws ArgumentException {
    public static StringArgument getUseJavaKeyStore() throws ArgumentException {
        return new StringArgument("useJavaKeystore".toLowerCase(), null, "useJavaKeystore", false, false, true,
                INFO_KEYSTOREPATH_PLACEHOLDER.get(), null, "useJavaKeystore",
                INFO_ARGUMENT_DESCRIPTION_USE_JAVAKEYSTORE.get());
@@ -498,7 +498,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getUseJCEKS() throws ArgumentException {
    public static StringArgument getUseJCEKS() throws ArgumentException {
        return new StringArgument("useJCEKS".toLowerCase(), null, "useJCEKS", false, false, true,
                INFO_KEYSTOREPATH_PLACEHOLDER.get(), null, "useJCEKS", INFO_ARGUMENT_DESCRIPTION_USE_JCEKS.get());
    }
@@ -510,7 +510,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getUsePKCS12KeyStore() throws ArgumentException {
    public static StringArgument getUsePKCS12KeyStore() throws ArgumentException {
        return new StringArgument("usePkcs12keyStore".toLowerCase(), null, "usePkcs12keyStore", false, false, true,
                INFO_KEYSTOREPATH_PLACEHOLDER.get(), null, "usePkcs12keyStore",
                INFO_ARGUMENT_DESCRIPTION_USE_PKCS12.get());
@@ -523,7 +523,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getKeyStorePassword() throws ArgumentException {
    public static StringArgument getKeyStorePassword() throws ArgumentException {
        return new StringArgument(OPTION_LONG_KEYSTORE_PWD.toLowerCase(), OPTION_SHORT_KEYSTORE_PWD,
                OPTION_LONG_KEYSTORE_PWD, false, false, true, INFO_KEYSTORE_PWD_PLACEHOLDER.get(), null,
                OPTION_LONG_KEYSTORE_PWD, INFO_ARGUMENT_DESCRIPTION_KEYSTOREPASSWORD.get());
@@ -536,7 +536,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final FileBasedArgument getKeyStorePasswordFile() throws ArgumentException {
    public static FileBasedArgument getKeyStorePasswordFile() throws ArgumentException {
        return new FileBasedArgument(OPTION_LONG_KEYSTORE_PWD_FILE.toLowerCase(), OPTION_SHORT_KEYSTORE_PWD_FILE,
                OPTION_LONG_KEYSTORE_PWD_FILE, false, false, INFO_KEYSTORE_PWD_FILE_PLACEHOLDER.get(), null,
                OPTION_LONG_KEYSTORE_PWD_FILE, INFO_ARGUMENT_DESCRIPTION_KEYSTOREPASSWORD_FILE.get());
@@ -549,7 +549,7 @@
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static final StringArgument getCertNickName() throws ArgumentException {
    public static StringArgument getCertNickName() throws ArgumentException {
        return new StringArgument(OPTION_LONG_CERT_NICKNAME.toLowerCase(), OPTION_SHORT_CERT_NICKNAME,
                OPTION_LONG_CERT_NICKNAME, false, false, true, INFO_NICKNAME_PLACEHOLDER.get(), null,
                OPTION_LONG_CERT_NICKNAME, INFO_ARGUMENT_DESCRIPTION_CERT_NICKNAME.get());