Checkpoint OPENDJ-1343 Migrate dsconfig / OPENDJ-1303 "opendj-cli"
- replaced arguments by CLI sdk CommonArguments.(Basic only, riskless to conflicting arguments)
- reverted modifications on InstallDS/InstallDSArgumentParser about getDirectoryManagerPassword.
- removed from toolconstants 'description' / 'memberName' (unused)
| | |
| | | import org.opends.quicksetup.UserData; |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.server.admin.AdministrationConnector; |
| | | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.ArgumentParser; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.FileBasedArgument; |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | |
| | | */ |
| | | public void initializeArguments() throws ArgumentException |
| | | { |
| | | hostNameArg = new StringArgument("host", OPTION_SHORT_HOST, |
| | | OPTION_LONG_HOST, false, false, true, INFO_HOST_PLACEHOLDER.get(), |
| | | UserData.getDefaultHostName(), |
| | | null, INFO_DESCRIPTION_HOST.get()); |
| | | hostNameArg.setPropertyName(OPTION_LONG_HOST); |
| | | hostNameArg = CommonArguments.getHostName(UserData.getDefaultHostName()); |
| | | addArgument(hostNameArg); |
| | | |
| | | portArg = new IntegerArgument("port", OPTION_SHORT_PORT, OPTION_LONG_PORT, |
| | | false, false, true, INFO_PORT_PLACEHOLDER.get(), |
| | | getDefaultAdministrationPort(), null, |
| | | true, 1, true, 65535, |
| | | portArg = |
| | | CommonArguments.getPort(getDefaultAdministrationPort(), |
| | | INFO_DESCRIPTION_ADMIN_PORT.get()); |
| | | portArg.setPropertyName(OPTION_LONG_PORT); |
| | | addArgument(portArg); |
| | | |
| | | bindDnArg = new StringArgument("bindDN", OPTION_SHORT_BINDDN, |
| | | OPTION_LONG_BINDDN, false, false, true, INFO_BINDDN_PLACEHOLDER.get(), |
| | | getDefaultBindDN(), null, INFO_DESCRIPTION_BINDDN.get()); |
| | | bindDnArg.setPropertyName(OPTION_LONG_BINDDN); |
| | | bindDnArg = CommonArguments.getBindDN(getDefaultBindDN()); |
| | | addArgument(bindDnArg); |
| | | |
| | | bindPasswordArg = new StringArgument("bindPassword", |
| | | OPTION_SHORT_BINDPWD, OPTION_LONG_BINDPWD, false, false, true, |
| | | INFO_BINDPWD_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_BINDPASSWORD.get()); |
| | | bindPasswordArg.setPropertyName(OPTION_LONG_BINDPWD); |
| | | bindPasswordArg = CommonArguments.getBindPassword(); |
| | | addArgument(bindPasswordArg); |
| | | |
| | | bindPasswordFileArg = new FileBasedArgument("bindPasswordFile", |
| | | OPTION_SHORT_BINDPWD_FILE, OPTION_LONG_BINDPWD_FILE, false, false, |
| | | INFO_BINDPWD_FILE_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_BINDPASSWORDFILE.get()); |
| | | bindPasswordFileArg.setPropertyName(OPTION_LONG_BINDPWD_FILE); |
| | | bindPasswordFileArg = CommonArguments.getBindPasswordFile(); |
| | | addArgument(bindPasswordFileArg); |
| | | |
| | | trustAllArg = new BooleanArgument("trustAll", OPTION_SHORT_TRUSTALL, |
| | | OPTION_LONG_TRUSTALL, INFO_DESCRIPTION_TRUSTALL.get()); |
| | | trustAllArg.setPropertyName(OPTION_LONG_TRUSTALL); |
| | | trustAllArg = CommonArguments.getTrustAll(); |
| | | addArgument(trustAllArg); |
| | | |
| | | remoteArg = new BooleanArgument("remote", OPTION_SHORT_REMOTE, |
| | | OPTION_LONG_REMOTE, INFO_DESCRIPTION_REMOTE.get()); |
| | | remoteArg.setPropertyName(OPTION_LONG_REMOTE); |
| | | remoteArg = CommonArguments.getRemote(); |
| | | addArgument(remoteArg); |
| | | |
| | | int defaultTimeout = ConnectionUtils.getDefaultLDAPTimeout(); |
| | | connectTimeoutArg = new IntegerArgument(OPTION_LONG_CONNECT_TIMEOUT, |
| | | null, OPTION_LONG_CONNECT_TIMEOUT, |
| | | false, false, true, INFO_TIMEOUT_PLACEHOLDER.get(), |
| | | defaultTimeout, null, |
| | | true, 0, false, Integer.MAX_VALUE, |
| | | INFO_DESCRIPTION_CONNECTION_TIMEOUT.get()); |
| | | connectTimeoutArg.setPropertyName(OPTION_LONG_CONNECT_TIMEOUT); |
| | | connectTimeoutArg = |
| | | CommonArguments.getConnectTimeOut(ConnectionUtils |
| | | .getDefaultLDAPTimeout()); |
| | | connectTimeoutArg.setHidden(false); |
| | | addArgument(connectTimeoutArg); |
| | | |
| | | showUsageArg = new BooleanArgument("help", OPTION_SHORT_HELP, |
| | | OPTION_LONG_HELP, |
| | | INFO_DESCRIPTION_USAGE.get()); |
| | | showUsageArg = CommonArguments.getShowUsage(); |
| | | addArgument(showUsageArg); |
| | | setUsageArgument(showUsageArg); |
| | | } |
| | |
| | | import com.forgerock.opendj.cli.Argument; |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | | |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | |
| | | throws ArgumentException |
| | | { |
| | | LinkedHashSet<Argument> args = new LinkedHashSet<Argument>(); |
| | | cliArg = new BooleanArgument( |
| | | OPTION_LONG_CLI, |
| | | OPTION_SHORT_CLI, |
| | | OPTION_LONG_CLI, |
| | | INFO_UNINSTALLDS_DESCRIPTION_CLI.get()); |
| | | cliArg = CommonArguments.getCLI(); |
| | | args.add(cliArg); |
| | | |
| | | removeAllArg = new BooleanArgument( |
| | | "remove-all", |
| | | 'a', |
| | |
| | | INFO_UNINSTALLDS_DESCRIPTION_REMOVE_LDIF_FILES.get() |
| | | ); |
| | | args.add(removeLDIFFilesArg); |
| | | noPromptArg = new BooleanArgument( |
| | | OPTION_LONG_NO_PROMPT, |
| | | OPTION_SHORT_NO_PROMPT, |
| | | OPTION_LONG_NO_PROMPT, |
| | | INFO_DESCRIPTION_NO_PROMPT.get()); |
| | | |
| | | noPromptArg = CommonArguments.getNoPrompt(); |
| | | args.add(noPromptArg); |
| | | |
| | | forceOnErrorArg = new BooleanArgument( |
| | | "forceOnError", |
| | | 'f', |
| | |
| | | INFO_UNINSTALLDS_DESCRIPTION_FORCE.get( |
| | | "--"+noPromptArg.getLongIdentifier())); |
| | | args.add(forceOnErrorArg); |
| | | quietArg = new BooleanArgument( |
| | | OPTION_LONG_QUIET, |
| | | OPTION_SHORT_QUIET, |
| | | OPTION_LONG_QUIET, |
| | | INFO_UNINSTALLDS_DESCRIPTION_QUIET.get()); |
| | | |
| | | quietArg = CommonArguments.getQuiet(); |
| | | args.add(quietArg); |
| | | |
| | | for (Argument arg : args) |
| | |
| | | */ |
| | | package org.opends.server.admin.client.cli; |
| | | |
| | | import static com.forgerock.opendj.cli.CliMessages.INFO_DESCRIPTION_ADMIN_PORT; |
| | | import static org.opends.server.tools.JavaPropertiesTool.ErrorReturnCode.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | |
| | | import static org.opends.server.tools.ToolConstants.*; |
| | | import static org.opends.server.util.ServerConstants.MAX_LINE_WIDTH; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.util.PasswordReader; |
| | | import org.opends.server.util.SelectableCertificateKeyManager; |
| | | |
| | | import com.forgerock.opendj.cli.Argument; |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.FileBasedArgument; |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | |
| | | { |
| | | argList = new LinkedHashSet<Argument>(); |
| | | |
| | | useSSLArg = new BooleanArgument("useSSL", OPTION_SHORT_USE_SSL, |
| | | OPTION_LONG_USE_SSL, INFO_DESCRIPTION_USE_SSL.get()); |
| | | useSSLArg.setPropertyName(OPTION_LONG_USE_SSL); |
| | | useSSLArg = CommonArguments.getUseSSL(); |
| | | if (!alwaysSSL) { |
| | | argList.add(useSSLArg); |
| | | } else { |
| | |
| | | useSSLArg.setPresent(true); |
| | | } |
| | | |
| | | useStartTLSArg = new BooleanArgument("startTLS", OPTION_SHORT_START_TLS, |
| | | OPTION_LONG_START_TLS, |
| | | INFO_DESCRIPTION_START_TLS.get()); |
| | | useStartTLSArg.setPropertyName(OPTION_LONG_START_TLS); |
| | | useStartTLSArg = CommonArguments.getStartTLS(); |
| | | if (!alwaysSSL) { |
| | | argList.add(useStartTLSArg); |
| | | } |
| | |
| | | } catch (Exception e) { |
| | | defaultHostName="Unknown (" + e + ")"; |
| | | } |
| | | hostNameArg = new StringArgument("host", OPTION_SHORT_HOST, |
| | | OPTION_LONG_HOST, false, false, true, INFO_HOST_PLACEHOLDER.get(), |
| | | defaultHostName, |
| | | null, INFO_DESCRIPTION_HOST.get()); |
| | | hostNameArg.setPropertyName(OPTION_LONG_HOST); |
| | | hostNameArg = CommonArguments.getHostName(defaultHostName); |
| | | argList.add(hostNameArg); |
| | | |
| | | |
| | | LocalizableMessage portDescription = INFO_DESCRIPTION_PORT.get(); |
| | | if (alwaysSSL) { |
| | | portDescription = INFO_DESCRIPTION_ADMIN_PORT.get(); |
| | | } |
| | | |
| | | portArg = new IntegerArgument("port", OPTION_SHORT_PORT, OPTION_LONG_PORT, |
| | | false, false, true, INFO_PORT_PLACEHOLDER.get(), |
| | | AdministrationConnector.DEFAULT_ADMINISTRATION_CONNECTOR_PORT, null, |
| | | true, 1, true, 65535, |
| | | portDescription); |
| | | portArg.setPropertyName(OPTION_LONG_PORT); |
| | | portArg = |
| | | CommonArguments.getPort( |
| | | AdministrationConnector.DEFAULT_ADMINISTRATION_CONNECTOR_PORT, |
| | | alwaysSSL ? INFO_DESCRIPTION_ADMIN_PORT.get() |
| | | : INFO_DESCRIPTION_PORT.get()); |
| | | argList.add(portArg); |
| | | |
| | | bindDnArg = new StringArgument("bindDN", OPTION_SHORT_BINDDN, |
| | | OPTION_LONG_BINDDN, false, false, true, INFO_BINDDN_PLACEHOLDER.get(), |
| | | "cn=Directory Manager", null, INFO_DESCRIPTION_BINDDN.get()); |
| | | bindDnArg.setPropertyName(OPTION_LONG_BINDDN); |
| | | bindDnArg = CommonArguments.getBindDN("cn=Directory Manager"); |
| | | argList.add(bindDnArg); |
| | | |
| | | // It is up to the classes that required admin UID to make this argument |
| | |
| | | adminUidArg.setPropertyName(OPTION_LONG_ADMIN_UID); |
| | | adminUidArg.setHidden(true); |
| | | |
| | | bindPasswordArg = new StringArgument("bindPassword", |
| | | OPTION_SHORT_BINDPWD, OPTION_LONG_BINDPWD, false, false, true, |
| | | INFO_BINDPWD_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_BINDPASSWORD.get()); |
| | | bindPasswordArg.setPropertyName(OPTION_LONG_BINDPWD); |
| | | bindPasswordArg = CommonArguments.getBindPassword(); |
| | | argList.add(bindPasswordArg); |
| | | |
| | | bindPasswordFileArg = new FileBasedArgument("bindPasswordFile", |
| | | OPTION_SHORT_BINDPWD_FILE, OPTION_LONG_BINDPWD_FILE, false, false, |
| | | INFO_BINDPWD_FILE_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_BINDPASSWORDFILE.get()); |
| | | bindPasswordFileArg.setPropertyName(OPTION_LONG_BINDPWD_FILE); |
| | | bindPasswordFileArg = CommonArguments.getBindPasswordFile(); |
| | | argList.add(bindPasswordFileArg); |
| | | |
| | | saslOptionArg = new StringArgument( |
| | | "sasloption", OPTION_SHORT_SASLOPTION, |
| | | OPTION_LONG_SASLOPTION, false, |
| | | true, true, |
| | | INFO_SASL_OPTION_PLACEHOLDER.get(), null, null, |
| | | INFO_LDAP_CONN_DESCRIPTION_SASLOPTIONS.get()); |
| | | saslOptionArg.setPropertyName(OPTION_LONG_SASLOPTION); |
| | | saslOptionArg = CommonArguments.getSASL(); |
| | | argList.add(saslOptionArg); |
| | | |
| | | trustAllArg = new BooleanArgument("trustAll", OPTION_SHORT_TRUSTALL, |
| | | OPTION_LONG_TRUSTALL, INFO_DESCRIPTION_TRUSTALL.get()); |
| | | trustAllArg.setPropertyName(OPTION_LONG_TRUSTALL); |
| | | trustAllArg = CommonArguments.getTrustAll(); |
| | | argList.add(trustAllArg); |
| | | |
| | | trustStorePathArg = new StringArgument("trustStorePath", |
| | | OPTION_SHORT_TRUSTSTOREPATH, OPTION_LONG_TRUSTSTOREPATH, false, |
| | | false, true, INFO_TRUSTSTOREPATH_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_TRUSTSTOREPATH.get()); |
| | | trustStorePathArg.setPropertyName(OPTION_LONG_TRUSTSTOREPATH); |
| | | trustStorePathArg = CommonArguments.getTrustStorePath(); |
| | | argList.add(trustStorePathArg); |
| | | |
| | | trustStorePasswordArg = new StringArgument("trustStorePassword", |
| | | OPTION_SHORT_TRUSTSTORE_PWD, OPTION_LONG_TRUSTSTORE_PWD, false, false, |
| | | true, INFO_TRUSTSTORE_PWD_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_TRUSTSTOREPASSWORD.get()); |
| | | trustStorePasswordArg.setPropertyName(OPTION_LONG_TRUSTSTORE_PWD); |
| | | trustStorePasswordArg = CommonArguments.getTrustStorePassword(); |
| | | argList.add(trustStorePasswordArg); |
| | | |
| | | trustStorePasswordFileArg = new FileBasedArgument("trustStorePasswordFile", |
| | | OPTION_SHORT_TRUSTSTORE_PWD_FILE, OPTION_LONG_TRUSTSTORE_PWD_FILE, |
| | | false, false, INFO_TRUSTSTORE_PWD_FILE_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_TRUSTSTOREPASSWORD_FILE.get()); |
| | | trustStorePasswordFileArg.setPropertyName(OPTION_LONG_TRUSTSTORE_PWD_FILE); |
| | | trustStorePasswordFileArg = CommonArguments.getTrustStorePasswordFile(); |
| | | argList.add(trustStorePasswordFileArg); |
| | | |
| | | keyStorePathArg = new StringArgument("keyStorePath", |
| | | OPTION_SHORT_KEYSTOREPATH, OPTION_LONG_KEYSTOREPATH, false, false, |
| | | true, INFO_KEYSTOREPATH_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_KEYSTOREPATH.get()); |
| | | keyStorePathArg.setPropertyName(OPTION_LONG_KEYSTOREPATH); |
| | | keyStorePathArg = CommonArguments.getKeyStorePath(); |
| | | argList.add(keyStorePathArg); |
| | | |
| | | keyStorePasswordArg = new StringArgument("keyStorePassword", |
| | | OPTION_SHORT_KEYSTORE_PWD, |
| | | OPTION_LONG_KEYSTORE_PWD, false, false, true, |
| | | INFO_KEYSTORE_PWD_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_KEYSTOREPASSWORD.get()); |
| | | keyStorePasswordArg.setPropertyName(OPTION_LONG_KEYSTORE_PWD); |
| | | keyStorePasswordArg = CommonArguments.getKeyStorePassword(); |
| | | argList.add(keyStorePasswordArg); |
| | | |
| | | keyStorePasswordFileArg = new FileBasedArgument("keystorePasswordFile", |
| | | OPTION_SHORT_KEYSTORE_PWD_FILE, OPTION_LONG_KEYSTORE_PWD_FILE, false, |
| | | false, INFO_KEYSTORE_PWD_FILE_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_KEYSTOREPASSWORD_FILE.get()); |
| | | keyStorePasswordFileArg.setPropertyName(OPTION_LONG_KEYSTORE_PWD_FILE); |
| | | keyStorePasswordFileArg = CommonArguments.getKeyStorePasswordFile(); |
| | | argList.add(keyStorePasswordFileArg); |
| | | |
| | | certNicknameArg = new StringArgument("certNickname", |
| | | OPTION_SHORT_CERT_NICKNAME, OPTION_LONG_CERT_NICKNAME, |
| | | false, false, true, INFO_NICKNAME_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_CERT_NICKNAME.get()); |
| | | certNicknameArg.setPropertyName(OPTION_LONG_CERT_NICKNAME); |
| | | certNicknameArg = CommonArguments.getCertNickName(); |
| | | argList.add(certNicknameArg); |
| | | |
| | | int defaultTimeout = ConnectionUtils.getDefaultLDAPTimeout(); |
| | | connectTimeoutArg = new IntegerArgument(OPTION_LONG_CONNECT_TIMEOUT, |
| | | null, OPTION_LONG_CONNECT_TIMEOUT, |
| | | false, false, true, INFO_TIMEOUT_PLACEHOLDER.get(), |
| | | defaultTimeout, null, |
| | | true, 0, false, Integer.MAX_VALUE, |
| | | INFO_DESCRIPTION_CONNECTION_TIMEOUT.get()); |
| | | connectTimeoutArg.setPropertyName(OPTION_LONG_CONNECT_TIMEOUT); |
| | | connectTimeoutArg = |
| | | CommonArguments.getConnectTimeOut(ConnectionUtils |
| | | .getDefaultLDAPTimeout()); |
| | | connectTimeoutArg.setHidden(false); |
| | | argList.add(connectTimeoutArg); |
| | | |
| | | return argList; |
| | |
| | | { |
| | | return hostNameArg.getValue(); |
| | | } |
| | | else |
| | | { |
| | | return hostNameArg.getDefaultValue(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Get the port which has to be used for the command. |
| | | * |
| | | * @return The port specified by the command line argument, or the |
| | | * default value, if not specified. |
| | | * @return The port specified by the command line argument, or the default |
| | | * value, if not specified. |
| | | */ |
| | | public String getPort() |
| | | { |
| | |
| | | { |
| | | return portArg.getValue(); |
| | | } |
| | | else |
| | | { |
| | | return portArg.getDefaultValue(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Indication if provided global options are validate. |
| | |
| | | */ |
| | | public boolean useSSL() |
| | | { |
| | | if (useSSLArg.isPresent() || alwaysSSL()) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false ; |
| | | } |
| | | return (useSSLArg.isPresent() || alwaysSSL()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public boolean useStartTLS() |
| | | { |
| | | if (useStartTLSArg.isPresent()) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false ; |
| | | } |
| | | return useStartTLSArg.isPresent(); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.forgerock.opendj.cli.*; |
| | | |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.server.tools.ToolConstants.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | |
| | | secureArgsList = new SecureConnectionCliArgs(alwaysSSL); |
| | | LinkedHashSet<Argument> set = secureArgsList.createGlobalArguments(); |
| | | |
| | | showUsageArg = new BooleanArgument("showUsage", OPTION_SHORT_HELP, |
| | | OPTION_LONG_HELP, INFO_DESCRIPTION_SHOWUSAGE.get()); |
| | | showUsageArg = CommonArguments.getShowUsage(); |
| | | setUsageArgument(showUsageArg, outStream); |
| | | set.add(showUsageArg); |
| | | |
| | | verboseArg = new BooleanArgument("verbose", OPTION_SHORT_VERBOSE, |
| | | OPTION_LONG_VERBOSE, INFO_DESCRIPTION_VERBOSE.get()); |
| | | verboseArg = CommonArguments.getVerbose(); |
| | | set.add(verboseArg); |
| | | |
| | | propertiesFileArg = 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()); |
| | | propertiesFileArg = CommonArguments.getPropertiesFile(); |
| | | setFilePropertiesArgument(propertiesFileArg); |
| | | set.add(propertiesFileArg); |
| | | |
| | | noPropertiesFileArg = new BooleanArgument( |
| | | "noPropertiesFileArgument", null, OPTION_LONG_NO_PROP_FILE, |
| | | INFO_DESCRIPTION_NO_PROP_FILE.get()); |
| | | noPropertiesFileArg = CommonArguments.getNoPropertiesFile(); |
| | | setNoPropertiesFileArgument(noPropertiesFileArg); |
| | | set.add(noPropertiesFileArg); |
| | | |
| | |
| | | errorMessages.add(message); |
| | | } |
| | | uData.setDirectoryManagerDn(dmDN); |
| | | uData.setDirectoryManagerPwd(String.valueOf(argParser.getDirectoryManagerPassword())); |
| | | uData.setDirectoryManagerPwd(argParser.getDirectoryManagerPassword()); |
| | | |
| | | // Check the validity of the base DNs |
| | | List<String> baseDNs = argParser.baseDNArg.getValues(); |
| | |
| | | true); |
| | | uData.setDirectoryManagerDn(dns.getFirst()); |
| | | |
| | | char[] pwd = argParser.getDirectoryManagerPassword(); |
| | | String pwd = argParser.getDirectoryManagerPassword(); |
| | | int nTries = 0; |
| | | while (pwd == null) |
| | | { |
| | |
| | | char[] pwd2 = |
| | | readPassword(INFO_INSTALLDS_PROMPT_CONFIRM_ROOT_PASSWORD.get()); |
| | | |
| | | if (pwd1.equals(pwd2)) |
| | | if (Arrays.equals(pwd1, pwd2)) |
| | | { |
| | | pwd = pwd1; |
| | | pwd = String.valueOf(pwd1); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | |
| | | import org.opends.admin.ads.util.ConnectionUtils; |
| | | import org.opends.quicksetup.Constants; |
| | | import org.opends.quicksetup.Installation; |
| | |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.server.admin.AdministrationConnector; |
| | | import org.opends.server.util.SetupUtils; |
| | | |
| | | import com.forgerock.opendj.cli.Argument; |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.ArgumentParser; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.FileBasedArgument; |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | |
| | | */ |
| | | public void initializeArguments() throws ArgumentException |
| | | { |
| | | testOnlyArg = new BooleanArgument( |
| | | "testOnly".toLowerCase(), 't', "testOnly", |
| | | INFO_INSTALLDS_DESCRIPTION_TESTONLY.get()); |
| | | testOnlyArg.setHidden(true); |
| | | testOnlyArg.setPropertyName("testOnly"); |
| | | testOnlyArg = CommonArguments.getTestOnly(); |
| | | addArgument(testOnlyArg); |
| | | |
| | | cliArg = new BooleanArgument( |
| | | OPTION_LONG_CLI.toLowerCase(), |
| | | OPTION_SHORT_CLI, |
| | | OPTION_LONG_CLI, |
| | | INFO_INSTALLDS_DESCRIPTION_CLI.get()); |
| | | cliArg.setPropertyName(OPTION_LONG_CLI); |
| | | cliArg = CommonArguments.getCLI(); |
| | | addArgument(cliArg); |
| | | |
| | | String defaultProgName; |
| | |
| | | progNameArg.setHidden(true); |
| | | addArgument(progNameArg); |
| | | |
| | | noPromptArg = new BooleanArgument( |
| | | OPTION_LONG_NO_PROMPT.toLowerCase(), |
| | | OPTION_SHORT_NO_PROMPT, |
| | | OPTION_LONG_NO_PROMPT, |
| | | INFO_INSTALLDS_DESCRIPTION_NO_PROMPT.get()); |
| | | noPromptArg.setPropertyName(OPTION_LONG_NO_PROMPT); |
| | | noPromptArg = CommonArguments.getNoPrompt(); |
| | | addArgument(noPromptArg); |
| | | |
| | | quietArg = new BooleanArgument( |
| | | OPTION_LONG_QUIET.toLowerCase(), OPTION_SHORT_QUIET, |
| | | OPTION_LONG_QUIET, |
| | | INFO_INSTALLDS_DESCRIPTION_SILENT.get()); |
| | | quietArg.setPropertyName(OPTION_LONG_QUIET); |
| | | quietArg = CommonArguments.getQuiet(); |
| | | addArgument(quietArg); |
| | | |
| | | verboseArg = new BooleanArgument(OPTION_LONG_VERBOSE.toLowerCase(), |
| | | OPTION_SHORT_VERBOSE, |
| | | OPTION_LONG_VERBOSE, INFO_DESCRIPTION_VERBOSE.get()); |
| | | verboseArg = CommonArguments.getVerbose(); |
| | | addArgument(verboseArg); |
| | | |
| | | propertiesFileArgument = new StringArgument( |
| | |
| | | INFO_INSTALLDS_DESCRIPTION_CERT_NICKNAME.get()); |
| | | addDefaultArgument(certNicknameArg); |
| | | |
| | | int defaultTimeout = ConnectionUtils.getDefaultLDAPTimeout(); |
| | | connectTimeoutArg = 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()); |
| | | connectTimeoutArg.setPropertyName(OPTION_LONG_CONNECT_TIMEOUT); |
| | | connectTimeoutArg.setHidden(true); |
| | | connectTimeoutArg = |
| | | CommonArguments.getConnectTimeOut(ConnectionUtils |
| | | .getDefaultLDAPTimeout()); |
| | | addArgument(connectTimeoutArg); |
| | | |
| | | acceptLicense = new BooleanArgument(OPTION_LONG_ACCEPT_LICENSE, null, |
| | | OPTION_LONG_ACCEPT_LICENSE, INFO_OPTION_ACCEPT_LICENSE.get()); |
| | | acceptLicense = CommonArguments.getAcceptLicense(); |
| | | addArgument(acceptLicense); |
| | | |
| | | showUsageArg = new BooleanArgument( |
| | | OPTION_LONG_HELP.toLowerCase(), OPTION_SHORT_HELP, |
| | | OPTION_LONG_HELP, |
| | | INFO_INSTALLDS_DESCRIPTION_HELP.get()); |
| | | showUsageArg = CommonArguments.getShowUsage(); |
| | | addArgument(showUsageArg); |
| | | setUsageArgument(showUsageArg); |
| | | } |
| | |
| | | * should be called after a call to parseArguments. |
| | | * @return the directory manager password provided by the user. |
| | | */ |
| | | public char[] getDirectoryManagerPassword() |
| | | public String getDirectoryManagerPassword() |
| | | { |
| | | String pwd = null; |
| | | if (directoryManagerPwdStringArg.isPresent()) |
| | | { |
| | | return directoryManagerPwdStringArg.getValue().toCharArray(); |
| | | pwd = directoryManagerPwdStringArg.getValue(); |
| | | } |
| | | else if (directoryManagerPwdFileArg.isPresent()) |
| | | { |
| | | return directoryManagerPwdFileArg.getValue().toCharArray(); |
| | | pwd = directoryManagerPwdFileArg.getValue(); |
| | | } |
| | | return null; |
| | | return pwd; |
| | | } |
| | | |
| | | /** |
| | |
| | | import org.opends.quicksetup.Constants; |
| | | import org.opends.quicksetup.Installation; |
| | | import org.opends.quicksetup.util.Utils; |
| | | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.ArgumentParser; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public void initializeArguments() throws ArgumentException |
| | | { |
| | | quietArg = new BooleanArgument( |
| | | "quiet", OPTION_SHORT_QUIET, |
| | | OPTION_LONG_QUIET, |
| | | INFO_JAVAPROPERTIES_DESCRIPTION_SILENT.get()); |
| | | quietArg.setPropertyName(OPTION_LONG_QUIET); |
| | | quietArg = CommonArguments.getQuiet(); |
| | | addArgument(quietArg); |
| | | |
| | | propertiesFileArg = new StringArgument("propertiesFile", |
| | |
| | | destinationFileArg.setHidden(true); |
| | | addArgument(destinationFileArg); |
| | | |
| | | showUsageArg = new BooleanArgument("help", OPTION_SHORT_HELP, |
| | | OPTION_LONG_HELP, |
| | | INFO_JAVAPROPERTIES_DESCRIPTION_HELP.get()); |
| | | showUsageArg = CommonArguments.getShowUsage(); |
| | | addArgument(showUsageArg); |
| | | setUsageArgument(showUsageArg); |
| | | } |
| | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.ArgumentParser; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.FileBasedArgument; |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | |
| | | argParser.addArgument(noop); |
| | | noop.setPropertyName(OPTION_LONG_DRYRUN); |
| | | |
| | | verbose = new BooleanArgument("verbose", 'v', "verbose", |
| | | INFO_DESCRIPTION_VERBOSE.get()); |
| | | verbose.setPropertyName("verbose"); |
| | | verbose = CommonArguments.getVerbose(); |
| | | argParser.addArgument(verbose); |
| | | |
| | | showUsage = new BooleanArgument("showUsage", OPTION_SHORT_HELP, |
| | |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.opends.server.util.EmbeddedUtils; |
| | | import org.opends.server.util.PasswordReader; |
| | | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.ArgumentParser; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.FileBasedArgument; |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | | |
| | | import org.opends.server.controls.SubtreeDeleteControl; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.server.protocols.ldap.LDAPResultCode.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | |
| | | noop.setPropertyName(OPTION_LONG_DRYRUN); |
| | | argParser.addArgument(noop); |
| | | |
| | | verbose = new BooleanArgument("verbose", 'v', "verbose", |
| | | INFO_DESCRIPTION_VERBOSE.get()); |
| | | verbose.setPropertyName("verbose"); |
| | | verbose = CommonArguments.getVerbose(); |
| | | argParser.addArgument(verbose); |
| | | |
| | | showUsage = new BooleanArgument("showUsage", OPTION_SHORT_HELP, |
| | |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | import org.opends.server.controls.*; |
| | | import org.opends.server.controls.ProxiedAuthV2Control; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.plugins.ChangeNumberControlPlugin; |
| | | import org.forgerock.opendj.ldap.DecodeException; |
| | |
| | | import org.opends.server.util.ModifyChangeRecordEntry; |
| | | import org.opends.server.util.ModifyDNChangeRecordEntry; |
| | | import org.opends.server.util.PasswordReader; |
| | | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.ArgumentParser; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.FileBasedArgument; |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | |
| | | noop.setPropertyName(OPTION_LONG_DRYRUN); |
| | | argParser.addArgument(noop); |
| | | |
| | | verbose = new BooleanArgument("verbose", 'v', "verbose", |
| | | INFO_DESCRIPTION_VERBOSE.get()); |
| | | verbose.setPropertyName("verbose"); |
| | | verbose = CommonArguments.getVerbose(); |
| | | argParser.addArgument(verbose); |
| | | |
| | | showUsage = new BooleanArgument("showUsage", OPTION_SHORT_HELP, |
| | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.ArgumentParser; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.FileBasedArgument; |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.MultiChoiceArgument; |
| | |
| | | noop.setPropertyName(OPTION_LONG_DRYRUN); |
| | | argParser.addArgument(noop); |
| | | |
| | | verbose = new BooleanArgument("verbose", 'v', "verbose", |
| | | INFO_DESCRIPTION_VERBOSE.get()); |
| | | verbose.setPropertyName("verbose"); |
| | | verbose = CommonArguments.getVerbose(); |
| | | argParser.addArgument(verbose); |
| | | |
| | | showUsage = new BooleanArgument("showUsage", OPTION_SHORT_HELP, |
| | |
| | | import com.forgerock.opendj.cli.Argument; |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.FileBasedArgument; |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.MultiChoiceArgument; |
| | |
| | | INFO_PWPSTATE_DESCRIPTION_TSPWFILE.get()); |
| | | argParser.addGlobalArgument(trustStorePWFile); |
| | | |
| | | verbose = new BooleanArgument("verbose", 'v', "verbose", |
| | | INFO_DESCRIPTION_VERBOSE.get()); |
| | | verbose.setPropertyName("verbose"); |
| | | verbose = CommonArguments.getVerbose(); |
| | | argParser.addGlobalArgument(verbose); |
| | | |
| | | showUsage = new BooleanArgument( |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2013 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools; |
| | | |
| | |
| | | */ |
| | | public static final String OPTION_LONG_PRODUCT_VERSION = "version"; |
| | | |
| | | /** |
| | | * The value for the short option description attributes. |
| | | */ |
| | | public static final char OPTION_SHORT_DESCRIPTION = 'd'; |
| | | |
| | | /** |
| | | * The value for the long option description attribute. |
| | | */ |
| | | public static final String OPTION_LONG_DESCRIPTION = "description"; |
| | | |
| | | /** |
| | | * The value for the short option groupName attributes. |
| | |
| | | public static final String OPTION_LONG_NEWGROUPNAME= "newGroupName"; |
| | | |
| | | /** |
| | | * The value for the short option member-name attributes. |
| | | */ |
| | | public static final char OPTION_SHORT_MEMBERNAME = 'm'; |
| | | |
| | | /** |
| | | * The value for the long member-name version |
| | | * attribute. |
| | | */ |
| | | public static final String OPTION_LONG_MEMBERNAME= "memberName"; |
| | | |
| | | /** |
| | | * The value for the short option backendName attributes. |
| | | */ |
| | | public static final char OPTION_SHORT_BACKENDNAME = 'b'; |
| | |
| | | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | | import com.forgerock.opendj.cli.SubCommand; |
| | | import com.forgerock.opendj.cli.SubCommandArgumentParser; |
| | |
| | | private void initializeGlobalArguments(String[] args) |
| | | throws ArgumentException { |
| | | if (globalArgumentsInitialized == false) { |
| | | verboseArgument = new BooleanArgument("verbose", 'v', "verbose", |
| | | INFO_DESCRIPTION_VERBOSE.get()); |
| | | verboseArgument = CommonArguments.getVerbose(); |
| | | |
| | | quietArgument = new BooleanArgument( |
| | | OPTION_LONG_QUIET, |
| | |
| | | import org.opends.server.admin.client.cli.TaskScheduleArgs; |
| | | import org.opends.server.extensions.ConfigFileHandler; |
| | | import org.opends.server.tasks.PurgeConflictsHistoricalTask; |
| | | |
| | | import com.forgerock.opendj.cli.Argument; |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.ArgumentGroup; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.ClientException; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.FileBasedArgument; |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | |
| | | |
| | | defaultArgs.remove(verboseArg); |
| | | |
| | | quietArg = new BooleanArgument( |
| | | OPTION_LONG_QUIET, |
| | | OPTION_SHORT_QUIET, |
| | | OPTION_LONG_QUIET, |
| | | INFO_REPLICATION_DESCRIPTION_QUIET.get()); |
| | | quietArg = CommonArguments.getQuiet(); |
| | | defaultArgs.add(index++, quietArg); |
| | | |
| | | noPromptArg = new BooleanArgument( |
| | | OPTION_LONG_NO_PROMPT, |
| | | OPTION_SHORT_NO_PROMPT, |
| | | OPTION_LONG_NO_PROMPT, |
| | | INFO_DESCRIPTION_NO_PROMPT.get()); |
| | | noPromptArg = CommonArguments.getNoPrompt(); |
| | | defaultArgs.add(index++, noPromptArg); |
| | | |
| | | displayEquivalentArgument = new BooleanArgument( |
| | | OPTION_DSCFG_LONG_DISPLAY_EQUIVALENT, |
| | | null, OPTION_DSCFG_LONG_DISPLAY_EQUIVALENT, |
| | | INFO_REPLICATION_DESCRIPTION_DISPLAY_EQUIVALENT.get()); |
| | | displayEquivalentArgument = CommonArguments.getDisplayEquivalentCommand(); |
| | | |
| | | defaultArgs.add(index++, displayEquivalentArgument); |
| | | |
| | | equivalentCommandFileArgument = new StringArgument( |
| | | OPTION_LONG_EQUIVALENT_COMMAND_FILE_PATH, null, |
| | | OPTION_LONG_EQUIVALENT_COMMAND_FILE_PATH, false, false, true, |
| | | INFO_PATH_PLACEHOLDER.get(), null, null, |
| | | equivalentCommandFileArgument = |
| | | CommonArguments |
| | | .getEquivalentCommandFile( |
| | | INFO_REPLICATION_DESCRIPTION_EQUIVALENT_COMMAND_FILE_PATH.get()); |
| | | defaultArgs.add(index++, equivalentCommandFileArgument); |
| | | |
| | | advancedArg = new BooleanArgument(OPTION_DSCFG_LONG_ADVANCED, |
| | | OPTION_DSCFG_SHORT_ADVANCED, |
| | | OPTION_DSCFG_LONG_ADVANCED, |
| | | INFO_REPLICATION_DESCRIPTION_ADVANCED.get()); |
| | | advancedArg = CommonArguments.getAdvancedMode(); |
| | | defaultArgs.add(index++, advancedArg); |
| | | |
| | | configClassArg = |
| | | new StringArgument("configclass", OPTION_SHORT_CONFIG_CLASS, |
| | | OPTION_LONG_CONFIG_CLASS, true, false, |
| | | true, INFO_CONFIGCLASS_PLACEHOLDER.get(), |
| | | ConfigFileHandler.class.getName(), null, |
| | | INFO_DESCRIPTION_CONFIG_CLASS.get()); |
| | | configClassArg.setHidden(true); |
| | | CommonArguments.getConfigClass(ConfigFileHandler.class.getName()); |
| | | defaultArgs.add(index++, configClassArg); |
| | | |
| | | configFileArg = |
| | | new StringArgument("configfile", 'f', "configFile", true, false, |
| | | true, INFO_CONFIGFILE_PLACEHOLDER.get(), null, |
| | | null, |
| | | INFO_DESCRIPTION_CONFIG_FILE.get()); |
| | | configFileArg.setHidden(true); |
| | | configFileArg = CommonArguments.getConfigFile(); |
| | | defaultArgs.add(index++, configFileArg); |
| | | |
| | | for (int i=0; i<index; i++) |
| | |
| | | arg.setPropertyName(arg.getLongIdentifier()); |
| | | } |
| | | |
| | | this.propertiesFileArgument = 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()); |
| | | this.propertiesFileArgument = CommonArguments.getPropertiesFile(); |
| | | defaultArgs.add(this.propertiesFileArgument); |
| | | setFilePropertiesArgument(this.propertiesFileArgument); |
| | | |
| | | this.noPropertiesFileArgument = new BooleanArgument( |
| | | "noPropertiesFileArgument", null, OPTION_LONG_NO_PROP_FILE, |
| | | INFO_DESCRIPTION_NO_PROP_FILE.get()); |
| | | this.noPropertiesFileArgument = CommonArguments.getNoPropertiesFile(); |
| | | defaultArgs.add(this.noPropertiesFileArgument); |
| | | setNoPropertiesFileArgument(this.noPropertiesFileArgument); |
| | | |
| | |
| | | import org.opends.server.types.NullOutputStream; |
| | | import org.opends.server.util.BuildVersion; |
| | | import org.opends.server.util.LDIFWriter; |
| | | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.ArgumentParser; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | | |
| | |
| | | argParser.addArgument(randomSeed); |
| | | |
| | | |
| | | showUsage = new BooleanArgument("help", OPTION_SHORT_HELP, |
| | | OPTION_LONG_HELP, |
| | | INFO_MAKELDIF_DESCRIPTION_HELP.get()); |
| | | showUsage = CommonArguments.getShowUsage(); |
| | | argParser.addArgument(showUsage); |
| | | argParser.setUsageArgument(showUsage); |
| | | } |
| | |
| | | |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.server.tools.ToolConstants.OPTION_LONG_NO_PROP_FILE; |
| | | import static org.opends.server.tools.ToolConstants.OPTION_LONG_PROP_FILE_PATH; |
| | | |
| | | import java.io.OutputStream; |
| | | import java.util.ArrayList; |
| | | |
| | | import org.opends.server.admin.client.cli.SecureConnectionCliArgs; |
| | | import org.opends.server.admin.client.cli.SecureConnectionCliParser; |
| | | import org.opends.server.tools.ToolConstants; |
| | | |
| | | import com.forgerock.opendj.cli.Argument; |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.IntegerArgument; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | | |
| | |
| | | defaultArgs.remove(verboseArg); |
| | | defaultArgs.remove(noPropertiesFileArg); |
| | | defaultArgs.remove(propertiesFileArg); |
| | | noPromptArg = new BooleanArgument( |
| | | ToolConstants.OPTION_LONG_NO_PROMPT, |
| | | ToolConstants.OPTION_SHORT_NO_PROMPT, |
| | | ToolConstants.OPTION_LONG_NO_PROMPT, |
| | | INFO_DESCRIPTION_NO_PROMPT.get()); |
| | | noPromptArg = CommonArguments.getNoPrompt(); |
| | | defaultArgs.add(0, noPromptArg); |
| | | |
| | | scriptFriendlyArg = new BooleanArgument( |
| | | "script-friendly", |
| | | 's', |
| | | "script-friendly", |
| | | INFO_DESCRIPTION_SCRIPT_FRIENDLY.get()); |
| | | scriptFriendlyArg = CommonArguments.getScriptFriendly(); |
| | | defaultArgs.add(1, scriptFriendlyArg); |
| | | |
| | | StringArgument propertiesFileArgument = 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()); |
| | | StringArgument propertiesFileArgument |
| | | = CommonArguments.getPropertiesFile(); |
| | | |
| | | defaultArgs.add(propertiesFileArgument); |
| | | setFilePropertiesArgument(propertiesFileArgument); |
| | | |
| | | BooleanArgument noPropertiesFileArgument = new BooleanArgument( |
| | | "noPropertiesFileArgument", null, OPTION_LONG_NO_PROP_FILE, |
| | | INFO_DESCRIPTION_NO_PROP_FILE.get()); |
| | | BooleanArgument noPropertiesFileArgument = |
| | | CommonArguments.getNoPropertiesFile(); |
| | | defaultArgs.add(noPropertiesFileArgument); |
| | | setNoPropertiesFileArgument(noPropertiesFileArgument); |
| | | |
| | |
| | | import com.forgerock.opendj.cli.ArgumentGroup; |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | | import com.forgerock.opendj.cli.ClientException; |
| | | |
| | |
| | | INFO_DESCRIPTION_TASK_TASK_ARGS.get(), 1000); |
| | | |
| | | try { |
| | | StringArgument propertiesFileArgument = 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()); |
| | | StringArgument propertiesFileArgument = |
| | | CommonArguments.getPropertiesFile(); |
| | | argParser.addArgument(propertiesFileArgument); |
| | | argParser.setFilePropertiesArgument(propertiesFileArgument); |
| | | |
| | | BooleanArgument noPropertiesFileArgument = new BooleanArgument( |
| | | "noPropertiesFileArgument", null, OPTION_LONG_NO_PROP_FILE, |
| | | INFO_DESCRIPTION_NO_PROP_FILE.get()); |
| | | BooleanArgument noPropertiesFileArgument = |
| | | CommonArguments.getNoPropertiesFile(); |
| | | argParser.addArgument(noPropertiesFileArgument); |
| | | argParser.setNoPropertiesFileArgument(noPropertiesFileArgument); |
| | | |
| | |
| | | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | | import com.forgerock.opendj.cli.SubCommandArgumentParser; |
| | | import com.forgerock.opendj.cli.ClientException; |
| | |
| | | if (!globalArgumentsInitialized) |
| | | { |
| | | configClass = |
| | | new StringArgument("configclass", OPTION_SHORT_CONFIG_CLASS, |
| | | OPTION_LONG_CONFIG_CLASS, true, false, true, |
| | | INFO_CONFIGCLASS_PLACEHOLDER.get(), ConfigFileHandler.class |
| | | .getName(), null, INFO_DESCRIPTION_CONFIG_CLASS.get()); |
| | | configClass.setHidden(true); |
| | | CommonArguments.getConfigClass(ConfigFileHandler.class.getName()); |
| | | |
| | | configFile = |
| | | new StringArgument("configfile", 'f', "configFile", true, false, |
| | | true, INFO_CONFIGFILE_PLACEHOLDER.get(), null, null, |
| | | INFO_DESCRIPTION_CONFIG_FILE.get()); |
| | | configFile.setHidden(true); |
| | | configFile = CommonArguments.getConfigFile(); |
| | | |
| | | noPrompt = |
| | | new BooleanArgument(OPTION_LONG_NO_PROMPT, OPTION_SHORT_NO_PROMPT, |
| | | OPTION_LONG_NO_PROMPT, INFO_UPGRADE_DESCRIPTION_NO_PROMPT.get()); |
| | | noPrompt = CommonArguments.getNoPrompt(); |
| | | |
| | | verbose = |
| | | new BooleanArgument(OPTION_LONG_VERBOSE, OPTION_SHORT_VERBOSE, |
| | | OPTION_LONG_VERBOSE, INFO_DESCRIPTION_VERBOSE.get()); |
| | | verbose = CommonArguments.getVerbose(); |
| | | |
| | | quietMode = |
| | | new BooleanArgument(OPTION_LONG_QUIET, OPTION_SHORT_QUIET, |
| | | OPTION_LONG_QUIET, INFO_DESCRIPTION_QUIET.get()); |
| | | quietMode = CommonArguments.getQuiet(); |
| | | |
| | | ignoreErrors = |
| | | new BooleanArgument(OPTION_LONG_IGNORE_ERRORS, null, |
| | |
| | | OPTION_LONG_FORCE_UPGRADE, |
| | | INFO_UPGRADE_OPTION_FORCE.get(OPTION_LONG_NO_PROMPT)); |
| | | |
| | | acceptLicense = new BooleanArgument(OPTION_LONG_ACCEPT_LICENSE, null, |
| | | OPTION_LONG_ACCEPT_LICENSE, INFO_OPTION_ACCEPT_LICENSE.get()); |
| | | acceptLicense = CommonArguments.getAcceptLicense(); |
| | | |
| | | showUsageArgument = |
| | | new BooleanArgument("help", OPTION_SHORT_HELP, OPTION_LONG_HELP, |
| | | INFO_DESCRIPTION_USAGE.get()); |
| | | showUsageArgument = CommonArguments.getShowUsage(); |
| | | |
| | | |
| | | // Register the global arguments. |
| | |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.NullOutputStream; |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | | import com.forgerock.opendj.cli.SubCommand; |
| | | import com.forgerock.opendj.cli.SubCommandArgumentParser; |
| | |
| | | subCommandList.add(encodeSubCommand); |
| | | |
| | | |
| | | showUsage = new BooleanArgument("help", 'H', "help", |
| | | INFO_BASE64_HELP_DESCRIPTION.get()); |
| | | showUsage = CommonArguments.getShowUsage(); |
| | | argParser.addGlobalArgument(showUsage); |
| | | argParser.setUsageGroupArgument(showUsage, subCommandList); |
| | | argParser.setUsageArgument(showUsage, NullOutputStream.printStream()); |
| | |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Properties; |
| | | |
| | | import javax.activation.DataHandler; |
| | | import javax.activation.FileDataSource; |
| | | import javax.mail.MessagingException; |
| | |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.ArgumentParser; |
| | | import com.forgerock.opendj.cli.BooleanArgument; |
| | | import com.forgerock.opendj.cli.CommonArguments; |
| | | import com.forgerock.opendj.cli.StringArgument; |
| | | |
| | | import static org.opends.messages.ToolMessages.*; |
| | |
| | | argParser.addArgument(attachFile); |
| | | |
| | | |
| | | showUsage = new BooleanArgument("help", 'H', "help", |
| | | INFO_EMAIL_HELP_DESCRIPTION.get()); |
| | | showUsage = CommonArguments.getShowUsage(); |
| | | argParser.addArgument(showUsage); |
| | | argParser.setUsageArgument(showUsage); |
| | | } |