use of com.unboundid.util.args.DNArgument in project ldapsdk by pingidentity.
the class DeliverPasswordResetToken method addNonLDAPArguments.
/**
* {@inheritDoc}
*/
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
userDN = new DNArgument('b', "userDN", true, 1, INFO_DELIVER_PW_RESET_TOKEN_PLACEHOLDER_DN.get(), INFO_DELIVER_PW_RESET_TOKEN_DESCRIPTION_USER_DN.get());
userDN.setArgumentGroupName(INFO_DELIVER_PW_RESET_TOKEN_GROUP_ID.get());
userDN.addLongIdentifier("user-dn", true);
parser.addArgument(userDN);
deliveryMechanism = new StringArgument('m', "deliveryMechanism", false, 0, INFO_DELIVER_PW_RESET_TOKEN_PLACEHOLDER_NAME.get(), INFO_DELIVER_PW_RESET_TOKEN_DESCRIPTION_MECH.get());
deliveryMechanism.setArgumentGroupName(INFO_DELIVER_PW_RESET_TOKEN_GROUP_DELIVERY_MECH.get());
deliveryMechanism.addLongIdentifier("delivery-mechanism", true);
parser.addArgument(deliveryMechanism);
messageSubject = new StringArgument('s', "messageSubject", false, 1, INFO_DELIVER_PW_RESET_TOKEN_PLACEHOLDER_SUBJECT.get(), INFO_DELIVER_PW_RESET_TOKEN_DESCRIPTION_SUBJECT.get());
messageSubject.setArgumentGroupName(INFO_DELIVER_PW_RESET_TOKEN_GROUP_DELIVERY_MECH.get());
messageSubject.addLongIdentifier("message-subject", true);
parser.addArgument(messageSubject);
fullTextBeforeToken = new StringArgument('f', "fullTextBeforeToken", false, 1, INFO_DELIVER_PW_RESET_TOKEN_PLACEHOLDER_FULL_BEFORE.get(), INFO_DELIVER_PW_RESET_TOKEN_DESCRIPTION_FULL_BEFORE.get());
fullTextBeforeToken.setArgumentGroupName(INFO_DELIVER_PW_RESET_TOKEN_GROUP_DELIVERY_MECH.get());
fullTextBeforeToken.addLongIdentifier("full-text-before-token", true);
parser.addArgument(fullTextBeforeToken);
fullTextAfterToken = new StringArgument('F', "fullTextAfterToken", false, 1, INFO_DELIVER_PW_RESET_TOKEN_PLACEHOLDER_FULL_AFTER.get(), INFO_DELIVER_PW_RESET_TOKEN_DESCRIPTION_FULL_AFTER.get());
fullTextAfterToken.setArgumentGroupName(INFO_DELIVER_PW_RESET_TOKEN_GROUP_DELIVERY_MECH.get());
fullTextAfterToken.addLongIdentifier("full-text-after-token", true);
parser.addArgument(fullTextAfterToken);
compactTextBeforeToken = new StringArgument('c', "compactTextBeforeToken", false, 1, INFO_DELIVER_PW_RESET_TOKEN_PLACEHOLDER_COMPACT_BEFORE.get(), INFO_DELIVER_PW_RESET_TOKEN_DESCRIPTION_COMPACT_BEFORE.get());
compactTextBeforeToken.setArgumentGroupName(INFO_DELIVER_PW_RESET_TOKEN_GROUP_DELIVERY_MECH.get());
compactTextBeforeToken.addLongIdentifier("compact-text-before-token", true);
parser.addArgument(compactTextBeforeToken);
compactTextAfterToken = new StringArgument('C', "compactTextAfterToken", false, 1, INFO_DELIVER_PW_RESET_TOKEN_PLACEHOLDER_COMPACT_AFTER.get(), INFO_DELIVER_PW_RESET_TOKEN_DESCRIPTION_COMPACT_AFTER.get());
compactTextAfterToken.setArgumentGroupName(INFO_DELIVER_PW_RESET_TOKEN_GROUP_DELIVERY_MECH.get());
compactTextAfterToken.addLongIdentifier("compact-text-after-token", true);
parser.addArgument(compactTextAfterToken);
}
use of com.unboundid.util.args.DNArgument in project ldapsdk by pingidentity.
the class MoveSubtree method addNonLDAPArguments.
/**
* {@inheritDoc}
*/
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
baseDN = new DNArgument('b', "baseDN", false, 0, INFO_MOVE_SUBTREE_ARG_BASE_DN_PLACEHOLDER.get(), INFO_MOVE_SUBTREE_ARG_BASE_DN_DESCRIPTION.get());
baseDN.addLongIdentifier("entryDN", true);
parser.addArgument(baseDN);
baseDNFile = new FileArgument('f', "baseDNFile", false, 1, INFO_MOVE_SUBTREE_ARG_BASE_DN_FILE_PLACEHOLDER.get(), INFO_MOVE_SUBTREE_ARG_BASE_DN_FILE_DESCRIPTION.get(), true, true, true, false);
baseDNFile.addLongIdentifier("entryDNFile", true);
parser.addArgument(baseDNFile);
sizeLimit = new IntegerArgument('z', "sizeLimit", false, 1, INFO_MOVE_SUBTREE_ARG_SIZE_LIMIT_PLACEHOLDER.get(), INFO_MOVE_SUBTREE_ARG_SIZE_LIMIT_DESCRIPTION.get(), 0, Integer.MAX_VALUE, 0);
parser.addArgument(sizeLimit);
purpose = new StringArgument(null, "purpose", false, 1, INFO_MOVE_SUBTREE_ARG_PURPOSE_PLACEHOLDER.get(), INFO_MOVE_SUBTREE_ARG_PURPOSE_DESCRIPTION.get());
parser.addArgument(purpose);
verbose = new BooleanArgument('v', "verbose", 1, INFO_MOVE_SUBTREE_ARG_VERBOSE_DESCRIPTION.get());
parser.addArgument(verbose);
parser.addRequiredArgumentSet(baseDN, baseDNFile);
parser.addExclusiveArgumentSet(baseDN, baseDNFile);
}
use of com.unboundid.util.args.DNArgument in project ldapsdk by pingidentity.
the class SubtreeAccessibility method addNonLDAPArguments.
/**
* Adds the arguments needed by this command-line tool to the provided
* argument parser which are not related to connecting or authenticating to
* the directory server.
*
* @param parser The argument parser to which the arguments should be added.
*
* @throws ArgumentException If a problem occurs while adding the arguments.
*/
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
set = new BooleanArgument('s', "set", 1, "Indicates that the set of accessibility restrictions should be " + "updated rather than retrieved.");
parser.addArgument(set);
baseDN = new DNArgument('b', "baseDN", false, 1, "{dn}", "The base DN of the subtree for which an accessibility restriction " + "is to be updated.");
baseDN.addLongIdentifier("base-dn", true);
parser.addArgument(baseDN);
accessibilityState = new StringArgument('S', "state", false, 1, "{state}", "The accessibility state to use for the accessibility restriction " + "on the target subtree. Allowed values: " + SubtreeAccessibilityState.ACCESSIBLE.getStateName() + ", " + SubtreeAccessibilityState.READ_ONLY_BIND_ALLOWED.getStateName() + ", " + SubtreeAccessibilityState.READ_ONLY_BIND_DENIED.getStateName() + ", " + SubtreeAccessibilityState.HIDDEN.getStateName() + '.', ALLOWED_ACCESSIBILITY_STATES);
parser.addArgument(accessibilityState);
bypassUserDN = new DNArgument('B', "bypassUserDN", false, 1, "{dn}", "The DN of a user who is allowed to bypass restrictions on the " + "target subtree.");
bypassUserDN.addLongIdentifier("bypass-user-dn", true);
parser.addArgument(bypassUserDN);
// The baseDN, accessibilityState, and bypassUserDN arguments can only be
// used if the set argument was provided.
parser.addDependentArgumentSet(baseDN, set);
parser.addDependentArgumentSet(accessibilityState, set);
parser.addDependentArgumentSet(bypassUserDN, set);
// If the set argument was provided, then the base DN and accessibilityState
// arguments must also be given.
parser.addDependentArgumentSet(set, baseDN);
parser.addDependentArgumentSet(set, accessibilityState);
}
use of com.unboundid.util.args.DNArgument in project ldapsdk by pingidentity.
the class DumpDNs method addNonLDAPArguments.
/**
* Adds the arguments needed by this command-line tool to the provided
* argument parser which are not related to connecting or authenticating to
* the directory server.
*
* @param parser The argument parser to which the arguments should be added.
*
* @throws ArgumentException If a problem occurs while adding the arguments.
*/
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
baseDN = new DNArgument('b', "baseDN", true, 1, "{dn}", "The base DN below which to dump the DNs of all entries in the " + "Directory Server.");
baseDN.addLongIdentifier("base-dn", true);
parser.addArgument(baseDN);
outputFile = new FileArgument('f', "outputFile", false, 1, "{path}", "The path of the output file to which the entry DNs will be " + "written. If this is not provided, then entry DNs will be " + "written to standard output.", false, true, true, false);
outputFile.addLongIdentifier("output-file", true);
parser.addArgument(outputFile);
}
use of com.unboundid.util.args.DNArgument in project ldapsdk by pingidentity.
the class LDAPCompare method addNonLDAPArguments.
/**
* {@inheritDoc}
*/
@Override()
public void addNonLDAPArguments(@NotNull final ArgumentParser parser) throws ArgumentException {
argumentParser = parser;
// Compare operation processing arguments.
dnFile = new FileArgument('f', "dnFile", false, 1, null, INFO_LDAPCOMPARE_ARG_DESCRIPTION_DN_FILE.get(), true, true, true, false);
dnFile.addLongIdentifier("dn-file", true);
dnFile.addLongIdentifier("filename", true);
dnFile.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_PROCESSING.get());
parser.addArgument(dnFile);
assertionFile = new FileArgument(null, "assertionFile", false, 1, null, INFO_LDAPCOMPARE_ARG_DESCRIPTION_ASSERTION_FILE.get(), true, true, true, false);
assertionFile.addLongIdentifier("assertion-file", true);
assertionFile.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_PROCESSING.get());
parser.addArgument(assertionFile);
followReferrals = new BooleanArgument(null, "followReferrals", 1, INFO_LDAPCOMPARE_ARG_DESCRIPTION_FOLLOW_REFERRALS.get());
followReferrals.addLongIdentifier("follow-referrals", true);
followReferrals.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_PROCESSING.get());
parser.addArgument(followReferrals);
useAdministrativeSession = new BooleanArgument(null, "useAdministrativeSession", 1, INFO_LDAPCOMPARE_ARG_DESCRIPTION_USE_ADMIN_SESSION.get());
useAdministrativeSession.addLongIdentifier("use-administrative-session", true);
useAdministrativeSession.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_PROCESSING.get());
parser.addArgument(useAdministrativeSession);
continueOnError = new BooleanArgument('c', "continueOnError", 1, INFO_LDAPCOMPARE_ARG_DESCRIPTION_CONTINUE_ON_ERROR.get());
continueOnError.addLongIdentifier("continue-on-error", true);
continueOnError.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_PROCESSING.get());
parser.addArgument(continueOnError);
dryRun = new BooleanArgument('n', "dryRun", 1, INFO_LDAPCOMPARE_ARG_DESCRIPTION_DRY_RUN.get());
dryRun.addLongIdentifier("dry-run", true);
dryRun.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_PROCESSING.get());
parser.addArgument(dryRun);
// Bind control arguments.
bindControl = new ControlArgument(null, "bindControl", false, 0, null, INFO_LDAPCOMPARE_ARG_DESCRIPTION_BIND_CONTROL.get());
bindControl.addLongIdentifier("bind-control", true);
bindControl.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_BIND_CONTROLS.get());
parser.addArgument(bindControl);
authorizationIdentity = new BooleanArgument('E', "authorizationIdentity", 1, INFO_LDAPCOMPARE_ARG_DESCRIPTION_AUTHZ_IDENTITY.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(INFO_LDAPCOMPARE_ARG_GROUP_BIND_CONTROLS.get());
parser.addArgument(authorizationIdentity);
usePasswordPolicyControl = new BooleanArgument(null, "usePasswordPolicyControl", 1, INFO_LDAPCOMPARE_ARG_DESCRIPTION_USE_PW_POLICY_CONTROL.get());
usePasswordPolicyControl.addLongIdentifier("use-password-policy-control", true);
usePasswordPolicyControl.addLongIdentifier("passwordPolicyControl", true);
usePasswordPolicyControl.addLongIdentifier("password-policy-control", true);
usePasswordPolicyControl.addLongIdentifier("passwordPolicy", true);
usePasswordPolicyControl.addLongIdentifier("password-policy", true);
usePasswordPolicyControl.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_BIND_CONTROLS.get());
parser.addArgument(usePasswordPolicyControl);
getAuthorizationEntryAttribute = new StringArgument(null, "getAuthorizationEntryAttribute", false, 0, INFO_LDAPCOMPARE_ARG_PLACEHOLDER_ATTRIBUTE.get(), INFO_LDAPCOMPARE_ARG_DESCRIPTION_GET_AUTHZ_ENTRY_ATTR.get());
getAuthorizationEntryAttribute.addLongIdentifier("get-authorization-entry-attribute", true);
getAuthorizationEntryAttribute.addLongIdentifier("getAuthzEntryAttribute", true);
getAuthorizationEntryAttribute.addLongIdentifier("get-authz-entry-attribute", true);
getAuthorizationEntryAttribute.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_BIND_CONTROLS.get());
parser.addArgument(getAuthorizationEntryAttribute);
getUserResourceLimits = new BooleanArgument(null, "getUserResourceLimits", 1, INFO_LDAPCOMPARE_ARG_PLACEHOLDER_GET_USER_RESOURCE_LIMITS.get());
getUserResourceLimits.addLongIdentifier("get-user-resource-limits", true);
getUserResourceLimits.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_BIND_CONTROLS.get());
parser.addArgument(getUserResourceLimits);
// Compare control arguments.
compareControl = new ControlArgument('J', "compareControl", false, 0, null, INFO_LDAPCOMPARE_ARG_DESCRIPTION_COMPARE_CONTROL.get());
compareControl.addLongIdentifier("compare-control", true);
compareControl.addLongIdentifier("control", true);
compareControl.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_COMPARE_CONTROLS.get());
parser.addArgument(compareControl);
proxyAs = new StringArgument('Y', "proxyAs", false, 1, INFO_LDAPCOMPARE_ARG_PLACEHOLDER_AUTHZ_ID.get(), INFO_LDAPCOMPARE_ARG_DESCRIPTION_PROXY_AS.get());
proxyAs.addLongIdentifier("proxy-as", true);
proxyAs.addLongIdentifier("proxyV2As", true);
proxyAs.addLongIdentifier("proxy-v2-as", true);
proxyAs.addLongIdentifier("proxyV2", true);
proxyAs.addLongIdentifier("proxy-v2", true);
proxyAs.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_COMPARE_CONTROLS.get());
parser.addArgument(proxyAs);
proxyV1As = new DNArgument(null, "proxyV1As", false, 1, null, INFO_LDAPCOMPARE_ARG_DESCRIPTION_PROXY_V1_AS.get());
proxyV1As.addLongIdentifier("proxy-v1-as", true);
proxyV1As.addLongIdentifier("proxyV1", true);
proxyV1As.addLongIdentifier("proxy-v1", true);
proxyV1As.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_COMPARE_CONTROLS.get());
parser.addArgument(proxyV1As);
manageDsaIT = new BooleanArgument(null, "manageDsaIT", 1, INFO_LDAPCOMPARE_ARG_DESCRIPTION_MANAGE_DSA_IT.get());
manageDsaIT.addLongIdentifier("manage-dsa-it", true);
manageDsaIT.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_COMPARE_CONTROLS.get());
parser.addArgument(manageDsaIT);
assertionFilter = new FilterArgument(null, "assertionFilter", false, 1, null, INFO_LDAPCOMPARE_ARG_DESCRIPTION_ASSERTION_FILTER.get());
assertionFilter.addLongIdentifier("assertion-filter", true);
assertionFilter.addLongIdentifier("assertionControlFilter", true);
assertionFilter.addLongIdentifier("assertion-control-filter", true);
assertionFilter.addLongIdentifier("useAssertionControl", true);
assertionFilter.addLongIdentifier("use-assertion-control", true);
assertionFilter.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_COMPARE_CONTROLS.get());
parser.addArgument(assertionFilter);
operationPurpose = new StringArgument(null, "operationPurpose", false, 1, INFO_LDAPCOMPARE_ARG_PLACEHOLDER_PURPOSE.get(), INFO_LDAPCOMPARE_ARG_DESCRIPTION_OPERATION_PURPOSE.get());
operationPurpose.addLongIdentifier("operation-purpose", true);
operationPurpose.addLongIdentifier("purpose", true);
operationPurpose.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_COMPARE_CONTROLS.get());
parser.addArgument(operationPurpose);
// Output Arguments.
outputFile = new FileArgument(null, "outputFile", false, 1, null, INFO_LDAPCOMPARE_ARG_DESCRIPTION_OUTPUT_FILE.get(), false, true, true, false);
outputFile.addLongIdentifier("output-file", true);
outputFile.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_OUTPUT.get());
parser.addArgument(outputFile);
teeOutput = new BooleanArgument(null, "teeOutput", 1, INFO_LDAPCOMPARE_ARG_DESCRIPTION_TEE_OUTPUT.get());
teeOutput.addLongIdentifier("tee-output", true);
teeOutput.addLongIdentifier("tee", true);
teeOutput.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_OUTPUT.get());
parser.addArgument(teeOutput);
outputFormat = new StringArgument(null, "outputFormat", false, 1, INFO_LDAPCOMPARE_ARG_PLACEHOLDER_FORMAT.get(), INFO_LDAPCOMPARE_ARG_DESCRIPTION_OUTPUT_FORMAT.get(), StaticUtils.setOf(OUTPUT_FORMAT_TAB_DELIMITED, OUTPUT_FORMAT_CSV, OUTPUT_FORMAT_JSON), OUTPUT_FORMAT_TAB_DELIMITED);
outputFormat.addLongIdentifier("output-format", true);
outputFormat.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_OUTPUT.get());
parser.addArgument(outputFormat);
scriptFriendly = new BooleanArgument(null, "scriptFriendly", 1, INFO_LDAPCOMPARE_ARG_DESCRIPTION_SCRIPT_FRIENDLY.get());
scriptFriendly.addLongIdentifier("script-friendly", true);
scriptFriendly.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_OUTPUT.get());
scriptFriendly.setHidden(true);
parser.addArgument(scriptFriendly);
verbose = new BooleanArgument('v', "verbose", 1, INFO_LDAPCOMPARE_ARG_DESCRIPTION_VERBOSE.get());
verbose.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_OUTPUT.get());
parser.addArgument(verbose);
terse = new BooleanArgument(null, "terse", 1, INFO_LDAPCOMPARE_ARG_DESCRIPTION_TERSE.get());
terse.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_OUTPUT.get());
parser.addArgument(terse);
useCompareResultCodeAsExitCode = new BooleanArgument(null, "useCompareResultCodeAsExitCode", 1, INFO_LDAPCOMPARE_ARG_DESC_USE_COMPARE_RESULT_CODE_AS_EXIT_CODE.get());
useCompareResultCodeAsExitCode.addLongIdentifier("use-compare-result-code-as-exit-code", true);
useCompareResultCodeAsExitCode.addLongIdentifier("useCompareResultCode", true);
useCompareResultCodeAsExitCode.addLongIdentifier("use-compare-result-code", true);
useCompareResultCodeAsExitCode.setArgumentGroupName(INFO_LDAPCOMPARE_ARG_GROUP_OUTPUT.get());
parser.addArgument(useCompareResultCodeAsExitCode);
parser.addExclusiveArgumentSet(dnFile, assertionFile);
parser.addExclusiveArgumentSet(proxyAs, proxyV1As);
parser.addDependentArgumentSet(teeOutput, outputFile);
parser.addExclusiveArgumentSet(verbose, terse);
}
Aggregations