|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.marketcetera.util.auth.StandardAuthentication
public class StandardAuthentication
A standard authentication system. A standard system comprises a string holder for a username, and a character array holder for a password; both are required. The contexts employed to retrieve the username and password are, in order, a spring context, a command-line context (which is an override context), and lastly a console context (which is non-override). This class sets up all holders and contexts with default prompts, usage instructions, etc., and provides shorthands to perform operations on the underlying holders and contexts.
| Field Summary | |
|---|---|
static String |
PASSWORD_LONG
The default long form of the command-line option for the password (command-line context). |
static String |
PASSWORD_PROP
The default property name for the password (Spring context). |
static String |
PASSWORD_SHORT
The default short form of the command-line option for the password (command-line context). |
static String |
PROPERTIES_FILE_BEAN
The default name of the properties file bean (Spring context). |
static String |
USER_LONG
The default long form of the command-line option for the username (command-line context). |
static String |
USER_PROP
The default property name for the username (Spring context). |
static String |
USER_SHORT
The default short form of the command-line option for the username (command-line context). |
| Constructor Summary | |
|---|---|
StandardAuthentication(String configLocation,
String[] cliArgs)
Creates a new standard authentication system with the given options, and using default values for all options not specified in this constructor. |
|
StandardAuthentication(String configLocation,
String propertiesFilesBean,
String userPropertyName,
String passwordPropertyName,
String userShort,
String userLong,
String passwordShort,
String passwordLong,
String[] cliArgs)
Creates a new standard authentication system with the given options. |
|
| Method Summary | |
|---|---|
void |
clearPassword()
Clears the receiver's password by first overwriting all prior characters with the nul ('\0') character (if the receiver had a non-null password), and then setting the password to null. |
CliContext |
getCliContext()
Returns the receiver's command-line context. |
String[] |
getOtherArgs()
Returns the command-line arguments which the receiver was unable to parse. |
char[] |
getPassword()
Returns the receiver's password. |
String |
getPasswordAsString()
Returns the receiver's password as a string. |
String |
getUser()
Returns the receiver's username. |
void |
printUsage(PrintStream stream)
Prints the receiver's usage instructions onto the given stream. |
boolean |
setValues()
Sets the data of the receiver's username and password holders. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROPERTIES_FILE_BEAN
public static final String USER_PROP
public static final String PASSWORD_PROP
public static final String USER_SHORT
public static final String USER_LONG
public static final String PASSWORD_SHORT
public static final String PASSWORD_LONG
| Constructor Detail |
|---|
public StandardAuthentication(String configLocation,
String propertiesFilesBean,
String userPropertyName,
String passwordPropertyName,
String userShort,
String userLong,
String passwordShort,
String passwordLong,
String[] cliArgs)
configLocation - The location of the Spring configuration
file (Spring context).propertiesFilesBean - The name of the properties file bean
(Spring context).userPropertyName - The property name for the username
(Spring context).passwordPropertyName - The property name for the password
(Spring context).userShort - The short form of the command-line option for
the username (command-line context).userLong - The long form of the command-line option for
the username (command-line context).passwordShort - The short form of the command-line option
for the password (command-line context).passwordLong - The long form of the command-line option
for the password (command-line context).cliArgs - The command-line arguments (command-line
context).
public StandardAuthentication(String configLocation,
String[] cliArgs)
configLocation - The location of the Spring configuration
file (Spring context).cliArgs - The command-line arguments (command-line
context).| Method Detail |
|---|
public boolean setValues()
public CliContext getCliContext()
public void printUsage(PrintStream stream)
stream - The stream.public String[] getOtherArgs()
public String getUser()
public char[] getPassword()
public String getPasswordAsString()
clearPassword(); this is because the string created and
returned by this method cannot be zeroed out..
public void clearPassword()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||