Search in sources :

Example 1 with DurationArgument

use of com.unboundid.util.args.DurationArgument in project ldapsdk by pingidentity.

the class LDAPModify method addNonLDAPArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    ldifFile = new FileArgument('f', ARG_LDIF_FILE, false, -1, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_LDIF_FILE.get(), true, true, true, false);
    ldifFile.addLongIdentifier("filename", true);
    ldifFile.addLongIdentifier("ldif-file", true);
    ldifFile.addLongIdentifier("file-name", true);
    ldifFile.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    parser.addArgument(ldifFile);
    encryptionPassphraseFile = new FileArgument(null, "encryptionPassphraseFile", false, 1, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_ENCRYPTION_PW_FILE.get(), true, true, true, false);
    encryptionPassphraseFile.addLongIdentifier("encryption-passphrase-file", true);
    encryptionPassphraseFile.addLongIdentifier("encryptionPasswordFile", true);
    encryptionPassphraseFile.addLongIdentifier("encryption-password-file", true);
    encryptionPassphraseFile.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    parser.addArgument(encryptionPassphraseFile);
    characterSet = new StringArgument('i', "characterSet", false, 1, INFO_LDAPMODIFY_PLACEHOLDER_CHARSET.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_CHARACTER_SET.get(), "UTF-8");
    characterSet.addLongIdentifier("encoding", true);
    characterSet.addLongIdentifier("character-set", true);
    characterSet.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    parser.addArgument(characterSet);
    rejectFile = new FileArgument('R', "rejectFile", false, 1, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_REJECT_FILE.get(), false, true, true, false);
    rejectFile.addLongIdentifier("reject-file", true);
    rejectFile.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    parser.addArgument(rejectFile);
    verbose = new BooleanArgument('v', "verbose", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_VERBOSE.get());
    verbose.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    parser.addArgument(verbose);
    modifyEntriesMatchingFilter = new FilterArgument(null, "modifyEntriesMatchingFilter", false, 0, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_MODIFY_ENTRIES_MATCHING_FILTER.get(ARG_SEARCH_PAGE_SIZE));
    modifyEntriesMatchingFilter.addLongIdentifier("modify-entries-matching-filter", true);
    modifyEntriesMatchingFilter.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    parser.addArgument(modifyEntriesMatchingFilter);
    modifyEntriesMatchingFiltersFromFile = new FileArgument(null, "modifyEntriesMatchingFiltersFromFile", false, 0, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_MODIFY_FILTER_FILE.get(ARG_SEARCH_PAGE_SIZE), true, false, true, false);
    modifyEntriesMatchingFiltersFromFile.addLongIdentifier("modify-entries-matching-filters-from-file", true);
    modifyEntriesMatchingFiltersFromFile.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    parser.addArgument(modifyEntriesMatchingFiltersFromFile);
    modifyEntryWithDN = new DNArgument(null, "modifyEntryWithDN", false, 0, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_MODIFY_ENTRY_DN.get());
    modifyEntryWithDN.addLongIdentifier("modify-entry-with-dn", true);
    modifyEntryWithDN.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    parser.addArgument(modifyEntryWithDN);
    modifyEntriesWithDNsFromFile = new FileArgument(null, "modifyEntriesWithDNsFromFile", false, 0, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_MODIFY_DN_FILE.get(), true, false, true, false);
    modifyEntriesWithDNsFromFile.addLongIdentifier("modify-entries-with-dns-from-file", true);
    modifyEntriesWithDNsFromFile.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    parser.addArgument(modifyEntriesWithDNsFromFile);
    searchPageSize = new IntegerArgument(null, ARG_SEARCH_PAGE_SIZE, false, 1, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_SEARCH_PAGE_SIZE.get(modifyEntriesMatchingFilter.getIdentifierString(), modifyEntriesMatchingFiltersFromFile.getIdentifierString()), 1, Integer.MAX_VALUE);
    searchPageSize.addLongIdentifier("search-page-size", true);
    searchPageSize.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    parser.addArgument(searchPageSize);
    // NOTE:  The retryFailedOperations argument is now hidden, as we will retry
    // operations by default.  The neverRetry argument can be used to disable
    // this.
    retryFailedOperations = new BooleanArgument(null, "retryFailedOperations", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_RETRY_FAILED_OPERATIONS.get());
    retryFailedOperations.addLongIdentifier("retry-failed-operations", true);
    retryFailedOperations.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_OPS.get());
    retryFailedOperations.setHidden(true);
    parser.addArgument(retryFailedOperations);
    neverRetry = new BooleanArgument(null, "neverRetry", 1, INFO_LDAPMODIFY_ARG_DESC_NEVER_RETRY.get());
    neverRetry.addLongIdentifier("never-retry", true);
    neverRetry.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_OPS.get());
    parser.addArgument(neverRetry);
    dryRun = new BooleanArgument('n', "dryRun", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_DRY_RUN.get());
    dryRun.addLongIdentifier("dry-run", true);
    dryRun.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_OPS.get());
    parser.addArgument(dryRun);
    defaultAdd = new BooleanArgument('a', "defaultAdd", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_DEFAULT_ADD.get());
    defaultAdd.addLongIdentifier("default-add", true);
    defaultAdd.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_OPS.get());
    parser.addArgument(defaultAdd);
    continueOnError = new BooleanArgument('c', "continueOnError", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_CONTINUE_ON_ERROR.get());
    continueOnError.addLongIdentifier("continue-on-error", true);
    continueOnError.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_OPS.get());
    parser.addArgument(continueOnError);
    stripTrailingSpaces = new BooleanArgument(null, "stripTrailingSpaces", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_STRIP_TRAILING_SPACES.get());
    stripTrailingSpaces.addLongIdentifier("strip-trailing-spaces", true);
    stripTrailingSpaces.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    parser.addArgument(stripTrailingSpaces);
    followReferrals = new BooleanArgument(null, "followReferrals", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_FOLLOW_REFERRALS.get());
    followReferrals.addLongIdentifier("follow-referrals", true);
    followReferrals.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_OPS.get());
    parser.addArgument(followReferrals);
    proxyAs = new StringArgument('Y', "proxyAs", false, 1, INFO_PLACEHOLDER_AUTHZID.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_PROXY_AS.get());
    proxyAs.addLongIdentifier("proxyV2As", true);
    proxyAs.addLongIdentifier("proxy-as", true);
    proxyAs.addLongIdentifier("proxy-v2-as", true);
    proxyAs.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(proxyAs);
    proxyV1As = new DNArgument(null, "proxyV1As", false, 1, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_PROXY_V1_AS.get());
    proxyV1As.addLongIdentifier("proxy-v1-as", true);
    proxyV1As.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(proxyV1As);
    useAdministrativeSession = new BooleanArgument(null, "useAdministrativeSession", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_USE_ADMIN_SESSION.get());
    useAdministrativeSession.addLongIdentifier("use-administrative-session", true);
    useAdministrativeSession.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_OPS.get());
    parser.addArgument(useAdministrativeSession);
    operationPurpose = new StringArgument(null, "operationPurpose", false, 1, INFO_PLACEHOLDER_PURPOSE.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_OPERATION_PURPOSE.get());
    operationPurpose.addLongIdentifier("operation-purpose", true);
    operationPurpose.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(operationPurpose);
    manageDsaIT = new BooleanArgument(null, "useManageDsaIT", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_MANAGE_DSA_IT.get());
    manageDsaIT.addLongIdentifier("manageDsaIT", true);
    manageDsaIT.addLongIdentifier("use-manage-dsa-it", true);
    manageDsaIT.addLongIdentifier("manage-dsa-it", true);
    manageDsaIT.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(manageDsaIT);
    useTransaction = new BooleanArgument(null, "useTransaction", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_USE_TRANSACTION.get());
    useTransaction.addLongIdentifier("use-transaction", true);
    useTransaction.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_OPS.get());
    parser.addArgument(useTransaction);
    final Set<String> multiUpdateErrorBehaviorAllowedValues = StaticUtils.setOf("atomic", "abort-on-error", "continue-on-error");
    multiUpdateErrorBehavior = new StringArgument(null, "multiUpdateErrorBehavior", false, 1, "{atomic|abort-on-error|continue-on-error}", INFO_LDAPMODIFY_ARG_DESCRIPTION_MULTI_UPDATE_ERROR_BEHAVIOR.get(), multiUpdateErrorBehaviorAllowedValues);
    multiUpdateErrorBehavior.addLongIdentifier("multi-update-error-behavior", true);
    multiUpdateErrorBehavior.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_OPS.get());
    parser.addArgument(multiUpdateErrorBehavior);
    assertionFilter = new FilterArgument(null, "assertionFilter", false, 1, INFO_PLACEHOLDER_FILTER.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_ASSERTION_FILTER.get());
    assertionFilter.addLongIdentifier("assertion-filter", true);
    assertionFilter.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(assertionFilter);
    authorizationIdentity = new BooleanArgument('E', "authorizationIdentity", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_AUTHZ_IDENTITY.get());
    authorizationIdentity.addLongIdentifier("reportAuthzID", true);
    authorizationIdentity.addLongIdentifier("authorization-identity", true);
    authorizationIdentity.addLongIdentifier("report-authzID", true);
    authorizationIdentity.addLongIdentifier("report-authz-id", true);
    authorizationIdentity.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(authorizationIdentity);
    generatePassword = new BooleanArgument(null, "generatePassword", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_GENERATE_PASSWORD.get());
    generatePassword.addLongIdentifier("generatePW", true);
    generatePassword.addLongIdentifier("generate-password", true);
    generatePassword.addLongIdentifier("generate-pw", true);
    generatePassword.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(generatePassword);
    getAuthorizationEntryAttribute = new StringArgument(null, "getAuthorizationEntryAttribute", false, 0, INFO_PLACEHOLDER_ATTR.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_GET_AUTHZ_ENTRY_ATTR.get());
    getAuthorizationEntryAttribute.addLongIdentifier("get-authorization-entry-attribute", true);
    getAuthorizationEntryAttribute.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(getAuthorizationEntryAttribute);
    getBackendSetID = new BooleanArgument(null, "getBackendSetID", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_GET_BACKEND_SET_ID.get());
    getBackendSetID.addLongIdentifier("get-backend-set-id", true);
    getBackendSetID.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(getBackendSetID);
    getRecentLoginHistory = new BooleanArgument(null, "getRecentLoginHistory", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_GET_RECENT_LOGIN_HISTORY.get());
    getRecentLoginHistory.addLongIdentifier("get-recent-login-history", true);
    getRecentLoginHistory.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(getRecentLoginHistory);
    getServerID = new BooleanArgument(null, "getServerID", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_GET_SERVER_ID.get());
    getServerID.addLongIdentifier("get-server-id", true);
    getServerID.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(getServerID);
    getUserResourceLimits = new BooleanArgument(null, "getUserResourceLimits", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_GET_USER_RESOURCE_LIMITS.get());
    getUserResourceLimits.addLongIdentifier("get-user-resource-limits", true);
    getUserResourceLimits.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(getUserResourceLimits);
    ignoreNoUserModification = new BooleanArgument(null, "ignoreNoUserModification", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_IGNORE_NO_USER_MOD.get());
    ignoreNoUserModification.addLongIdentifier("ignore-no-user-modification", true);
    ignoreNoUserModification.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(ignoreNoUserModification);
    preReadAttribute = new StringArgument(null, "preReadAttribute", false, -1, INFO_PLACEHOLDER_ATTR.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_PRE_READ_ATTRIBUTE.get());
    preReadAttribute.addLongIdentifier("preReadAttributes", true);
    preReadAttribute.addLongIdentifier("pre-read-attribute", true);
    preReadAttribute.addLongIdentifier("pre-read-attributes", true);
    preReadAttribute.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(preReadAttribute);
    postReadAttribute = new StringArgument(null, "postReadAttribute", false, -1, INFO_PLACEHOLDER_ATTR.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_POST_READ_ATTRIBUTE.get());
    postReadAttribute.addLongIdentifier("postReadAttributes", true);
    postReadAttribute.addLongIdentifier("post-read-attribute", true);
    postReadAttribute.addLongIdentifier("post-read-attributes", true);
    postReadAttribute.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(postReadAttribute);
    routeToBackendSet = new StringArgument(null, "routeToBackendSet", false, 0, INFO_LDAPMODIFY_ARG_PLACEHOLDER_ROUTE_TO_BACKEND_SET.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_ROUTE_TO_BACKEND_SET.get());
    routeToBackendSet.addLongIdentifier("route-to-backend-set", true);
    routeToBackendSet.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(routeToBackendSet);
    routeToServer = new StringArgument(null, "routeToServer", false, 1, INFO_LDAPMODIFY_ARG_PLACEHOLDER_ROUTE_TO_SERVER.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_ROUTE_TO_SERVER.get());
    routeToServer.addLongIdentifier("route-to-server", true);
    routeToServer.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(routeToServer);
    assuredReplication = new BooleanArgument(null, "useAssuredReplication", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_ASSURED_REPLICATION.get(ARG_ASSURED_REPLICATION_LOCAL_LEVEL, ARG_ASSURED_REPLICATION_REMOTE_LEVEL, ARG_ASSURED_REPLICATION_TIMEOUT));
    assuredReplication.addLongIdentifier("assuredReplication", true);
    assuredReplication.addLongIdentifier("use-assured-replication", true);
    assuredReplication.addLongIdentifier("assured-replication", true);
    assuredReplication.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(assuredReplication);
    final Set<String> assuredReplicationLocalLevelAllowedValues = StaticUtils.setOf("none", "received-any-server", "processed-all-servers");
    assuredReplicationLocalLevel = new StringArgument(null, ARG_ASSURED_REPLICATION_LOCAL_LEVEL, false, 1, INFO_PLACEHOLDER_LEVEL.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_ASSURED_REPL_LOCAL_LEVEL.get(assuredReplication.getIdentifierString()), assuredReplicationLocalLevelAllowedValues);
    assuredReplicationLocalLevel.addLongIdentifier("assured-replication-local-level", true);
    assuredReplicationLocalLevel.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(assuredReplicationLocalLevel);
    final Set<String> assuredReplicationRemoteLevelAllowedValues = StaticUtils.setOf("none", "received-any-remote-location", "received-all-remote-locations", "processed-all-remote-servers");
    assuredReplicationRemoteLevel = new StringArgument(null, ARG_ASSURED_REPLICATION_REMOTE_LEVEL, false, 1, INFO_PLACEHOLDER_LEVEL.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_ASSURED_REPL_REMOTE_LEVEL.get(assuredReplication.getIdentifierString()), assuredReplicationRemoteLevelAllowedValues);
    assuredReplicationRemoteLevel.addLongIdentifier("assured-replication-remote-level", true);
    assuredReplicationRemoteLevel.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(assuredReplicationRemoteLevel);
    assuredReplicationTimeout = new DurationArgument(null, ARG_ASSURED_REPLICATION_TIMEOUT, false, INFO_PLACEHOLDER_TIMEOUT.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_ASSURED_REPL_TIMEOUT.get(assuredReplication.getIdentifierString()));
    assuredReplicationTimeout.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(assuredReplicationTimeout);
    replicationRepair = new BooleanArgument(null, "replicationRepair", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_REPLICATION_REPAIR.get());
    replicationRepair.addLongIdentifier("replication-repair", true);
    replicationRepair.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(replicationRepair);
    nameWithEntryUUID = new BooleanArgument(null, "nameWithEntryUUID", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_NAME_WITH_ENTRY_UUID.get());
    nameWithEntryUUID.addLongIdentifier("name-with-entryUUID", true);
    nameWithEntryUUID.addLongIdentifier("name-with-entry-uuid", true);
    nameWithEntryUUID.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(nameWithEntryUUID);
    noOperation = new BooleanArgument(null, "noOperation", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_NO_OPERATION.get());
    noOperation.addLongIdentifier("noOp", true);
    noOperation.addLongIdentifier("no-operation", true);
    noOperation.addLongIdentifier("no-op", true);
    noOperation.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(noOperation);
    passwordUpdateBehavior = new StringArgument(null, "passwordUpdateBehavior", false, 0, INFO_LDAPMODIFY_PLACEHOLDER_NAME_EQUALS_VALUE.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_PW_UPDATE_BEHAVIOR.get());
    passwordUpdateBehavior.addLongIdentifier("password-update-behavior", true);
    passwordUpdateBehavior.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(passwordUpdateBehavior);
    passwordValidationDetails = new BooleanArgument(null, "getPasswordValidationDetails", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_PASSWORD_VALIDATION_DETAILS.get(ATTR_USER_PASSWORD, ATTR_AUTH_PASSWORD));
    passwordValidationDetails.addLongIdentifier("passwordValidationDetails", true);
    passwordValidationDetails.addLongIdentifier("get-password-validation-details", true);
    passwordValidationDetails.addLongIdentifier("password-validation-details", true);
    passwordValidationDetails.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(passwordValidationDetails);
    permissiveModify = new BooleanArgument(null, "permissiveModify", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_PERMISSIVE_MODIFY.get());
    permissiveModify.addLongIdentifier("permissive-modify", true);
    permissiveModify.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(permissiveModify);
    clientSideSubtreeDelete = new BooleanArgument(null, "clientSideSubtreeDelete", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_CLIENT_SIDE_SUBTREE_DELETE.get());
    clientSideSubtreeDelete.addLongIdentifier("client-side-subtree-delete", true);
    clientSideSubtreeDelete.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(clientSideSubtreeDelete);
    serverSideSubtreeDelete = new BooleanArgument(null, "serverSideSubtreeDelete", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_SERVER_SIDE_SUBTREE_DELETE.get());
    serverSideSubtreeDelete.addLongIdentifier("server-side-subtree-delete", true);
    serverSideSubtreeDelete.addLongIdentifier("subtreeDelete", true);
    serverSideSubtreeDelete.addLongIdentifier("subtree-delete", true);
    serverSideSubtreeDelete.addLongIdentifier("subtreeDeleteControl", true);
    serverSideSubtreeDelete.addLongIdentifier("subtree-delete-control", true);
    serverSideSubtreeDelete.addLongIdentifier("useSubtreeDeleteControl", true);
    serverSideSubtreeDelete.addLongIdentifier("use-subtree-delete-control", true);
    serverSideSubtreeDelete.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(serverSideSubtreeDelete);
    softDelete = new BooleanArgument('s', "softDelete", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_SOFT_DELETE.get());
    softDelete.addLongIdentifier("useSoftDelete", true);
    softDelete.addLongIdentifier("soft-delete", true);
    softDelete.addLongIdentifier("use-soft-delete", true);
    softDelete.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(softDelete);
    hardDelete = new BooleanArgument(null, "hardDelete", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_HARD_DELETE.get());
    hardDelete.addLongIdentifier("hard-delete", true);
    hardDelete.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(hardDelete);
    allowUndelete = new BooleanArgument(null, "allowUndelete", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_ALLOW_UNDELETE.get(ATTR_UNDELETE_FROM_DN));
    allowUndelete.addLongIdentifier("allow-undelete", true);
    allowUndelete.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(allowUndelete);
    retireCurrentPassword = new BooleanArgument(null, "retireCurrentPassword", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_RETIRE_CURRENT_PASSWORD.get(ATTR_USER_PASSWORD, ATTR_AUTH_PASSWORD));
    retireCurrentPassword.addLongIdentifier("retire-current-password", true);
    retireCurrentPassword.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(retireCurrentPassword);
    purgeCurrentPassword = new BooleanArgument(null, "purgeCurrentPassword", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_PURGE_CURRENT_PASSWORD.get(ATTR_USER_PASSWORD, ATTR_AUTH_PASSWORD));
    purgeCurrentPassword.addLongIdentifier("purge-current-password", true);
    purgeCurrentPassword.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(purgeCurrentPassword);
    final Set<String> suppressOperationalAttributeUpdatesAllowedValues = StaticUtils.setOf("last-access-time", "last-login-time", "last-login-ip", "lastmod");
    suppressOperationalAttributeUpdates = new StringArgument(null, "suppressOperationalAttributeUpdates", false, -1, INFO_PLACEHOLDER_ATTR.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_SUPPRESS_OP_ATTR_UPDATES.get(), suppressOperationalAttributeUpdatesAllowedValues);
    suppressOperationalAttributeUpdates.addLongIdentifier("suppress-operational-attribute-updates", true);
    suppressOperationalAttributeUpdates.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(suppressOperationalAttributeUpdates);
    suppressReferentialIntegrityUpdates = new BooleanArgument(null, "suppressReferentialIntegrityUpdates", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_SUPPRESS_REFERINT_UPDATES.get());
    suppressReferentialIntegrityUpdates.addLongIdentifier("suppress-referential-integrity-updates", true);
    suppressReferentialIntegrityUpdates.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(suppressReferentialIntegrityUpdates);
    usePasswordPolicyControl = new BooleanArgument(null, "usePasswordPolicyControl", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_PASSWORD_POLICY.get());
    usePasswordPolicyControl.addLongIdentifier("use-password-policy-control", true);
    usePasswordPolicyControl.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(usePasswordPolicyControl);
    uniquenessAttribute = new StringArgument(null, "uniquenessAttribute", false, 0, INFO_PLACEHOLDER_ATTR.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_UNIQUE_ATTR.get());
    uniquenessAttribute.addLongIdentifier("uniquenessAttributeType", true);
    uniquenessAttribute.addLongIdentifier("uniqueAttribute", true);
    uniquenessAttribute.addLongIdentifier("uniqueAttributeType", true);
    uniquenessAttribute.addLongIdentifier("uniqueness-attribute", true);
    uniquenessAttribute.addLongIdentifier("uniqueness-attribute-type", true);
    uniquenessAttribute.addLongIdentifier("unique-attribute", true);
    uniquenessAttribute.addLongIdentifier("unique-attribute-type", true);
    uniquenessAttribute.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(uniquenessAttribute);
    uniquenessFilter = new FilterArgument(null, "uniquenessFilter", false, 1, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_UNIQUE_FILTER.get());
    uniquenessFilter.addLongIdentifier("uniqueness-filter", true);
    uniquenessFilter.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(uniquenessFilter);
    uniquenessBaseDN = new DNArgument(null, "uniquenessBaseDN", false, 1, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_UNIQUE_BASE_DN.get());
    uniquenessBaseDN.addLongIdentifier("uniqueness-base-dn", true);
    uniquenessBaseDN.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(uniquenessBaseDN);
    parser.addDependentArgumentSet(uniquenessBaseDN, uniquenessAttribute, uniquenessFilter);
    final Set<String> mabValues = StaticUtils.setOf("unique-within-each-attribute", "unique-across-all-attributes-including-in-same-entry", "unique-across-all-attributes-except-in-same-entry", "unique-in-combination");
    uniquenessMultipleAttributeBehavior = new StringArgument(null, "uniquenessMultipleAttributeBehavior", false, 1, INFO_LDAPMODIFY_PLACEHOLDER_BEHAVIOR.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_UNIQUE_MULTIPLE_ATTRIBUTE_BEHAVIOR.get(), mabValues);
    uniquenessMultipleAttributeBehavior.addLongIdentifier("uniqueness-multiple-attribute-behavior", true);
    uniquenessMultipleAttributeBehavior.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(uniquenessMultipleAttributeBehavior);
    parser.addDependentArgumentSet(uniquenessMultipleAttributeBehavior, uniquenessAttribute);
    final Set<String> vlValues = StaticUtils.setOf("none", "all-subtree-views", "all-backend-sets", "all-available-backend-servers");
    uniquenessPreCommitValidationLevel = new StringArgument(null, "uniquenessPreCommitValidationLevel", false, 1, INFO_LDAPMODIFY_PLACEHOLDER_LEVEL.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_UNIQUE_PRE_COMMIT_LEVEL.get(), vlValues);
    uniquenessPreCommitValidationLevel.addLongIdentifier("uniqueness-pre-commit-validation-level", true);
    uniquenessPreCommitValidationLevel.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(uniquenessPreCommitValidationLevel);
    parser.addDependentArgumentSet(uniquenessPreCommitValidationLevel, uniquenessAttribute, uniquenessFilter);
    uniquenessPostCommitValidationLevel = new StringArgument(null, "uniquenessPostCommitValidationLevel", false, 1, INFO_LDAPMODIFY_PLACEHOLDER_LEVEL.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_UNIQUE_POST_COMMIT_LEVEL.get(), vlValues);
    uniquenessPostCommitValidationLevel.addLongIdentifier("uniqueness-post-commit-validation-level", true);
    uniquenessPostCommitValidationLevel.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(uniquenessPostCommitValidationLevel);
    parser.addDependentArgumentSet(uniquenessPostCommitValidationLevel, uniquenessAttribute, uniquenessFilter);
    operationControl = new ControlArgument('J', "control", false, 0, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_OP_CONTROL.get());
    operationControl.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(operationControl);
    addControl = new ControlArgument(null, "addControl", false, 0, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_ADD_CONTROL.get());
    addControl.addLongIdentifier("add-control", true);
    addControl.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(addControl);
    bindControl = new ControlArgument(null, "bindControl", false, 0, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_BIND_CONTROL.get());
    bindControl.addLongIdentifier("bind-control", true);
    bindControl.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(bindControl);
    deleteControl = new ControlArgument(null, "deleteControl", false, 0, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_DELETE_CONTROL.get());
    deleteControl.addLongIdentifier("delete-control", true);
    deleteControl.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(deleteControl);
    modifyControl = new ControlArgument(null, "modifyControl", false, 0, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_MODIFY_CONTROL.get());
    modifyControl.addLongIdentifier("modify-control", true);
    modifyControl.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(modifyControl);
    modifyDNControl = new ControlArgument(null, "modifyDNControl", false, 0, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_MODIFY_DN_CONTROL.get());
    modifyDNControl.addLongIdentifier("modify-dn-control", true);
    modifyDNControl.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_CONTROLS.get());
    parser.addArgument(modifyDNControl);
    ratePerSecond = new IntegerArgument('r', "ratePerSecond", false, 1, INFO_PLACEHOLDER_NUM.get(), INFO_LDAPMODIFY_ARG_DESCRIPTION_RATE_PER_SECOND.get(), 1, Integer.MAX_VALUE);
    ratePerSecond.addLongIdentifier("rate-per-second", true);
    ratePerSecond.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_OPS.get());
    parser.addArgument(ratePerSecond);
    // The "--scriptFriendly" argument is provided for compatibility with legacy
    // ldapmodify tools, but is not actually used by this tool.
    final BooleanArgument scriptFriendly = new BooleanArgument(null, "scriptFriendly", 1, INFO_LDAPMODIFY_ARG_DESCRIPTION_SCRIPT_FRIENDLY.get());
    scriptFriendly.addLongIdentifier("script-friendly", true);
    scriptFriendly.setArgumentGroupName(INFO_LDAPMODIFY_ARG_GROUP_DATA.get());
    scriptFriendly.setHidden(true);
    parser.addArgument(scriptFriendly);
    // The "-V" / "--ldapVersion" argument is provided for compatibility with
    // legacy ldapmodify tools, but is not actually used by this tool.
    final IntegerArgument ldapVersion = new IntegerArgument('V', "ldapVersion", false, 1, null, INFO_LDAPMODIFY_ARG_DESCRIPTION_LDAP_VERSION.get());
    ldapVersion.addLongIdentifier("ldap-version", true);
    ldapVersion.setHidden(true);
    parser.addArgument(ldapVersion);
    // A few assured replication arguments will only be allowed if assured
    // replication is to be used.
    parser.addDependentArgumentSet(assuredReplicationLocalLevel, assuredReplication);
    parser.addDependentArgumentSet(assuredReplicationRemoteLevel, assuredReplication);
    parser.addDependentArgumentSet(assuredReplicationTimeout, assuredReplication);
    // Transactions will be incompatible with a lot of settings.
    parser.addExclusiveArgumentSet(useTransaction, multiUpdateErrorBehavior);
    parser.addExclusiveArgumentSet(useTransaction, rejectFile);
    parser.addExclusiveArgumentSet(useTransaction, retryFailedOperations);
    parser.addExclusiveArgumentSet(useTransaction, continueOnError);
    parser.addExclusiveArgumentSet(useTransaction, dryRun);
    parser.addExclusiveArgumentSet(useTransaction, followReferrals);
    parser.addExclusiveArgumentSet(useTransaction, nameWithEntryUUID);
    parser.addExclusiveArgumentSet(useTransaction, noOperation);
    parser.addExclusiveArgumentSet(useTransaction, modifyEntriesMatchingFilter);
    parser.addExclusiveArgumentSet(useTransaction, modifyEntriesMatchingFiltersFromFile);
    parser.addExclusiveArgumentSet(useTransaction, modifyEntryWithDN);
    parser.addExclusiveArgumentSet(useTransaction, modifyEntriesWithDNsFromFile);
    parser.addExclusiveArgumentSet(useTransaction, clientSideSubtreeDelete);
    // Multi-update is incompatible with a lot of settings.
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, ratePerSecond);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, rejectFile);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, retryFailedOperations);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, continueOnError);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, dryRun);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, followReferrals);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, nameWithEntryUUID);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, noOperation);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, modifyEntriesMatchingFilter);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, modifyEntriesMatchingFiltersFromFile);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, modifyEntryWithDN);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, modifyEntriesWithDNsFromFile);
    parser.addExclusiveArgumentSet(multiUpdateErrorBehavior, clientSideSubtreeDelete);
    // Client-side and server-side subtree deletes cannot be used together.
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, serverSideSubtreeDelete);
    // Soft delete cannot be used with either hard delete or subtree delete.
    parser.addExclusiveArgumentSet(softDelete, hardDelete);
    parser.addExclusiveArgumentSet(softDelete, clientSideSubtreeDelete);
    parser.addExclusiveArgumentSet(softDelete, serverSideSubtreeDelete);
    // Client-side subtree delete cannot be used in conjunction with a few
    // other settings.
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, followReferrals);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, preReadAttribute);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, getBackendSetID);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, getServerID);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, noOperation);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, dryRun);
    // Password retiring and purging can't be used together.
    parser.addExclusiveArgumentSet(retireCurrentPassword, purgeCurrentPassword);
    // Referral following cannot be used in conjunction with the manageDsaIT
    // control.
    parser.addExclusiveArgumentSet(followReferrals, manageDsaIT);
    // The proxyAs and proxyV1As arguments cannot be used together.
    parser.addExclusiveArgumentSet(proxyAs, proxyV1As);
    // The modifyEntriesMatchingFilter argument is incompatible with a lot of
    // settings, since it can only be used for modify operations.
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, allowUndelete);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, defaultAdd);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, dryRun);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, hardDelete);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, ignoreNoUserModification);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, nameWithEntryUUID);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, softDelete);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, clientSideSubtreeDelete);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, serverSideSubtreeDelete);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, suppressReferentialIntegrityUpdates);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, addControl);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, deleteControl);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFilter, modifyDNControl);
    // The modifyEntriesMatchingFilterFromFile argument is incompatible with a
    // lot of settings, since it can only be used for modify operations.
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, allowUndelete);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, defaultAdd);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, dryRun);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, hardDelete);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, ignoreNoUserModification);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, nameWithEntryUUID);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, softDelete);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, clientSideSubtreeDelete);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, serverSideSubtreeDelete);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, suppressReferentialIntegrityUpdates);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, addControl);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, deleteControl);
    parser.addExclusiveArgumentSet(modifyEntriesMatchingFiltersFromFile, modifyDNControl);
    // The modifyEntryWithDN argument is incompatible with a lot of
    // settings, since it can only be used for modify operations.
    parser.addExclusiveArgumentSet(modifyEntryWithDN, allowUndelete);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, defaultAdd);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, dryRun);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, hardDelete);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, ignoreNoUserModification);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, nameWithEntryUUID);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, softDelete);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, clientSideSubtreeDelete);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, serverSideSubtreeDelete);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, suppressReferentialIntegrityUpdates);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, addControl);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, deleteControl);
    parser.addExclusiveArgumentSet(modifyEntryWithDN, modifyDNControl);
    // The modifyEntriesWithDNsFromFile argument is incompatible with a lot of
    // settings, since it can only be used for modify operations.
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, allowUndelete);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, defaultAdd);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, dryRun);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, hardDelete);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, ignoreNoUserModification);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, nameWithEntryUUID);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, softDelete);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, clientSideSubtreeDelete);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, serverSideSubtreeDelete);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, suppressReferentialIntegrityUpdates);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, addControl);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, deleteControl);
    parser.addExclusiveArgumentSet(modifyEntriesWithDNsFromFile, modifyDNControl);
}
Also used : ControlArgument(com.unboundid.util.args.ControlArgument) DNArgument(com.unboundid.util.args.DNArgument) DurationArgument(com.unboundid.util.args.DurationArgument) FilterArgument(com.unboundid.util.args.FilterArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) ASN1OctetString(com.unboundid.asn1.ASN1OctetString) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument)

Example 2 with DurationArgument

use of com.unboundid.util.args.DurationArgument in project ldapsdk by pingidentity.

the class LDAPPasswordModify method addNonLDAPArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    argumentParser = parser;
    // Authorization identity arguments.
    userIdentity = new StringArgument('a', "userIdentity", false, 1, INFO_PWMOD_ARG_PLACEHOLDER_DN_OR_AUTHZID.get(), INFO_PWMOD_ARG_DESC_USER_IDENTITY.get());
    userIdentity.addLongIdentifier("user-identity", true);
    userIdentity.addLongIdentifier("userDN", true);
    userIdentity.addLongIdentifier("user-dn", true);
    userIdentity.addLongIdentifier("authzID", true);
    userIdentity.addLongIdentifier("authz-id", true);
    userIdentity.addLongIdentifier("authorizationID", true);
    userIdentity.addLongIdentifier("authorization-id", true);
    userIdentity.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_USER_IDENTITY.get());
    parser.addArgument(userIdentity);
    provideBindDNAsUserIdentity = new BooleanArgument('A', "provideBindDNAsUserIdentity", 1, INFO_PWMOD_ARG_DESC_PROVIDE_BIND_DN_AS_USER_IDENTITY.get());
    provideBindDNAsUserIdentity.addLongIdentifier("provide-bind-dn-as-user-identity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("provideBindDNForUserIdentity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("provide-bind-dn-for-user-identity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("provideDNAsUserIdentity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("provide-dn-as-user-identity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("provideDNForUserIdentity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("provide-dn-for-user-identity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("useBindDNAsUserIdentity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("use-bind-dn-as-user-identity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("useBindDNForUserIdentity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("use-bind-dn-for-user-identity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("useDNAsUserIdentity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("use-dn-as-user-identity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("useDNForUserIdentity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("use-dn-for-user-identity", true);
    provideBindDNAsUserIdentity.addLongIdentifier("useBindDNForAuthzID", true);
    provideBindDNAsUserIdentity.addLongIdentifier("use-bind-dn-for-authz-id", true);
    provideBindDNAsUserIdentity.addLongIdentifier("provideDNForAuthzID", true);
    provideBindDNAsUserIdentity.addLongIdentifier("provide-dn-for-authz-id", true);
    provideBindDNAsUserIdentity.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_USER_IDENTITY.get());
    parser.addArgument(provideBindDNAsUserIdentity);
    usernameAttribute = new StringArgument(null, "usernameAttribute", false, 0, INFO_PWMOD_ARG_PLACEHOLDER_ATTRIBUTE_NAME.get(), INFO_PWMOD_ARG_DESC_USERNAME_ATTRIBUTE.get());
    usernameAttribute.addLongIdentifier("username-attribute", true);
    usernameAttribute.addLongIdentifier("usernameAttr", true);
    usernameAttribute.addLongIdentifier("username-attr", true);
    usernameAttribute.addLongIdentifier("userIDAttribute", true);
    usernameAttribute.addLongIdentifier("user-id-attribute", true);
    usernameAttribute.addLongIdentifier("userIDAttr", true);
    usernameAttribute.addLongIdentifier("user-id-attr", true);
    usernameAttribute.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_USER_IDENTITY.get());
    parser.addArgument(usernameAttribute);
    searchBaseDN = new DNArgument('b', "searchBaseDN", false, 0, null, INFO_PWMOD_ARG_DESC_SEARCH_BASE_DN.get(), DN.NULL_DN);
    searchBaseDN.addLongIdentifier("search-base-dn", true);
    searchBaseDN.addLongIdentifier("baseDN", true);
    searchBaseDN.addLongIdentifier("base-dn", true);
    searchBaseDN.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_USER_IDENTITY.get());
    parser.addArgument(searchBaseDN);
    // New password arguments.
    newPassword = new StringArgument('n', "newPassword", false, 1, INFO_PWMOD_ARG_PLACEHOLDER_PASSWORD.get(), INFO_PWMOD_ARG_DESC_NEW_PASSWORD.get());
    newPassword.addLongIdentifier("new-password", true);
    newPassword.addLongIdentifier("newPW", true);
    newPassword.addLongIdentifier("new-pw", true);
    newPassword.addLongIdentifier("new", true);
    newPassword.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_NEW_PASSWORD.get());
    parser.addArgument(newPassword);
    newPasswordFile = new FileArgument('N', "newPasswordFile", false, 1, null, INFO_PWMOD_ARG_DESC_NEW_PASSWORD_FILE.get(), true, true, true, false);
    newPasswordFile.addLongIdentifier("new-password-file", true);
    newPasswordFile.addLongIdentifier("newPWFile", true);
    newPasswordFile.addLongIdentifier("new-pw-file", true);
    newPasswordFile.addLongIdentifier("newFile", true);
    newPasswordFile.addLongIdentifier("new-file", true);
    newPasswordFile.addLongIdentifier("newPasswordPath", true);
    newPasswordFile.addLongIdentifier("new-password-path", true);
    newPasswordFile.addLongIdentifier("newPWPath", true);
    newPasswordFile.addLongIdentifier("new-pw-path", true);
    newPasswordFile.addLongIdentifier("newPath", true);
    newPasswordFile.addLongIdentifier("new-path", true);
    newPasswordFile.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_NEW_PASSWORD.get());
    parser.addArgument(newPasswordFile);
    promptForNewPassword = new BooleanArgument(null, "promptForNewPassword", 1, INFO_PWMOD_ARG_DESC_PROMPT_FOR_NEW_PASSWORD.get());
    promptForNewPassword.addLongIdentifier("prompt-for-new-password", true);
    promptForNewPassword.addLongIdentifier("promptForNewPW", true);
    promptForNewPassword.addLongIdentifier("prompt-for-new-pw", true);
    promptForNewPassword.addLongIdentifier("promptForNew", true);
    promptForNewPassword.addLongIdentifier("prompt-for-new", true);
    promptForNewPassword.addLongIdentifier("promptNew", true);
    promptForNewPassword.addLongIdentifier("prompt-new", true);
    promptForNewPassword.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_NEW_PASSWORD.get());
    parser.addArgument(promptForNewPassword);
    generateClientSideNewPassword = new BooleanArgument(null, "generateClientSideNewPassword", 1, INFO_PWMOD_ARG_DESC_GENERATE_CLIENT_SIDE_NEW_PASSWORD.get());
    generateClientSideNewPassword.addLongIdentifier("generate-client-side-new-password", true);
    generateClientSideNewPassword.addLongIdentifier("generateClientSideNewPW", true);
    generateClientSideNewPassword.addLongIdentifier("generate-client-side-new-pw", true);
    generateClientSideNewPassword.addLongIdentifier("generateNewPassword", true);
    generateClientSideNewPassword.addLongIdentifier("generate-new-password", true);
    generateClientSideNewPassword.addLongIdentifier("generateNewPW", true);
    generateClientSideNewPassword.addLongIdentifier("generate-new-pw", true);
    generateClientSideNewPassword.addLongIdentifier("generatePassword", true);
    generateClientSideNewPassword.addLongIdentifier("generate-password", true);
    generateClientSideNewPassword.addLongIdentifier("generatePW", true);
    generateClientSideNewPassword.addLongIdentifier("generate-pw", true);
    generateClientSideNewPassword.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_NEW_PASSWORD.get());
    parser.addArgument(generateClientSideNewPassword);
    generatedPasswordLength = new IntegerArgument(null, "generatedPasswordLength", false, 1, INFO_PWMOD_ARG_PLACEHOLDER_LENGTH.get(), INFO_PWMOD_ARG_DESC_GENERATED_PASSWORD_LENGTH.get(), 1, Integer.MAX_VALUE, 12);
    generatedPasswordLength.addLongIdentifier("generated-password-length", true);
    generatedPasswordLength.addLongIdentifier("generatedPWLength", true);
    generatedPasswordLength.addLongIdentifier("generated-pw-length", true);
    generatedPasswordLength.addLongIdentifier("passwordLength", true);
    generatedPasswordLength.addLongIdentifier("password-length", true);
    generatedPasswordLength.addLongIdentifier("pwLength", true);
    generatedPasswordLength.addLongIdentifier("pw-length", true);
    generatedPasswordLength.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_NEW_PASSWORD.get());
    parser.addArgument(generatedPasswordLength);
    generatedPasswordCharacterSet = new StringArgument(null, "generatedPasswordCharacterSet", false, 0, INFO_PWMOD_ARG_PLACEHOLDER_CHARS.get(), INFO_PWMOD_ARG_DESC_GENERATED_PASSWORD_CHARACTER_SET.get(), null, Collections.unmodifiableList(Arrays.asList(// Note that some letters and
    "abcdefghijmnopqrstuvwxyz", // digits are missing in an attempt
    "ABCDEFGHJLMNPQRSTUVWXYZ", // to avoid ambiguous characters.
    "23456789", "@#-_=+.")));
    generatedPasswordCharacterSet.addLongIdentifier("generated-password-character-set", true);
    generatedPasswordCharacterSet.addLongIdentifier("generatedPWCharacterSet", true);
    generatedPasswordCharacterSet.addLongIdentifier("generated-pw-character-set", true);
    generatedPasswordCharacterSet.addLongIdentifier("generatedPasswordCharSet", true);
    generatedPasswordCharacterSet.addLongIdentifier("generated-password-char-set", true);
    generatedPasswordCharacterSet.addLongIdentifier("generated-password-charset", true);
    generatedPasswordCharacterSet.addLongIdentifier("generatedPWCharSet", true);
    generatedPasswordCharacterSet.addLongIdentifier("generated-pw-char-set", true);
    generatedPasswordCharacterSet.addLongIdentifier("generated-pw-charset", true);
    generatedPasswordCharacterSet.addLongIdentifier("generatedPasswordCharacters", true);
    generatedPasswordCharacterSet.addLongIdentifier("generated-password-characters", true);
    generatedPasswordCharacterSet.addLongIdentifier("generatedPWCharacters", true);
    generatedPasswordCharacterSet.addLongIdentifier("generated-pw-characters", true);
    generatedPasswordCharacterSet.addLongIdentifier("generatedPasswordChars", true);
    generatedPasswordCharacterSet.addLongIdentifier("generated-password-chars", true);
    generatedPasswordCharacterSet.addLongIdentifier("generatedPWChars", true);
    generatedPasswordCharacterSet.addLongIdentifier("generated-pw-chars", true);
    generatedPasswordCharacterSet.addLongIdentifier("passwordCharacters", true);
    generatedPasswordCharacterSet.addLongIdentifier("password-characters", true);
    generatedPasswordCharacterSet.addLongIdentifier("pwCharacters", true);
    generatedPasswordCharacterSet.addLongIdentifier("pw-characters", true);
    generatedPasswordCharacterSet.addLongIdentifier("passwordCharacterSet", true);
    generatedPasswordCharacterSet.addLongIdentifier("password-character-set", true);
    generatedPasswordCharacterSet.addLongIdentifier("pwCharacterSet", true);
    generatedPasswordCharacterSet.addLongIdentifier("pw-character-set", true);
    generatedPasswordCharacterSet.addLongIdentifier("passwordCharSet", true);
    generatedPasswordCharacterSet.addLongIdentifier("password-charset", true);
    generatedPasswordCharacterSet.addLongIdentifier("password-char-set", true);
    generatedPasswordCharacterSet.addLongIdentifier("pwCharSet", true);
    generatedPasswordCharacterSet.addLongIdentifier("pw-charset", true);
    generatedPasswordCharacterSet.addLongIdentifier("pw-char-set", true);
    generatedPasswordCharacterSet.addLongIdentifier("passwordChars", true);
    generatedPasswordCharacterSet.addLongIdentifier("password-chars", true);
    generatedPasswordCharacterSet.addLongIdentifier("pw-chars", true);
    generatedPasswordCharacterSet.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_NEW_PASSWORD.get());
    parser.addArgument(generatedPasswordCharacterSet);
    // Current password arguments.
    currentPassword = new StringArgument('c', "currentPassword", false, 1, INFO_PWMOD_ARG_PLACEHOLDER_PASSWORD.get(), INFO_PWMOD_ARG_DESC_CURRENT_PASSWORD.get());
    currentPassword.addLongIdentifier("current-password", true);
    currentPassword.addLongIdentifier("currentPW", true);
    currentPassword.addLongIdentifier("current-pw", true);
    currentPassword.addLongIdentifier("current", true);
    currentPassword.addLongIdentifier("oldPassword", true);
    currentPassword.addLongIdentifier("old-password", true);
    currentPassword.addLongIdentifier("oldPW", true);
    currentPassword.addLongIdentifier("old-pw", true);
    currentPassword.addLongIdentifier("old", true);
    currentPassword.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_CURRENT_PASSWORD.get());
    parser.addArgument(currentPassword);
    currentPasswordFile = new FileArgument('C', "currentPasswordFile", false, 1, null, INFO_PWMOD_ARG_DESC_CURRENT_PASSWORD_FILE.get(), true, true, true, false);
    currentPasswordFile.addLongIdentifier("current-password-file", true);
    currentPasswordFile.addLongIdentifier("currentPWFile", true);
    currentPasswordFile.addLongIdentifier("current-pw-file", true);
    currentPasswordFile.addLongIdentifier("currentFile", true);
    currentPasswordFile.addLongIdentifier("current-file", true);
    currentPasswordFile.addLongIdentifier("currentPasswordPath", true);
    currentPasswordFile.addLongIdentifier("current-password-path", true);
    currentPasswordFile.addLongIdentifier("currentPWPath", true);
    currentPasswordFile.addLongIdentifier("current-pw-path", true);
    currentPasswordFile.addLongIdentifier("currentPath", true);
    currentPasswordFile.addLongIdentifier("current-path", true);
    currentPasswordFile.addLongIdentifier("oldPasswordFile", true);
    currentPasswordFile.addLongIdentifier("old-password-file", true);
    currentPasswordFile.addLongIdentifier("oldPWFile", true);
    currentPasswordFile.addLongIdentifier("old-pw-file", true);
    currentPasswordFile.addLongIdentifier("oldFile", true);
    currentPasswordFile.addLongIdentifier("old-file", true);
    currentPasswordFile.addLongIdentifier("oldPasswordPath", true);
    currentPasswordFile.addLongIdentifier("old-password-path", true);
    currentPasswordFile.addLongIdentifier("oldPWPath", true);
    currentPasswordFile.addLongIdentifier("old-pw-path", true);
    currentPasswordFile.addLongIdentifier("oldPath", true);
    currentPasswordFile.addLongIdentifier("old-path", true);
    currentPasswordFile.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_CURRENT_PASSWORD.get());
    parser.addArgument(currentPasswordFile);
    promptForCurrentPassword = new BooleanArgument(null, "promptForCurrentPassword", 1, INFO_PWMOD_ARG_DESC_PROMPT_FOR_CURRENT_PASSWORD.get());
    promptForCurrentPassword.addLongIdentifier("prompt-for-current-password", true);
    promptForCurrentPassword.addLongIdentifier("promptForCurrentPW", true);
    promptForCurrentPassword.addLongIdentifier("prompt-for-current-pw", true);
    promptForCurrentPassword.addLongIdentifier("promptForCurrent", true);
    promptForCurrentPassword.addLongIdentifier("prompt-for-current", true);
    promptForCurrentPassword.addLongIdentifier("promptCurrent", true);
    promptForCurrentPassword.addLongIdentifier("prompt-current", true);
    promptForCurrentPassword.addLongIdentifier("promptForOldPassword", true);
    promptForCurrentPassword.addLongIdentifier("prompt-for-old-password", true);
    promptForCurrentPassword.addLongIdentifier("promptForOldPW", true);
    promptForCurrentPassword.addLongIdentifier("prompt-for-old-pw", true);
    promptForCurrentPassword.addLongIdentifier("promptForOld", true);
    promptForCurrentPassword.addLongIdentifier("prompt-for-old", true);
    promptForCurrentPassword.addLongIdentifier("promptOld", true);
    promptForCurrentPassword.addLongIdentifier("prompt-old", true);
    promptForCurrentPassword.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_CURRENT_PASSWORD.get());
    parser.addArgument(promptForCurrentPassword);
    // Bind control arguments.
    bindControl = new ControlArgument(null, "bindControl", false, 0, null, INFO_PWMOD_ARG_DESC_BIND_CONTROL.get());
    bindControl.addLongIdentifier("bind-control", true);
    bindControl.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_BIND_CONTROL.get());
    parser.addArgument(bindControl);
    useAuthorizationIdentityControl = new BooleanArgument(null, "useAuthorizationIdentityControl", 1, INFO_PWMOD_ARG_DESC_USE_AUTHZ_ID_CONTROL.get());
    useAuthorizationIdentityControl.addLongIdentifier("use-authorization-identity-control", true);
    useAuthorizationIdentityControl.addLongIdentifier("useAuthorizationID-control", true);
    useAuthorizationIdentityControl.addLongIdentifier("use-authorization-id-control", true);
    useAuthorizationIdentityControl.addLongIdentifier("authorizationIdentityControl", true);
    useAuthorizationIdentityControl.addLongIdentifier("authorization-identity-control", true);
    useAuthorizationIdentityControl.addLongIdentifier("authorizationIDControl", true);
    useAuthorizationIdentityControl.addLongIdentifier("authorization-id-control", true);
    useAuthorizationIdentityControl.addLongIdentifier("authzIDControl", true);
    useAuthorizationIdentityControl.addLongIdentifier("authz-id-control", true);
    useAuthorizationIdentityControl.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_BIND_CONTROL.get());
    parser.addArgument(useAuthorizationIdentityControl);
    usePasswordPolicyControlOnBind = new BooleanArgument(null, "usePasswordPolicyControlOnBind", 1, INFO_PWMOD_ARG_DESC_USE_PW_POLICY_CONTROL_ON_BIND.get());
    usePasswordPolicyControlOnBind.addLongIdentifier("use-password-policy-control-on-bind", true);
    usePasswordPolicyControlOnBind.addLongIdentifier("usePWPolicyControlOnBind", true);
    usePasswordPolicyControlOnBind.addLongIdentifier("use-pw-policy-control-on-bind", true);
    usePasswordPolicyControlOnBind.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_BIND_CONTROL.get());
    parser.addArgument(usePasswordPolicyControlOnBind);
    getAuthorizationEntryAttribute = new StringArgument(null, "getAuthorizationEntryAttribute", false, 0, INFO_PWMOD_ARG_PLACEHOLDER_ATTRIBUTE_NAME.get(), INFO_PWMOD_ARG_DESC_GET_AUTHZ_ENTRY_ATTRIBUTE.get());
    getAuthorizationEntryAttribute.addLongIdentifier("get-authorization-entry-attribute", true);
    getAuthorizationEntryAttribute.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_BIND_CONTROL.get());
    parser.addArgument(getAuthorizationEntryAttribute);
    getUserResourceLimits = new BooleanArgument(null, "getUserResourceLimits", 1, INFO_PWMOD_ARG_DESC_GET_USER_RESOURCE_LIMITS.get());
    getUserResourceLimits.addLongIdentifier("get-user-resource-limits", true);
    getUserResourceLimits.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_BIND_CONTROL.get());
    parser.addArgument(getUserResourceLimits);
    // Update control arguments.
    updateControl = new ControlArgument('J', "updateControl", false, 0, null, INFO_PWMOD_ARG_DESC_UPDATE_CONTROL.get());
    updateControl.addLongIdentifier("update-control", true);
    updateControl.addLongIdentifier("control", true);
    updateControl.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(updateControl);
    usePasswordPolicyControlOnUpdate = new BooleanArgument(null, "usePasswordPolicyControlOnUpdate", 1, INFO_PWMOD_ARG_DESC_USE_PW_POLICY_CONTROL_ON_UPDATE.get());
    usePasswordPolicyControlOnUpdate.addLongIdentifier("use-password-policy-control-on-update", true);
    usePasswordPolicyControlOnUpdate.addLongIdentifier("usePWPolicyControlOnUpdate", true);
    usePasswordPolicyControlOnUpdate.addLongIdentifier("use-pw-policy-control-on-update", true);
    usePasswordPolicyControlOnUpdate.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(usePasswordPolicyControlOnUpdate);
    noOperation = new BooleanArgument(null, "noOperation", 1, INFO_PWMOD_ARG_DESC_NO_OPERATION.get());
    noOperation.addLongIdentifier("no-operation", true);
    noOperation.addLongIdentifier("noOp", true);
    noOperation.addLongIdentifier("no-op", true);
    noOperation.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(noOperation);
    getPasswordValidationDetails = new BooleanArgument(null, "getPasswordValidationDetails", 1, INFO_PWMOD_ARG_DESC_GET_PW_VALIDATION_DETAILS.get());
    getPasswordValidationDetails.addLongIdentifier("get-password-validation-details", true);
    getPasswordValidationDetails.addLongIdentifier("getPWValidationDetails", true);
    getPasswordValidationDetails.addLongIdentifier("get-pw-validation-details", true);
    getPasswordValidationDetails.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(getPasswordValidationDetails);
    retireCurrentPassword = new BooleanArgument(null, "retireCurrentPassword", 1, INFO_PWMOD_ARG_DESC_RETIRE_CURRENT_PASSWORD.get());
    retireCurrentPassword.addLongIdentifier("retire-current-password", true);
    retireCurrentPassword.addLongIdentifier("retireCurrentPW", true);
    retireCurrentPassword.addLongIdentifier("retire-current-pw", true);
    retireCurrentPassword.addLongIdentifier("retirePassword", true);
    retireCurrentPassword.addLongIdentifier("retire-password", true);
    retireCurrentPassword.addLongIdentifier("retirePW", true);
    retireCurrentPassword.addLongIdentifier("retire-pw", true);
    retireCurrentPassword.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(retireCurrentPassword);
    purgeCurrentPassword = new BooleanArgument(null, "purgeCurrentPassword", 1, INFO_PWMOD_ARG_DESC_PURGE_CURRENT_PASSWORD.get());
    purgeCurrentPassword.addLongIdentifier("purge-current-password", true);
    purgeCurrentPassword.addLongIdentifier("purgeCurrentPW", true);
    purgeCurrentPassword.addLongIdentifier("purge-current-pw", true);
    purgeCurrentPassword.addLongIdentifier("purgePassword", true);
    purgeCurrentPassword.addLongIdentifier("purge-password", true);
    purgeCurrentPassword.addLongIdentifier("purgePW", true);
    purgeCurrentPassword.addLongIdentifier("purge-pw", true);
    purgeCurrentPassword.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(purgeCurrentPassword);
    passwordUpdateBehavior = new StringArgument(null, "passwordUpdateBehavior", false, 0, INFO_PWMOD_ARG_PLACEHOLDER_NAME_VALUE.get(), INFO_PWMOD_ARG_DESC_PASSWORD_UPDATE_BEHAVIOR.get());
    passwordUpdateBehavior.addLongIdentifier("password-update-behavior", true);
    passwordUpdateBehavior.addLongIdentifier("pwUpdateBehavior", true);
    passwordUpdateBehavior.addLongIdentifier("pw-update-behavior", true);
    passwordUpdateBehavior.addLongIdentifier("updateBehavior", true);
    passwordUpdateBehavior.addLongIdentifier("update-behavior", true);
    passwordUpdateBehavior.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(passwordUpdateBehavior);
    useAssuredReplication = new BooleanArgument(null, "useAssuredReplication", 1, INFO_PWMOD_ARG_DESC_ASSURED_REPLICATION.get());
    useAssuredReplication.addLongIdentifier("use-assured-replication", true);
    useAssuredReplication.addLongIdentifier("assuredReplication", true);
    useAssuredReplication.addLongIdentifier("assured-replication", true);
    useAssuredReplication.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(useAssuredReplication);
    assuredReplicationLocalLevel = new StringArgument(null, "assuredReplicationLocalLevel", false, 1, INFO_PWMOD_ARG_PLACEHOLDER_LEVEL.get(), INFO_PWMOD_ARG_DESC_ASSURED_REPLICATION_LOCAL_LEVEL.get(), StaticUtils.setOf(ASSURED_REPLICATION_LOCAL_LEVEL_NONE, ASSURED_REPLICATION_LOCAL_LEVEL_RECEIVED_ANY_SERVER, ASSURED_REPLICATION_LOCAL_LEVEL_PROCESSED_ALL_SERVERS));
    assuredReplicationLocalLevel.addLongIdentifier("assured-replication-local-level", true);
    assuredReplicationLocalLevel.addLongIdentifier("localLevel", true);
    assuredReplicationLocalLevel.addLongIdentifier("local-level", true);
    assuredReplicationLocalLevel.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(assuredReplicationLocalLevel);
    assuredReplicationRemoteLevel = new StringArgument(null, "assuredReplicationRemoteLevel", false, 1, INFO_PWMOD_ARG_PLACEHOLDER_LEVEL.get(), INFO_PWMOD_ARG_DESC_ASSURED_REPLICATION_REMOTE_LEVEL.get(), StaticUtils.setOf(ASSURED_REPLICATION_REMOTE_LEVEL_NONE, ASSURED_REPLICATION_REMOTE_LEVEL_RECEIVED_ANY_REMOTE_LOCATION, ASSURED_REPLICATION_REMOTE_LEVEL_RECEIVED_ALL_REMOTE_LOCATIONS, ASSURED_REPLICATION_REMOTE_LEVEL_PROCESSED_ALL_REMOTE_SERVERS));
    assuredReplicationRemoteLevel.addLongIdentifier("assured-replication-remote-level", true);
    assuredReplicationRemoteLevel.addLongIdentifier("remoteLevel", true);
    assuredReplicationRemoteLevel.addLongIdentifier("remote-level", true);
    assuredReplicationRemoteLevel.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(assuredReplicationRemoteLevel);
    assuredReplicationTimeout = new DurationArgument(null, "assuredReplicationTimeout", false, INFO_PWMOD_ARG_PLACEHOLDER_TIMEOUT.get(), INFO_PWMOD_ARG_DESC_ASSURED_REPLICATION_TIMEOUT.get());
    assuredReplicationTimeout.addLongIdentifier("assured-replication-timeout", true);
    assuredReplicationTimeout.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(assuredReplicationTimeout);
    operationPurpose = new StringArgument(null, "operationPurpose", false, 1, INFO_PWMOD_ARG_PLACEHOLDER_PURPOSE.get(), INFO_PWMOD_ARG_DESC_OPERATION_PURPOSE.get());
    operationPurpose.addLongIdentifier("operation-purpose", true);
    operationPurpose.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_UPDATE_CONTROL.get());
    parser.addArgument(operationPurpose);
    // Other arguments
    passwordAttribute = new StringArgument(null, "passwordAttribute", false, 1, INFO_PWMOD_ARG_PLACEHOLDER_ATTRIBUTE_NAME.get(), INFO_PWMOD_ARG_DESC_PASSWORD_ATTRIBUTE.get(), DEFAULT_PASSWORD_ATTRIBUTE);
    passwordAttribute.addLongIdentifier("password-attribute", true);
    passwordAttribute.addLongIdentifier("passwordAttr", true);
    passwordAttribute.addLongIdentifier("password-attr", true);
    passwordAttribute.addLongIdentifier("pwAttribute", true);
    passwordAttribute.addLongIdentifier("pw-attribute", true);
    passwordAttribute.addLongIdentifier("pwAttr", true);
    passwordAttribute.addLongIdentifier("pw-attr", true);
    passwordAttribute.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_OTHER.get());
    passwordChangeMethod = new StringArgument(null, "passwordChangeMethod", false, 1, INFO_PWMOD_ARG_PLACEHOLDER_CHANGE_METHOD.get(), INFO_PWMOD_ARG_DESC_PASSWORD_CHANGE_METHOD.get(), StaticUtils.setOf(PASSWORD_CHANGE_METHOD_PW_MOD_EXTOP, PASSWORD_CHANGE_METHOD_LDAP_MOD, PASSWORD_CHANGE_METHOD_AD));
    passwordChangeMethod.addLongIdentifier("password-change-method", true);
    passwordChangeMethod.addLongIdentifier("pwChangeMethod", true);
    passwordChangeMethod.addLongIdentifier("pw-change-method", true);
    passwordChangeMethod.addLongIdentifier("changeMethod", true);
    passwordChangeMethod.addLongIdentifier("change-method", true);
    passwordChangeMethod.addLongIdentifier("method", true);
    passwordChangeMethod.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_OTHER.get());
    parser.addArgument(passwordChangeMethod);
    followReferrals = new BooleanArgument(null, "followReferrals", 1, INFO_PWMOD_ARG_DESC_FOLLOW_REFERRALS.get());
    followReferrals.addLongIdentifier("follow-referrals", true);
    followReferrals.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_OTHER.get());
    parser.addArgument(followReferrals);
    useAdministrativeSession = new BooleanArgument(null, "useAdministrativeSession", 1, INFO_PWMOD_ARG_DESC_USE_ADMIN_SESSION.get());
    useAdministrativeSession.addLongIdentifier("use-administrative-session", true);
    useAdministrativeSession.addLongIdentifier("useAdminSession", true);
    useAdministrativeSession.addLongIdentifier("use-admin-session", true);
    useAdministrativeSession.addLongIdentifier("administrativeSession", true);
    useAdministrativeSession.addLongIdentifier("administrative-session", true);
    useAdministrativeSession.addLongIdentifier("adminSession", true);
    useAdministrativeSession.addLongIdentifier("admin-session", true);
    useAdministrativeSession.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_OTHER.get());
    parser.addArgument(useAdministrativeSession);
    verbose = new BooleanArgument('v', "verbose", 1, INFO_PWMOD_ARG_DESC_VERBOSE.get());
    verbose.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_OTHER.get());
    parser.addArgument(verbose);
    // This argument isn't actually used, but provides command-line backward
    // compatibility with an existing implementation.
    scriptFriendly = new BooleanArgument(null, "script-friendly", 1, INFO_PWMOD_ARG_DESC_SCRIPT_FRIENDLY.get());
    scriptFriendly.setArgumentGroupName(INFO_PWMOD_ARG_GROUP_OTHER.get());
    scriptFriendly.setHidden(true);
    parser.addArgument(scriptFriendly);
    // Argument constraints.
    parser.addExclusiveArgumentSet(userIdentity, provideBindDNAsUserIdentity);
    final DNArgument bindDNArgument = parser.getDNArgument(BIND_DN_ARGUMENT_LONG_IDENTIFIER);
    parser.addDependentArgumentSet(provideBindDNAsUserIdentity, bindDNArgument);
    parser.addExclusiveArgumentSet(newPassword, newPasswordFile, promptForNewPassword, generateClientSideNewPassword);
    parser.addDependentArgumentSet(generatedPasswordLength, generateClientSideNewPassword);
    parser.addDependentArgumentSet(generatedPasswordCharacterSet, generateClientSideNewPassword);
    parser.addExclusiveArgumentSet(currentPassword, currentPasswordFile, promptForCurrentPassword);
    parser.addDependentArgumentSet(assuredReplicationLocalLevel, useAssuredReplication);
    parser.addDependentArgumentSet(assuredReplicationRemoteLevel, useAssuredReplication);
    parser.addDependentArgumentSet(assuredReplicationTimeout, useAssuredReplication);
    parser.addExclusiveArgumentSet(retireCurrentPassword, purgeCurrentPassword);
}
Also used : ControlArgument(com.unboundid.util.args.ControlArgument) DNArgument(com.unboundid.util.args.DNArgument) DurationArgument(com.unboundid.util.args.DurationArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument)

Example 3 with DurationArgument

use of com.unboundid.util.args.DurationArgument in project ldapsdk by pingidentity.

the class LDAPDelete method addNonLDAPArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    this.parser = parser;
    // 
    // Data Arguments
    // 
    final String argGroupData = INFO_LDAPDELETE_ARG_GROUP_DATA.get();
    entryDN = new DNArgument('b', "entryDN", false, 0, null, INFO_LDAPDELETE_ARG_DESC_DN.get());
    entryDN.addLongIdentifier("entry-dn", true);
    entryDN.addLongIdentifier("dn", true);
    entryDN.addLongIdentifier("dnToDelete", true);
    entryDN.addLongIdentifier("dn-to-delete", true);
    entryDN.addLongIdentifier("entry", true);
    entryDN.addLongIdentifier("entryToDelete", true);
    entryDN.addLongIdentifier("entry-to-delete", true);
    entryDN.setArgumentGroupName(argGroupData);
    parser.addArgument(entryDN);
    dnFile = new FileArgument('f', "dnFile", false, 0, null, INFO_LDAPDELETE_ARG_DESC_DN_FILE.get(), true, true, true, false);
    dnFile.addLongIdentifier("dn-file", true);
    dnFile.addLongIdentifier("dnFilename", true);
    dnFile.addLongIdentifier("dn-filename", true);
    dnFile.addLongIdentifier("deleteEntriesWithDNsFromFile", true);
    dnFile.addLongIdentifier("delete-entries0-with-dns-from-file", true);
    dnFile.addLongIdentifier("file", true);
    dnFile.addLongIdentifier("filename", true);
    dnFile.setArgumentGroupName(argGroupData);
    parser.addArgument(dnFile);
    deleteEntriesMatchingFilter = new FilterArgument(null, "deleteEntriesMatchingFilter", false, 0, null, INFO_LDAPDELETE_ARG_DESC_DELETE_ENTRIES_MATCHING_FILTER.get());
    deleteEntriesMatchingFilter.addLongIdentifier("delete-entries-matching-filter", true);
    deleteEntriesMatchingFilter.addLongIdentifier("deleteFilter", true);
    deleteEntriesMatchingFilter.addLongIdentifier("delete-filter", true);
    deleteEntriesMatchingFilter.addLongIdentifier("deleteSearchFilter", true);
    deleteEntriesMatchingFilter.addLongIdentifier("delete-search-filter", true);
    deleteEntriesMatchingFilter.addLongIdentifier("filter", true);
    deleteEntriesMatchingFilter.setArgumentGroupName(argGroupData);
    parser.addArgument(deleteEntriesMatchingFilter);
    deleteEntriesMatchingFiltersFromFile = new FileArgument(null, "deleteEntriesMatchingFiltersFromFile", false, 0, null, INFO_LDAPDELETE_ARG_DESC_DELETE_ENTRIES_MATCHING_FILTER_FILE.get(), true, true, true, false);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("delete-entries-matching-filters-from-file", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("deleteEntriesMatchingFilterFromFile", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("delete-entries-matching-filter-from-file", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("deleteFilterFile", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("delete-filter-file", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("deleteSearchFilterFile", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("delete-search-filter-file", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("filterFile", true);
    deleteEntriesMatchingFiltersFromFile.addLongIdentifier("filter-file", true);
    deleteEntriesMatchingFiltersFromFile.setArgumentGroupName(argGroupData);
    parser.addArgument(deleteEntriesMatchingFiltersFromFile);
    searchBaseDN = new DNArgument(null, "searchBaseDN", false, 0, null, INFO_LDAPDELETE_ARG_DESC_SEARCH_BASE_DN.get(), DN.NULL_DN);
    searchBaseDN.addLongIdentifier("search-base-dn", true);
    searchBaseDN.addLongIdentifier("baseDN", true);
    searchBaseDN.addLongIdentifier("base-dn", true);
    searchBaseDN.setArgumentGroupName(argGroupData);
    parser.addArgument(searchBaseDN);
    searchPageSize = new IntegerArgument(null, "searchPageSize", false, 1, null, INFO_LDAPDELETE_ARG_DESC_SEARCH_PAGE_SIZE.get(), 1, Integer.MAX_VALUE);
    searchPageSize.addLongIdentifier("search-page-size", true);
    searchPageSize.addLongIdentifier("simplePagedResultsPageSize", true);
    searchPageSize.addLongIdentifier("simple-paged-results-page-size", true);
    searchPageSize.addLongIdentifier("pageSize", true);
    searchPageSize.addLongIdentifier("page-size", true);
    searchPageSize.setArgumentGroupName(argGroupData);
    parser.addArgument(searchPageSize);
    encryptionPassphraseFile = new FileArgument(null, "encryptionPassphraseFile", false, 1, null, INFO_LDAPDELETE_ARG_DESC_ENCRYPTION_PW_FILE.get(), true, true, true, false);
    encryptionPassphraseFile.addLongIdentifier("encryption-passphrase-file", true);
    encryptionPassphraseFile.addLongIdentifier("encryptionPasswordFile", true);
    encryptionPassphraseFile.addLongIdentifier("encryption-password-file", true);
    encryptionPassphraseFile.addLongIdentifier("encryptionPINFile", true);
    encryptionPassphraseFile.addLongIdentifier("encryption-pin-file", true);
    encryptionPassphraseFile.setArgumentGroupName(argGroupData);
    parser.addArgument(encryptionPassphraseFile);
    characterSet = new StringArgument('i', "characterSet", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_CHARSET.get(), INFO_LDAPDELETE_ARG_DESC_CHARSET.get(), "UTF-8");
    characterSet.addLongIdentifier("character-set", true);
    characterSet.addLongIdentifier("charSet", true);
    characterSet.addLongIdentifier("char-set", true);
    characterSet.addLongIdentifier("encoding", true);
    characterSet.setArgumentGroupName(argGroupData);
    parser.addArgument(characterSet);
    rejectFile = new FileArgument('R', "rejectFile", false, 1, null, INFO_LDAPDELETE_ARG_DESC_REJECT_FILE.get(), false, true, true, false);
    rejectFile.addLongIdentifier("reject-file", true);
    rejectFile.addLongIdentifier("errorFile", true);
    rejectFile.addLongIdentifier("error-file", true);
    rejectFile.addLongIdentifier("failureFile", true);
    rejectFile.addLongIdentifier("failure-file", true);
    rejectFile.setArgumentGroupName(argGroupData);
    parser.addArgument(rejectFile);
    verbose = new BooleanArgument('v', "verbose", 1, INFO_LDAPDELETE_ARG_DESC_VERBOSE.get());
    verbose.setArgumentGroupName(argGroupData);
    parser.addArgument(verbose);
    // This argument has no effect.  It is provided for compatibility with a
    // legacy ldapdelete tool, where the argument was also offered but had no
    // effect.  In this tool, it is hidden.
    final BooleanArgument scriptFriendly = new BooleanArgument(null, "scriptFriendly", 1, INFO_LDAPDELETE_ARG_DESC_SCRIPT_FRIENDLY.get());
    scriptFriendly.addLongIdentifier("script-friendly", true);
    scriptFriendly.setArgumentGroupName(argGroupData);
    scriptFriendly.setHidden(true);
    parser.addArgument(scriptFriendly);
    // 
    // Operation Arguments
    // 
    final String argGroupOp = INFO_LDAPDELETE_ARG_GROUP_OPERATION.get();
    // NOTE:  The retryFailedOperations argument is now hidden, as we will retry
    // operations by default.  The neverRetry argument can be used to disable
    // this.
    retryFailedOperations = new BooleanArgument(null, "retryFailedOperations", 1, INFO_LDAPDELETE_ARG_DESC_RETRY_FAILED_OPS.get());
    retryFailedOperations.addLongIdentifier("retry-failed-operations", true);
    retryFailedOperations.addLongIdentifier("retryFailedOps", true);
    retryFailedOperations.addLongIdentifier("retry-failed-ops", true);
    retryFailedOperations.addLongIdentifier("retry", true);
    retryFailedOperations.setArgumentGroupName(argGroupOp);
    retryFailedOperations.setHidden(true);
    parser.addArgument(retryFailedOperations);
    neverRetry = new BooleanArgument(null, "neverRetry", 1, INFO_LDAPDELETE_ARG_DESC_NEVER_RETRY.get());
    neverRetry.addLongIdentifier("never-retry", true);
    neverRetry.setArgumentGroupName(argGroupOp);
    parser.addArgument(neverRetry);
    dryRun = new BooleanArgument('n', "dryRun", 1, INFO_LDAPDELETE_ARG_DESC_DRY_RUN.get());
    dryRun.addLongIdentifier("dry-run", true);
    dryRun.setArgumentGroupName(argGroupOp);
    parser.addArgument(dryRun);
    continueOnError = new BooleanArgument('c', "continueOnError", 1, INFO_LDAPDELETE_ARG_DESC_CONTINUE_ON_ERROR.get());
    continueOnError.addLongIdentifier("continue-on-error", true);
    continueOnError.setArgumentGroupName(argGroupOp);
    parser.addArgument(continueOnError);
    followReferrals = new BooleanArgument(null, "followReferrals", 1, INFO_LDAPDELETE_ARG_DESC_FOLLOW_REFERRALS.get());
    followReferrals.addLongIdentifier("follow-referrals", true);
    followReferrals.setArgumentGroupName(argGroupOp);
    parser.addArgument(followReferrals);
    useAdministrativeSession = new BooleanArgument(null, "useAdministrativeSession", 1, INFO_LDAPDELETE_ARG_DESC_USE_ADMIN_SESSION.get());
    useAdministrativeSession.addLongIdentifier("use-administrative-session", true);
    useAdministrativeSession.addLongIdentifier("useAdminSession", true);
    useAdministrativeSession.addLongIdentifier("use-admin-session", true);
    useAdministrativeSession.setArgumentGroupName(argGroupOp);
    parser.addArgument(useAdministrativeSession);
    ratePerSecond = new IntegerArgument('r', "ratePerSecond", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_RATE_PER_SECOND.get(), INFO_LDAPDELETE_ARG_DESC_RATE_PER_SECOND.get(), 1, Integer.MAX_VALUE);
    ratePerSecond.addLongIdentifier("rate-per-second", true);
    ratePerSecond.addLongIdentifier("deletesPerSecond", true);
    ratePerSecond.addLongIdentifier("deletes-per-second", true);
    ratePerSecond.addLongIdentifier("operationsPerSecond", true);
    ratePerSecond.addLongIdentifier("operations-per-second", true);
    ratePerSecond.addLongIdentifier("opsPerSecond", true);
    ratePerSecond.addLongIdentifier("ops-per-second", true);
    ratePerSecond.setArgumentGroupName(argGroupOp);
    parser.addArgument(ratePerSecond);
    // This argument has no effect.  It is provided for compatibility with a
    // legacy ldapdelete tool, but this version only supports LDAPv3, so this
    // argument is hidden.
    final IntegerArgument ldapVersion = new IntegerArgument('V', "ldapVersion", false, 1, "{version}", INFO_LDAPDELETE_ARG_DESC_LDAP_VERSION.get(), 3, 3, 3);
    ldapVersion.addLongIdentifier("ldap-version", true);
    ldapVersion.setArgumentGroupName(argGroupOp);
    ldapVersion.setHidden(true);
    parser.addArgument(ldapVersion);
    // 
    // Control Arguments
    // 
    final String argGroupControls = INFO_LDAPDELETE_ARG_GROUP_CONTROLS.get();
    clientSideSubtreeDelete = new BooleanArgument(null, "clientSideSubtreeDelete", 1, INFO_LDAPDELETE_ARG_DESC_CLIENT_SIDE_SUB_DEL.get());
    clientSideSubtreeDelete.addLongIdentifier("client-side-subtree-delete", true);
    clientSideSubtreeDelete.setArgumentGroupName(argGroupControls);
    parser.addArgument(clientSideSubtreeDelete);
    serverSideSubtreeDelete = new BooleanArgument('x', "serverSideSubtreeDelete", 1, INFO_LDAPDELETE_ARG_DESC_SERVER_SIDE_SUB_DEL.get());
    serverSideSubtreeDelete.addLongIdentifier("server-side-subtree-delete", true);
    serverSideSubtreeDelete.addLongIdentifier("deleteSubtree", true);
    serverSideSubtreeDelete.addLongIdentifier("delete-subtree", true);
    serverSideSubtreeDelete.addLongIdentifier("useSubtreeDeleteControl", true);
    serverSideSubtreeDelete.addLongIdentifier("use-subtree-delete-control", true);
    serverSideSubtreeDelete.setArgumentGroupName(argGroupControls);
    parser.addArgument(serverSideSubtreeDelete);
    softDelete = new BooleanArgument('s', "softDelete", 1, INFO_LDAPDELETE_ARG_DESC_SOFT_DELETE.get());
    softDelete.addLongIdentifier("soft-delete", true);
    softDelete.addLongIdentifier("useSoftDelete", true);
    softDelete.addLongIdentifier("use-soft-delete", true);
    softDelete.addLongIdentifier("useSoftDeleteControl", true);
    softDelete.addLongIdentifier("use-soft-delete-control", true);
    softDelete.setArgumentGroupName(argGroupControls);
    parser.addArgument(softDelete);
    hardDelete = new BooleanArgument(null, "hardDelete", 1, INFO_LDAPDELETE_ARG_DESC_HARD_DELETE.get());
    hardDelete.addLongIdentifier("hard-delete", true);
    hardDelete.addLongIdentifier("useHardDelete", true);
    hardDelete.addLongIdentifier("use-hard-delete", true);
    hardDelete.addLongIdentifier("useHardDeleteControl", true);
    hardDelete.addLongIdentifier("use-hard-delete-control", true);
    hardDelete.setArgumentGroupName(argGroupControls);
    parser.addArgument(hardDelete);
    proxyAs = new StringArgument('Y', "proxyAs", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_AUTHZ_ID.get(), INFO_LDAPDELETE_ARG_DESC_PROXY_AS.get());
    proxyAs.addLongIdentifier("proxy-as", true);
    proxyAs.addLongIdentifier("proxyV2As", true);
    proxyAs.addLongIdentifier("proxy-v2-as", true);
    proxyAs.addLongIdentifier("proxiedAuth", true);
    proxyAs.addLongIdentifier("proxied-auth", true);
    proxyAs.addLongIdentifier("proxiedAuthorization", true);
    proxyAs.addLongIdentifier("proxied-authorization", true);
    proxyAs.addLongIdentifier("useProxiedAuth", true);
    proxyAs.addLongIdentifier("use-proxied-auth", true);
    proxyAs.addLongIdentifier("useProxiedAuthorization", true);
    proxyAs.addLongIdentifier("use-proxied-authorization", true);
    proxyAs.addLongIdentifier("useProxiedAuthControl", true);
    proxyAs.addLongIdentifier("use-proxied-auth-control", true);
    proxyAs.addLongIdentifier("useProxiedAuthorizationControl", true);
    proxyAs.addLongIdentifier("use-proxied-authorization-control", true);
    proxyAs.setArgumentGroupName(argGroupControls);
    parser.addArgument(proxyAs);
    proxyV1As = new DNArgument(null, "proxyV1As", false, 1, null, INFO_LDAPDELETE_ARG_DESC_PROXY_V1_AS.get());
    proxyV1As.addLongIdentifier("proxy-v1-as", true);
    proxyV1As.setArgumentGroupName(argGroupControls);
    parser.addArgument(proxyV1As);
    manageDsaIT = new BooleanArgument(null, "useManageDsaIT", 1, INFO_LDAPDELETE_ARG_DESC_MANAGE_DSA_IT.get());
    manageDsaIT.addLongIdentifier("use-manage-dsa-it", true);
    manageDsaIT.addLongIdentifier("manageDsaIT", true);
    manageDsaIT.addLongIdentifier("manage-dsa-it", true);
    manageDsaIT.addLongIdentifier("manageDsaITControl", true);
    manageDsaIT.addLongIdentifier("manage-dsa-it-control", true);
    manageDsaIT.addLongIdentifier("useManageDsaITControl", true);
    manageDsaIT.addLongIdentifier("use-manage-dsa-it-control", true);
    manageDsaIT.setArgumentGroupName(argGroupControls);
    parser.addArgument(manageDsaIT);
    assertionFilter = new FilterArgument(null, "assertionFilter", false, 1, null, INFO_LDAPDELETE_ARG_DESC_ASSERTION_FILTER.get());
    assertionFilter.addLongIdentifier("assertion-filter", true);
    assertionFilter.addLongIdentifier("useAssertionFilter", true);
    assertionFilter.addLongIdentifier("use-assertion-filter", true);
    assertionFilter.addLongIdentifier("assertionControl", true);
    assertionFilter.addLongIdentifier("assertion-control", true);
    assertionFilter.addLongIdentifier("useAssertionControl", true);
    assertionFilter.addLongIdentifier("use-assertion-control", true);
    assertionFilter.setArgumentGroupName(argGroupControls);
    parser.addArgument(assertionFilter);
    preReadAttribute = new StringArgument(null, "preReadAttribute", false, 0, INFO_LDAPDELETE_ARG_PLACEHOLDER_ATTR.get(), INFO_LDAPDELETE_ARG_DESC_PRE_READ_ATTR.get());
    preReadAttribute.addLongIdentifier("pre-read-attribute", true);
    preReadAttribute.setArgumentGroupName(argGroupControls);
    parser.addArgument(preReadAttribute);
    noOperation = new BooleanArgument(null, "noOperation", 1, INFO_LDAPDELETE_ARG_DESC_NO_OP.get());
    noOperation.addLongIdentifier("no-operation", true);
    noOperation.addLongIdentifier("noOp", true);
    noOperation.addLongIdentifier("no-op", true);
    noOperation.setArgumentGroupName(argGroupControls);
    parser.addArgument(noOperation);
    getBackendSetID = new BooleanArgument(null, "getBackendSetID", 1, INFO_LDAPDELETE_ARG_DESC_GET_BACKEND_SET_ID.get());
    getBackendSetID.addLongIdentifier("get-backend-set-id", true);
    getBackendSetID.addLongIdentifier("useGetBackendSetID", true);
    getBackendSetID.addLongIdentifier("use-get-backend-set-id", true);
    getBackendSetID.addLongIdentifier("useGetBackendSetIDControl", true);
    getBackendSetID.addLongIdentifier("use-get-backend-set-id-control", true);
    getBackendSetID.setArgumentGroupName(argGroupControls);
    parser.addArgument(getBackendSetID);
    routeToBackendSet = new StringArgument(null, "routeToBackendSet", false, 0, INFO_LDAPDELETE_ARG_PLACEHOLDER_ROUTE_TO_BACKEND_SET.get(), INFO_LDAPDELETE_ARG_DESC_ROUTE_TO_BACKEND_SET.get());
    routeToBackendSet.addLongIdentifier("route-to-backend-set", true);
    routeToBackendSet.addLongIdentifier("useRouteToBackendSet", true);
    routeToBackendSet.addLongIdentifier("use0route-to-backend-set", true);
    routeToBackendSet.addLongIdentifier("useRouteToBackendSetControl", true);
    routeToBackendSet.addLongIdentifier("use-route-to-backend-set-control", true);
    routeToBackendSet.setArgumentGroupName(argGroupControls);
    parser.addArgument(routeToBackendSet);
    getServerID = new BooleanArgument(null, "getServerID", 1, INFO_LDAPDELETE_ARG_DESC_GET_SERVER_ID.get());
    getServerID.addLongIdentifier("get-server-id", true);
    getServerID.addLongIdentifier("getBackendServerID", true);
    getServerID.addLongIdentifier("get-backend-server-id", true);
    getServerID.addLongIdentifier("useGetServerID", true);
    getServerID.addLongIdentifier("use-get-server-id", true);
    getServerID.addLongIdentifier("useGetServerIDControl", true);
    getServerID.addLongIdentifier("use-get-server-id-control", true);
    getServerID.setArgumentGroupName(argGroupControls);
    parser.addArgument(getServerID);
    routeToServer = new StringArgument(null, "routeToServer", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_ID.get(), INFO_LDAPDELETE_ARG_DESC_ROUTE_TO_SERVER.get());
    routeToServer.addLongIdentifier("route-to-server", true);
    routeToServer.addLongIdentifier("routeToBackendServer", true);
    routeToServer.addLongIdentifier("route-to-backend-server", true);
    routeToServer.addLongIdentifier("useRouteToServer", true);
    routeToServer.addLongIdentifier("use-route-to-server", true);
    routeToServer.addLongIdentifier("useRouteToBackendServer", true);
    routeToServer.addLongIdentifier("use-route-to-backend-server", true);
    routeToServer.addLongIdentifier("useRouteToServerControl", true);
    routeToServer.addLongIdentifier("use-route-to-server-control", true);
    routeToServer.addLongIdentifier("useRouteToBackendServerControl", true);
    routeToServer.addLongIdentifier("use-route-to-backend-server-control", true);
    routeToServer.setArgumentGroupName(argGroupControls);
    parser.addArgument(routeToServer);
    useAssuredReplication = new BooleanArgument(null, "useAssuredReplication", 1, INFO_LDAPDELETE_ARG_DESC_USE_ASSURED_REPLICATION.get());
    useAssuredReplication.addLongIdentifier("use-assured-replication", true);
    useAssuredReplication.addLongIdentifier("assuredReplication", true);
    useAssuredReplication.addLongIdentifier("assured-replication", true);
    useAssuredReplication.addLongIdentifier("assuredReplicationControl", true);
    useAssuredReplication.addLongIdentifier("assured-replication-control", true);
    useAssuredReplication.addLongIdentifier("useAssuredReplicationControl", true);
    useAssuredReplication.addLongIdentifier("use-assured-replication-control", true);
    useAssuredReplication.setArgumentGroupName(argGroupControls);
    parser.addArgument(useAssuredReplication);
    assuredReplicationLocalLevel = new StringArgument(null, "assuredReplicationLocalLevel", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_ASSURED_REPLICATION_LOCAL_LEVEL.get(), INFO_LDAPDELETE_ARG_DESC_ASSURED_REPLICATION_LOCAL_LEVEL.get(), StaticUtils.setOf("none", "received-any-server", "processed-all-servers"));
    assuredReplicationLocalLevel.addLongIdentifier("assured-replication-local-level", true);
    assuredReplicationLocalLevel.setArgumentGroupName(argGroupControls);
    parser.addArgument(assuredReplicationLocalLevel);
    assuredReplicationRemoteLevel = new StringArgument(null, "assuredReplicationRemoteLevel", false, 1, INFO_LDAPDELETE_ARG_PLACEHOLDER_ASSURED_REPLICATION_REMOTE_LEVEL.get(), INFO_LDAPDELETE_ARG_DESC_ASSURED_REPLICATION_REMOTE_LEVEL.get(), StaticUtils.setOf("none", "received-any-remote-location", "received-all-remote-locations", "processed-all-remote-servers"));
    assuredReplicationRemoteLevel.addLongIdentifier("assured-replication-remote-level", true);
    assuredReplicationRemoteLevel.setArgumentGroupName(argGroupControls);
    parser.addArgument(assuredReplicationRemoteLevel);
    assuredReplicationTimeout = new DurationArgument(null, "assuredReplicationTimeout", false, null, INFO_LDAPDELETE_ARG_DESC_ASSURED_REPLICATION_TIMEOUT.get());
    assuredReplicationTimeout.addLongIdentifier("assured-replication-timeout", true);
    assuredReplicationTimeout.setArgumentGroupName(argGroupControls);
    parser.addArgument(assuredReplicationTimeout);
    replicationRepair = new BooleanArgument(null, "replicationRepair", 1, INFO_LDAPDELETE_ARG_DESC_REPLICATION_REPAIR.get());
    replicationRepair.addLongIdentifier("replication-repair", true);
    replicationRepair.addLongIdentifier("replicationRepairControl", true);
    replicationRepair.addLongIdentifier("replication-repair-control", true);
    replicationRepair.addLongIdentifier("useReplicationRepair", true);
    replicationRepair.addLongIdentifier("use-replication-repair", true);
    replicationRepair.addLongIdentifier("useReplicationRepairControl", true);
    replicationRepair.addLongIdentifier("use-replication-repair-control", true);
    replicationRepair.setArgumentGroupName(argGroupControls);
    parser.addArgument(replicationRepair);
    suppressReferentialIntegrityUpdates = new BooleanArgument(null, "suppressReferentialIntegrityUpdates", 1, INFO_LDAPDELETE_ARG_DESC_SUPPRESS_REFINT_UPDATES.get());
    suppressReferentialIntegrityUpdates.addLongIdentifier("suppress-referential-integrity-updates", true);
    suppressReferentialIntegrityUpdates.addLongIdentifier("useSuppressReferentialIntegrityUpdates", true);
    suppressReferentialIntegrityUpdates.addLongIdentifier("use-suppress-referential-integrity-updates", true);
    suppressReferentialIntegrityUpdates.addLongIdentifier("useSuppressReferentialIntegrityUpdatesControl", true);
    suppressReferentialIntegrityUpdates.addLongIdentifier("use-suppress-referential-integrity-updates-control", true);
    suppressReferentialIntegrityUpdates.setArgumentGroupName(argGroupControls);
    parser.addArgument(suppressReferentialIntegrityUpdates);
    operationPurpose = new StringArgument(null, "operationPurpose", false, 1, null, INFO_LDAPDELETE_ARG_DESC_OP_PURPOSE.get());
    operationPurpose.addLongIdentifier("operation-purpose", true);
    operationPurpose.addLongIdentifier("operationPurposeControl", true);
    operationPurpose.addLongIdentifier("operation-purpose-control", true);
    operationPurpose.addLongIdentifier("useOperationPurpose", true);
    operationPurpose.addLongIdentifier("use-operation-purpose", true);
    operationPurpose.addLongIdentifier("useOperationPurposeControl", true);
    operationPurpose.addLongIdentifier("use-operation-purpose-control", true);
    operationPurpose.setArgumentGroupName(argGroupControls);
    parser.addArgument(operationPurpose);
    authorizationIdentity = new BooleanArgument('E', "authorizationIdentity", 1, INFO_LDAPDELETE_ARG_DESC_AUTHZ_ID.get());
    authorizationIdentity.addLongIdentifier("authorization-identity", true);
    authorizationIdentity.addLongIdentifier("useAuthorizationIdentity", true);
    authorizationIdentity.addLongIdentifier("use-authorization-identity", true);
    authorizationIdentity.addLongIdentifier("useAuthorizationIdentityControl", true);
    authorizationIdentity.addLongIdentifier("use-authorization-identity-control", true);
    authorizationIdentity.setArgumentGroupName(argGroupControls);
    parser.addArgument(authorizationIdentity);
    getAuthorizationEntryAttribute = new StringArgument(null, "getAuthorizationEntryAttribute", false, 0, INFO_LDAPDELETE_ARG_PLACEHOLDER_ATTR.get(), INFO_LDAPDELETE_ARG_DESC_GET_AUTHZ_ENTRY_ATTR.get());
    getAuthorizationEntryAttribute.addLongIdentifier("get-authorization-entry-attribute", true);
    getAuthorizationEntryAttribute.setArgumentGroupName(argGroupControls);
    parser.addArgument(getAuthorizationEntryAttribute);
    getUserResourceLimits = new BooleanArgument(null, "getUserResourceLimits", 1, INFO_LDAPDELETE_ARG_DESC_GET_USER_RESOURCE_LIMITS.get());
    getUserResourceLimits.addLongIdentifier("get-user-resource-limits", true);
    getUserResourceLimits.addLongIdentifier("getUserResourceLimitsControl", true);
    getUserResourceLimits.addLongIdentifier("get-user-resource-limits-control", true);
    getUserResourceLimits.addLongIdentifier("useGetUserResourceLimits", true);
    getUserResourceLimits.addLongIdentifier("use-get-user-resource-limits", true);
    getUserResourceLimits.addLongIdentifier("useGetUserResourceLimitsControl", true);
    getUserResourceLimits.addLongIdentifier("use-get-user-resource-limits-control", true);
    getUserResourceLimits.setArgumentGroupName(argGroupControls);
    parser.addArgument(getUserResourceLimits);
    deleteControl = new ControlArgument('J', "deleteControl", false, 0, null, INFO_LDAPDELETE_ARG_DESC_DELETE_CONTROL.get());
    deleteControl.addLongIdentifier("delete-control", true);
    deleteControl.addLongIdentifier("operationControl", true);
    deleteControl.addLongIdentifier("operation-control", true);
    deleteControl.addLongIdentifier("control", true);
    deleteControl.setArgumentGroupName(argGroupControls);
    parser.addArgument(deleteControl);
    bindControl = new ControlArgument(null, "bindControl", false, 0, null, INFO_LDAPDELETE_ARG_DESC_BIND_CONTROL.get());
    bindControl.addLongIdentifier("bind-control", true);
    bindControl.setArgumentGroupName(argGroupControls);
    parser.addArgument(bindControl);
    // 
    // Argument Constraints
    // 
    // At most one argument may be provided to select the entries to delete.
    parser.addExclusiveArgumentSet(entryDN, dnFile, deleteEntriesMatchingFilter, deleteEntriesMatchingFiltersFromFile);
    // The searchBaseDN argument can only be used if identifying entries with
    // search filters.
    parser.addDependentArgumentSet(searchBaseDN, deleteEntriesMatchingFilter, deleteEntriesMatchingFiltersFromFile);
    // The search page size argument can only be used if identifying entries
    // with search filters or performing a client-side subtree delete.
    parser.addDependentArgumentSet(searchPageSize, deleteEntriesMatchingFilter, deleteEntriesMatchingFiltersFromFile, clientSideSubtreeDelete);
    // Follow referrals and manage DSA IT can't be used together.
    parser.addExclusiveArgumentSet(followReferrals, manageDsaIT);
    // Client-side and server-side subtree delete can't be used together.
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, serverSideSubtreeDelete);
    // A lot of options can't be used in conjunction with client-side
    // subtree delete.
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, followReferrals);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, preReadAttribute);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, getBackendSetID);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, getServerID);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, noOperation);
    parser.addExclusiveArgumentSet(clientSideSubtreeDelete, dryRun);
    // Soft delete and hard delete can't be used together.
    parser.addExclusiveArgumentSet(softDelete, hardDelete);
}
Also used : ControlArgument(com.unboundid.util.args.ControlArgument) DNArgument(com.unboundid.util.args.DNArgument) DurationArgument(com.unboundid.util.args.DurationArgument) FilterArgument(com.unboundid.util.args.FilterArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) ASN1OctetString(com.unboundid.asn1.ASN1OctetString) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument)

Example 4 with DurationArgument

use of com.unboundid.util.args.DurationArgument in project ldapsdk by pingidentity.

the class TestLDAPCommandLineTool method addNonLDAPArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addNonLDAPArguments(final ArgumentParser parser) throws ArgumentException {
    final ArgumentParser argListParser1 = new ArgumentParser("argumentList1", "Argument List 1 Description");
    argListParser1.addArgument(new StringArgument(null, "foo", false, -1, "{foo}", "Foo Description"));
    final ArgumentParser argListParser2 = new ArgumentParser("argumentList2", "Argument List 2 Description");
    argListParser2.addArgument(new StringArgument(null, "bar", false, -1, "{bar}", "Bar Description"));
    singleValuedArgumentListArgument = new ArgumentListArgument(null, "singleValuedArgumentList", false, 1, "{argList}", "Argument List", argListParser1);
    parser.addArgument(singleValuedArgumentListArgument);
    multiValuedArgumentListArgument = new ArgumentListArgument(null, "multiValuedArgumentList", false, -1, "{argList}", "Argument List", argListParser2);
    parser.addArgument(multiValuedArgumentListArgument);
    booleanArgument = new BooleanArgument(null, "boolean", "Boolean Description");
    parser.addArgument(booleanArgument);
    booleanValueArgument = new BooleanValueArgument(null, "booleanValue", false, "{true|false}", "Boolean Value Description");
    parser.addArgument(booleanValueArgument);
    singleValuedControlArgument = new ControlArgument(null, "singleValuedControl", false, 1, null, "Control Description");
    parser.addArgument(singleValuedControlArgument);
    multiValuedControlArgument = new ControlArgument(null, "multiValuedControl", false, -1, null, "Control Description");
    parser.addArgument(multiValuedControlArgument);
    singleValuedDNArgument = new DNArgument(null, "singleValuedDN", false, 1, "{dn}", "DN Description");
    parser.addArgument(singleValuedDNArgument);
    multiValuedDNArgument = new DNArgument(null, "multiValuedDN", false, -1, "{dn}", "DN Description");
    parser.addArgument(multiValuedDNArgument);
    durationArgument = new DurationArgument(null, "duration", false, "{duration}", "Duration Description");
    parser.addArgument(durationArgument);
    singleValuedFileArgument = new FileArgument(null, "singleValuedFile", false, 1, "{path}", "File Description", false, true, true, false);
    parser.addArgument(singleValuedFileArgument);
    multiValuedFileArgument = new FileArgument(null, "multiValuedFile", false, -1, "{path}", "File Description", false, false, false, false);
    parser.addArgument(multiValuedFileArgument);
    singleValuedFilterArgument = new FilterArgument(null, "singleValuedFilter", false, 1, "{filter}", "Filter Description");
    parser.addArgument(singleValuedFilterArgument);
    multiValuedFilterArgument = new FilterArgument(null, "multiValuedFilter", false, -1, "{filter}", "Filter Description");
    parser.addArgument(multiValuedFilterArgument);
    singleValuedTimestampArgument = new TimestampArgument(null, "singleValuedGeneralizedTime", false, 1, "{timestamp}", "Generalized Time Description");
    parser.addArgument(singleValuedTimestampArgument);
    multiValuedTimestampArgument = new TimestampArgument(null, "multiValuedGeneralizedTime", false, -1, "{timestamp}", "Generalized Time Description");
    parser.addArgument(multiValuedTimestampArgument);
    singleValuedIntegerArgument = new IntegerArgument(null, "singleValuedInteger", false, 1, "{int}", "Integer Description");
    parser.addArgument(singleValuedIntegerArgument);
    multiValuedIntegerArgument = new IntegerArgument(null, "multiValuedInteger", false, -1, "{int}", "Integer Description");
    parser.addArgument(multiValuedIntegerArgument);
    scopeArgument = new ScopeArgument(null, "scope", false, "{scope}", "Scope Description");
    parser.addArgument(scopeArgument);
    singleValuedStringArgument = new StringArgument(null, "singleValuedString", false, 1, "{string}", "String Description");
    parser.addArgument(singleValuedStringArgument);
    multiValuedOpenOptionsStringArgument = new StringArgument(null, "multiValuedOpenOptionsString", false, -1, "{string}", "String Description");
    parser.addArgument(multiValuedOpenOptionsStringArgument);
    final LinkedHashSet<String> allowedValues = new LinkedHashSet<String>(5);
    allowedValues.add("first");
    allowedValues.add("second");
    allowedValues.add("third");
    allowedValues.add("fourth");
    allowedValues.add("fifth");
    multiValuedFixedOptionsStringArgument = new StringArgument(null, "multiValuedFixedOptionsString", false, -1, "{string}", "String Description", allowedValues);
    parser.addArgument(multiValuedFixedOptionsStringArgument);
    resultCodeArgument = new IntegerArgument(null, "resultCode", true, 1, "{intValue}", "The result code");
    parser.addArgument(resultCodeArgument);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ScopeArgument(com.unboundid.util.args.ScopeArgument) DurationArgument(com.unboundid.util.args.DurationArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) FileArgument(com.unboundid.util.args.FileArgument) ArgumentParser(com.unboundid.util.args.ArgumentParser) StringArgument(com.unboundid.util.args.StringArgument) ControlArgument(com.unboundid.util.args.ControlArgument) DNArgument(com.unboundid.util.args.DNArgument) FilterArgument(com.unboundid.util.args.FilterArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) BooleanValueArgument(com.unboundid.util.args.BooleanValueArgument) TimestampArgument(com.unboundid.util.args.TimestampArgument) ArgumentListArgument(com.unboundid.util.args.ArgumentListArgument)

Example 5 with DurationArgument

use of com.unboundid.util.args.DurationArgument in project ldapsdk by pingidentity.

the class CollectSupportData method addNonLDAPArguments.

/**
 * {@inheritDoc}
 */
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
    this.parser = parser;
    // Output-related arguments.
    outputPathArg = new FileArgument(null, "outputPath", false, 1, null, INFO_CSD_ARG_DESC_OUTPUT_PATH.get(), false, true, false, false);
    outputPathArg.addLongIdentifier("output-path", true);
    outputPathArg.addLongIdentifier("outputFile", true);
    outputPathArg.addLongIdentifier("output-file", true);
    outputPathArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_OUTPUT.get());
    parser.addArgument(outputPathArg);
    encryptArg = new BooleanArgument(null, "encrypt", 1, INFO_CSD_ARG_DESC_ENCRYPT.get());
    encryptArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_OUTPUT.get());
    parser.addArgument(encryptArg);
    passphraseFileArg = new FileArgument(null, "passphraseFile", false, 1, null, INFO_CSD_ARG_DESC_PASSPHRASE_FILE.get(), false, true, true, false);
    passphraseFileArg.addLongIdentifier("passphrase-file", true);
    passphraseFileArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_OUTPUT.get());
    parser.addArgument(passphraseFileArg);
    generatePassphraseArg = new BooleanArgument(null, "generatePassphrase", 1, INFO_CSD_ARG_DESC_GENERATE_PASSPHRASE.get());
    generatePassphraseArg.addLongIdentifier("generate-passphrase", true);
    generatePassphraseArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_OUTPUT.get());
    parser.addArgument(generatePassphraseArg);
    decryptArg = new FileArgument(null, "decrypt", false, 1, null, INFO_CSD_ARG_DESC_DECRYPT.get(), false, true, true, false);
    decryptArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_OUTPUT.get());
    parser.addArgument(decryptArg);
    // Collection-related arguments.
    collectExpensiveDataArg = new BooleanArgument(null, "collectExpensiveData", 1, INFO_CSD_ARG_DESC_COLLECT_EXPENSIVE_DATA.get());
    collectExpensiveDataArg.addLongIdentifier("collect-expensive-data", true);
    collectExpensiveDataArg.addLongIdentifier("includeExpensiveData", true);
    collectExpensiveDataArg.addLongIdentifier("include-expensive-data", true);
    collectExpensiveDataArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(collectExpensiveDataArg);
    collectReplicationStateDumpArg = new BooleanArgument(null, "collectReplicationStateDump", 1, INFO_CSD_ARG_DESC_COLLECT_REPL_STATE.get());
    collectReplicationStateDumpArg.addLongIdentifier("collect-replication-state-dump", true);
    collectReplicationStateDumpArg.addLongIdentifier("collectReplicationState", true);
    collectReplicationStateDumpArg.addLongIdentifier("collect-replication-state", true);
    collectReplicationStateDumpArg.addLongIdentifier("includeReplicationStateDump", true);
    collectReplicationStateDumpArg.addLongIdentifier("include-replication-state-dump", true);
    collectReplicationStateDumpArg.addLongIdentifier("includeReplicationState", true);
    collectReplicationStateDumpArg.addLongIdentifier("include-replication-state", true);
    collectReplicationStateDumpArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(collectReplicationStateDumpArg);
    includeBinaryFilesArg = new BooleanArgument(null, "includeBinaryFiles", 1, INFO_CSD_ARG_DESC_INCLUDE_BINARY_FILES.get());
    includeBinaryFilesArg.addLongIdentifier("include-binary-files", true);
    includeBinaryFilesArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(includeBinaryFilesArg);
    archiveExtensionSourceArg = new BooleanArgument(null, "archiveExtensionSource", 1, INFO_CSD_ARG_DESC_ARCHIVE_EXTENSION_SOURCE.get());
    archiveExtensionSourceArg.addLongIdentifier("archive-extension-source", true);
    archiveExtensionSourceArg.addLongIdentifier("includeExtensionSource", true);
    archiveExtensionSourceArg.addLongIdentifier("include-extension-source", true);
    archiveExtensionSourceArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(archiveExtensionSourceArg);
    sequentialArg = new BooleanArgument(null, "sequential", 1, INFO_CSD_ARG_DESC_SEQUENTIAL.get());
    sequentialArg.addLongIdentifier("sequentialMode", true);
    sequentialArg.addLongIdentifier("sequential-mode", true);
    sequentialArg.addLongIdentifier("useSequentialMode", true);
    sequentialArg.addLongIdentifier("use-sequential-mode", true);
    sequentialArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(sequentialArg);
    securityLevelArg = new StringArgument(null, "securityLevel", false, 1, INFO_CSD_ARG_PLACEHOLDER_SECURITY_LEVEL.get(), INFO_CSD_ARG_DESC_SECURITY_LEVEL.get(), StaticUtils.setOf(CollectSupportDataSecurityLevel.NONE.getName(), CollectSupportDataSecurityLevel.OBSCURE_SECRETS.getName(), CollectSupportDataSecurityLevel.MAXIMUM.getName()));
    securityLevelArg.addLongIdentifier("security-level", true);
    securityLevelArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(securityLevelArg);
    jstackCountArg = new IntegerArgument(null, "jstackCount", false, 1, INFO_CSD_ARG_PLACEHOLDER_COUNT.get(), INFO_CSD_ARG_DESC_JSTACK_COUNT.get(), 0, Integer.MAX_VALUE);
    jstackCountArg.addLongIdentifier("jstack-count", true);
    jstackCountArg.addLongIdentifier("maxJstacks", true);
    jstackCountArg.addLongIdentifier("max-jstacks", true);
    jstackCountArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(jstackCountArg);
    reportCountArg = new IntegerArgument(null, "reportCount", false, 1, INFO_CSD_ARG_PLACEHOLDER_COUNT.get(), INFO_CSD_ARG_DESC_REPORT_COUNT.get(), 0, Integer.MAX_VALUE);
    reportCountArg.addLongIdentifier("report-count", true);
    reportCountArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(reportCountArg);
    reportIntervalSecondsArg = new IntegerArgument(null, "reportIntervalSeconds", false, 1, INFO_CSD_ARG_PLACEHOLDER_SECONDS.get(), INFO_CSD_ARG_DESC_REPORT_INTERVAL_SECONDS.get(), 1, Integer.MAX_VALUE);
    reportIntervalSecondsArg.addLongIdentifier("report-interval-seconds", true);
    reportIntervalSecondsArg.addLongIdentifier("reportInterval", true);
    reportIntervalSecondsArg.addLongIdentifier("report-interval", true);
    reportIntervalSecondsArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(reportIntervalSecondsArg);
    logTimeRangeArg = new StringArgument(null, "logTimeRange", false, 1, INFO_CSD_ARG_PLACEHOLDER_TIME_RANGE.get(), INFO_CSD_ARG_DESC_TIME_RANGE.get());
    logTimeRangeArg.addLongIdentifier("log-time-range", true);
    logTimeRangeArg.addLongIdentifier("timeRange", true);
    logTimeRangeArg.addLongIdentifier("time-range", true);
    logTimeRangeArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(logTimeRangeArg);
    logDurationArg = new DurationArgument(null, "logDuration", false, null, INFO_CSD_ARG_DESC_DURATION.get());
    logDurationArg.addLongIdentifier("log-duration", true);
    logDurationArg.addLongIdentifier("duration", true);
    logDurationArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(logDurationArg);
    logFileHeadCollectionSizeKBArg = new IntegerArgument(null, "logFileHeadCollectionSizeKB", false, 1, INFO_CSD_ARG_PLACEHOLDER_SIZE_KB.get(), INFO_CSD_ARG_DESC_LOG_HEAD_SIZE_KB.get(), 0, Integer.MAX_VALUE);
    logFileHeadCollectionSizeKBArg.addLongIdentifier("log-file-head-collection-size-kb", true);
    logFileHeadCollectionSizeKBArg.addLongIdentifier("logFileHeadSizeKB", true);
    logFileHeadCollectionSizeKBArg.addLongIdentifier("log-file-head-size-kb", true);
    logFileHeadCollectionSizeKBArg.addLongIdentifier("logHeadCollectionSizeKB", true);
    logFileHeadCollectionSizeKBArg.addLongIdentifier("log-head-collection-size-kb", true);
    logFileHeadCollectionSizeKBArg.addLongIdentifier("logHeadSizeKB", true);
    logFileHeadCollectionSizeKBArg.addLongIdentifier("log-head-size-kb", true);
    logFileHeadCollectionSizeKBArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(logFileHeadCollectionSizeKBArg);
    logFileTailCollectionSizeKBArg = new IntegerArgument(null, "logFileTailCollectionSizeKB", false, 1, INFO_CSD_ARG_PLACEHOLDER_SIZE_KB.get(), INFO_CSD_ARG_DESC_LOG_TAIL_SIZE_KB.get(), 0, Integer.MAX_VALUE);
    logFileTailCollectionSizeKBArg.addLongIdentifier("log-file-tail-collection-size-kb", true);
    logFileTailCollectionSizeKBArg.addLongIdentifier("logFileTailSizeKB", true);
    logFileTailCollectionSizeKBArg.addLongIdentifier("log-file-tail-size-kb", true);
    logFileTailCollectionSizeKBArg.addLongIdentifier("logTailCollectionSizeKB", true);
    logFileTailCollectionSizeKBArg.addLongIdentifier("log-tail-collection-size-kb", true);
    logFileTailCollectionSizeKBArg.addLongIdentifier("logTailSizeKB", true);
    logFileTailCollectionSizeKBArg.addLongIdentifier("log-tail-size-kb", true);
    logFileTailCollectionSizeKBArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(logFileTailCollectionSizeKBArg);
    pidArg = new IntegerArgument(null, "pid", false, 0, INFO_CSD_ARG_PLACEHOLDER_PID.get(), INFO_CSD_ARG_DESC_PID.get());
    pidArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(pidArg);
    commentArg = new StringArgument(null, "comment", false, 1, null, INFO_CSD_ARG_DESC_COMMENT.get());
    commentArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COLLECTION.get());
    parser.addArgument(commentArg);
    // Communication-related arguments.
    useRemoteServerArg = new BooleanArgument(null, "useRemoteServer", 1, INFO_CSD_ARG_DEC_USE_REMOTE_SERVER.get());
    useRemoteServerArg.addLongIdentifier("use-remote-server", true);
    useRemoteServerArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COMMUNICATION.get());
    parser.addArgument(useRemoteServerArg);
    useAdministrativeSessionArg = new BooleanArgument(null, "useAdministrativeSession", 1, INFO_CSD_ARG_DESC_USE_ADMIN_SESSION.get());
    useAdministrativeSessionArg.addLongIdentifier("use-administrative-session", true);
    useAdministrativeSessionArg.addLongIdentifier("useAdminSession", true);
    useAdministrativeSessionArg.addLongIdentifier("use-admin-session", true);
    useAdministrativeSessionArg.addLongIdentifier("administrativeSession", true);
    useAdministrativeSessionArg.addLongIdentifier("administrative-session", true);
    useAdministrativeSessionArg.addLongIdentifier("adminSession", true);
    useAdministrativeSessionArg.addLongIdentifier("admin-session", true);
    useAdministrativeSessionArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COMMUNICATION.get());
    parser.addArgument(useAdministrativeSessionArg);
    proxyToServerAddressArg = new StringArgument(null, "proxyToServerAddress", false, 1, INFO_CSD_ARG_PLACEHOLDER_ADDRESS.get(), INFO_CSD_ARG_DESC_PROXY_TO_ADDRESS.get());
    proxyToServerAddressArg.addLongIdentifier("proxy-to-server-address", true);
    proxyToServerAddressArg.addLongIdentifier("proxyToAddress", true);
    proxyToServerAddressArg.addLongIdentifier("proxy-to-address", true);
    proxyToServerAddressArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COMMUNICATION.get());
    parser.addArgument(proxyToServerAddressArg);
    proxyToServerPortArg = new IntegerArgument(null, "proxyToServerPort", false, 1, INFO_CSD_ARG_PLACEHOLDER_PORT.get(), INFO_CSD_ARG_DESC_PROXY_TO_PORT.get(), 1, 65535);
    proxyToServerPortArg.addLongIdentifier("proxy-to-server-port", true);
    proxyToServerPortArg.addLongIdentifier("proxyToPort", true);
    proxyToServerPortArg.addLongIdentifier("proxy-to-port", true);
    proxyToServerPortArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COMMUNICATION.get());
    parser.addArgument(proxyToServerPortArg);
    noLDAPArg = new BooleanArgument(null, "noLDAP", 1, INFO_CSD_ARG_DESC_NO_LDAP.get());
    noLDAPArg.addLongIdentifier("no-ldap", true);
    noLDAPArg.setArgumentGroupName(INFO_CSD_ARG_GROUP_COMMUNICATION.get());
    parser.addArgument(noLDAPArg);
    // Other arguments.
    noPromptArg = new BooleanArgument('n', "noPrompt", 1, INFO_CSD_ARG_DESC_NO_PROMPT.get());
    noPromptArg.addLongIdentifier("no-prompt", true);
    parser.addArgument(noPromptArg);
    dryRunArg = new BooleanArgument(null, "dryRun", 1, INFO_CSD_ARG_DESC_DRY_RUN.get());
    dryRunArg.addLongIdentifier("dry-run", true);
    dryRunArg.addLongIdentifier("noOperation", true);
    dryRunArg.addLongIdentifier("no-operation", true);
    dryRunArg.addLongIdentifier("noOp", true);
    dryRunArg.addLongIdentifier("no-op", true);
    parser.addArgument(dryRunArg);
    scriptFriendlyArg = new BooleanArgument(null, "scriptFriendly", 1, INFO_CSD_ARG_DESC_SCRIPT_FRIENDLY.get());
    scriptFriendlyArg.addLongIdentifier("script-friendly", true);
    scriptFriendlyArg.setHidden(true);
    parser.addArgument(scriptFriendlyArg);
    // If the --useRemoteServer argument is provided, then none of the --pid,
    // --decrypt, --noLDAP, or --scriptFriendly arguments may be given.
    parser.addExclusiveArgumentSet(useRemoteServerArg, pidArg);
    parser.addExclusiveArgumentSet(useRemoteServerArg, decryptArg);
    parser.addExclusiveArgumentSet(useRemoteServerArg, noLDAPArg);
    parser.addExclusiveArgumentSet(useRemoteServerArg, scriptFriendlyArg);
    // The --useAdministrativeSession argument can only be provided if the
    // --useRemoteServer argument is also given.
    parser.addDependentArgumentSet(useAdministrativeSessionArg, useRemoteServerArg);
    // If the --proxyToServerAddress or --proxyToServerPort argument is given,
    // then the other must be provided as well.
    parser.addMutuallyDependentArgumentSet(proxyToServerAddressArg, proxyToServerPortArg);
    // The --proxyToServerAddress and --proxyToServerPort arguments can only
    // be used if the --useRemoteServer argument is given.
    parser.addDependentArgumentSet(proxyToServerAddressArg, useRemoteServerArg);
    parser.addDependentArgumentSet(proxyToServerPortArg, useRemoteServerArg);
    // The --logTimeRange and --logDuration arguments cannot be used together.
    parser.addExclusiveArgumentSet(logTimeRangeArg, logDurationArg);
    // Neither the --logFileHeadCollectionSizeKB argument nor the
    // --logFileTailCollectionSizeKB argument can be used in conjunction with
    // either the --logTimeRange or --logDuration argument.
    parser.addExclusiveArgumentSet(logFileHeadCollectionSizeKBArg, logTimeRangeArg, logDurationArg);
    parser.addExclusiveArgumentSet(logFileTailCollectionSizeKBArg, logTimeRangeArg, logDurationArg);
    // The --generatePassphrase argument can only be used if both the
    // --encrypt and --passphraseFile arguments are provided.
    parser.addDependentArgumentSet(generatePassphraseArg, encryptArg);
    parser.addDependentArgumentSet(generatePassphraseArg, passphraseFileArg);
    // The --encrypt and --decrypt arguments cannot be used together.
    parser.addExclusiveArgumentSet(encryptArg, decryptArg);
    // --useRemoteServer argument.
    for (final String argumentIdentifier : Arrays.asList("promptForBindPassword", "promptForKeyStorePassword", "promptForTrustStorePassword", "enableSSLDebugging", "useSASLExternal")) {
        final Argument arg = parser.getNamedArgument(argumentIdentifier);
        parser.addDependentArgumentSet(arg, useRemoteServerArg);
    }
}
Also used : DurationArgument(com.unboundid.util.args.DurationArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) DurationArgument(com.unboundid.util.args.DurationArgument) Argument(com.unboundid.util.args.Argument) BooleanArgument(com.unboundid.util.args.BooleanArgument) TimestampArgument(com.unboundid.util.args.TimestampArgument) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument) BooleanArgument(com.unboundid.util.args.BooleanArgument) IntegerArgument(com.unboundid.util.args.IntegerArgument) ASN1OctetString(com.unboundid.asn1.ASN1OctetString) FileArgument(com.unboundid.util.args.FileArgument) StringArgument(com.unboundid.util.args.StringArgument)

Aggregations

BooleanArgument (com.unboundid.util.args.BooleanArgument)6 DurationArgument (com.unboundid.util.args.DurationArgument)6 FileArgument (com.unboundid.util.args.FileArgument)6 IntegerArgument (com.unboundid.util.args.IntegerArgument)6 StringArgument (com.unboundid.util.args.StringArgument)6 ControlArgument (com.unboundid.util.args.ControlArgument)5 DNArgument (com.unboundid.util.args.DNArgument)5 ASN1OctetString (com.unboundid.asn1.ASN1OctetString)3 FilterArgument (com.unboundid.util.args.FilterArgument)3 TimestampArgument (com.unboundid.util.args.TimestampArgument)2 Argument (com.unboundid.util.args.Argument)1 ArgumentListArgument (com.unboundid.util.args.ArgumentListArgument)1 ArgumentParser (com.unboundid.util.args.ArgumentParser)1 BooleanValueArgument (com.unboundid.util.args.BooleanValueArgument)1 ScopeArgument (com.unboundid.util.args.ScopeArgument)1 LinkedHashSet (java.util.LinkedHashSet)1