public class CommandLineAuthorizationCallback extends AbstractAuthorizationCallback implements IConfigurable
Configuration:
<AuthorizationCallback class="rs.baselib.security.CommandLineAuthorizationCallback">
<!-- The default user name (optional). -->
<login>default-user-name</login>
<!-- The text to be used for user name prompt (optional). -->
<login-prompt>login-prompt-text</login-prompt>
<!-- The text to be used for password prompt (optional). -->
<password-prompt>password-prompt-text</password-prompt>
</AuthorizationCallback>
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_LOGIN_PROMPT
The default prompt for the login name ("Login: ").
|
static String |
DEFAULT_PASSWORD_PROMPT
The default prompt for the password ("Password: ").
|
| Constructor and Description |
|---|
CommandLineAuthorizationCallback()
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Configuration config)
Configures the name callback.
|
String |
getLoginPrompt()
Returns the login prompt text.
|
String |
getName()
Asks the user on command line for name if no default name was set.
|
String |
getPassword()
Asks the user on command line for a password.
|
String |
getPasswordPrompt()
Returns the password prompt text.
|
void |
setLoginPrompt(String loginPrompt)
Sets a text for the login prompt.
|
void |
setPasswordPrompt(String passwordPrompt)
Sets a text for the password prompt.
|
setName, setPasswordpublic static final String DEFAULT_LOGIN_PROMPT
public static final String DEFAULT_PASSWORD_PROMPT
public CommandLineAuthorizationCallback()
public void configure(Configuration config) throws ConfigurationException
configure in interface IConfigurableconfig - - configuration objectConfigurationException - - when configuration failspublic String getLoginPrompt()
public void setLoginPrompt(String loginPrompt)
loginPrompt - - the login prompt text to setpublic String getPasswordPrompt()
public void setPasswordPrompt(String passwordPrompt)
passwordPrompt - - the password prompt text to setpublic String getName()
getName in interface AuthorizationCallbackgetName in class AbstractAuthorizationCallbackpublic String getPassword()
getPassword in interface AuthorizationCallbackgetPassword in class AbstractAuthorizationCallbackCopyright © 2014. All rights reserved.