Class EdCli
- java.lang.Object
-
- edu.vt.middleware.ldap.ed.executables.EdCli
-
public class EdCli extends Object
Provides a command line interface to ED operations.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTHN_OPTIONAuthenticate option flag.static StringAUTHZ_OPTIONAuthorize option flag.static StringCREDENTIAL_OPTIONCredential option flag.static StringENV_OPTIONDirectory environment option.static StringHELP_LONG_OPTIONHelp long option flag.static StringHELP_OPTIONHelp option flag.static StringMFA_OPTIONUse MFA option flag.static StringMFA_VALUE_OPTIONUse MFA value option flag.static StringQUERY_OPTIONQuery option flag.static StringSHOW_AFFILIATIONS_OPTIONShow affiliations option flag.static StringSHOW_GROUP_MEMBERSHIP_OPTIONShow group membership option flag.static StringTYPE_OPTIONDirectory type option.static StringUSER_OPTIONUser option flag.
-
Constructor Summary
Constructors Constructor Description EdCli()Creates a new instance able to handle command line operations.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.ldaptive.LdapEntryauthenticate(org.apache.commons.cli.CommandLine cmd, String... attributes)Authenticates the user specified on the command line.voidauthorize(org.apache.commons.cli.CommandLine cmd, org.ldaptive.LdapEntry entry)Authenticates and authorizes the user using command line options.voiddisplayAffiliations(org.apache.commons.cli.CommandLine cmd, org.ldaptive.LdapEntry entry)Authenticates the user specified on the command line and displays their affiliations.voiddisplayGroupMembership(org.apache.commons.cli.CommandLine cmd, org.ldaptive.LdapEntry entry)Authenticates the user specified on the command line and displays their group membership.org.apache.commons.cli.OptionsgetOptions()Gets the Commons CLI options available for this command line client.static voidmain(String[] args)Application entry point for command line operations.voidquery(org.apache.commons.cli.CommandLine cmd)Executes a query specified on the command line and displays the requested attributes on standard out.
-
-
-
Field Detail
-
HELP_OPTION
public static final String HELP_OPTION
Help option flag.- See Also:
- Constant Field Values
-
HELP_LONG_OPTION
public static final String HELP_LONG_OPTION
Help long option flag.- See Also:
- Constant Field Values
-
TYPE_OPTION
public static final String TYPE_OPTION
Directory type option.- See Also:
- Constant Field Values
-
ENV_OPTION
public static final String ENV_OPTION
Directory environment option.- See Also:
- Constant Field Values
-
QUERY_OPTION
public static final String QUERY_OPTION
Query option flag.- See Also:
- Constant Field Values
-
AUTHN_OPTION
public static final String AUTHN_OPTION
Authenticate option flag.- See Also:
- Constant Field Values
-
MFA_OPTION
public static final String MFA_OPTION
Use MFA option flag.- See Also:
- Constant Field Values
-
MFA_VALUE_OPTION
public static final String MFA_VALUE_OPTION
Use MFA value option flag.- See Also:
- Constant Field Values
-
AUTHZ_OPTION
public static final String AUTHZ_OPTION
Authorize option flag.- See Also:
- Constant Field Values
-
USER_OPTION
public static final String USER_OPTION
User option flag.- See Also:
- Constant Field Values
-
CREDENTIAL_OPTION
public static final String CREDENTIAL_OPTION
Credential option flag.- See Also:
- Constant Field Values
-
SHOW_AFFILIATIONS_OPTION
public static final String SHOW_AFFILIATIONS_OPTION
Show affiliations option flag.- See Also:
- Constant Field Values
-
SHOW_GROUP_MEMBERSHIP_OPTION
public static final String SHOW_GROUP_MEMBERSHIP_OPTION
Show group membership option flag.- See Also:
- Constant Field Values
-
-
Method Detail
-
getOptions
public org.apache.commons.cli.Options getOptions()
Gets the Commons CLI options available for this command line client.- Returns:
- Available options.
-
query
public void query(org.apache.commons.cli.CommandLine cmd) throws ExceptionExecutes a query specified on the command line and displays the requested attributes on standard out.- Parameters:
cmd- Command line.- Throws:
Exception- On any failure
-
authenticate
public org.ldaptive.LdapEntry authenticate(org.apache.commons.cli.CommandLine cmd, String... attributes) throws ExceptionAuthenticates the user specified on the command line. If no credential was supplied on the command line, it is prompted to be read from standard input.- Parameters:
cmd- Command line.attributes- Attributes to return- Returns:
- Found
LdapEntry - Throws:
Exception- On any failure
-
authorize
public final void authorize(org.apache.commons.cli.CommandLine cmd, org.ldaptive.LdapEntry entry) throws ExceptionAuthenticates and authorizes the user using command line options. If no credential was supplied on the command line, it is prompted to be read from standard input.- Parameters:
cmd- Command line.entry-LdapEntryof authenticated use information, may be null- Throws:
Exception- On any failure
-
displayGroupMembership
public void displayGroupMembership(org.apache.commons.cli.CommandLine cmd, org.ldaptive.LdapEntry entry) throws ExceptionAuthenticates the user specified on the command line and displays their group membership. If no credential was supplied on the command line, it is prompted to be read from standard input.- Parameters:
cmd- Command line.entry-LdapEntryof authenticated use information, may be null- Throws:
Exception- On any failure
-
displayAffiliations
public void displayAffiliations(org.apache.commons.cli.CommandLine cmd, org.ldaptive.LdapEntry entry) throws ExceptionAuthenticates the user specified on the command line and displays their affiliations. If no credential was supplied on the command line, it is prompted to be read from standard input.- Parameters:
cmd- Command line.entry-LdapEntryof authenticated use information, may be null- Throws:
Exception- On any failure
-
-