|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.n52.security.authentication.loginmodule.Options
public class Options
Class Options represents the configuration options of a login module.
This class is introduced to encapsulate the access to common options and therefor to minimize programming errors.AbstractLoginModule
and provided via a getter method to sub classes.
Field Summary | |
---|---|
static java.lang.String |
OPTION_DISABLED
Field OPTION_DISABLED (true|false). |
static java.lang.String |
OPTION_MODULEBANNER
Field OPTION_MODULEBANNER (true|false). |
static java.lang.String |
OPTION_TRY_FIRST_PASS
Field OPTION_TRY_FIRST_PASS (true|false). |
static java.lang.String |
OPTION_TRY_MAPPED_PASS
Field OPTION_TRY_MAPPED_PASS (true|false). |
static java.lang.String |
OPTION_USE_FIRST_PASS
Field OPTION_USE_FIRST_PASS (true|false). |
static java.lang.String |
OPTION_USE_MAPPED_PASS
Field OPTION_USE_MAPPED_PASS (true|false). |
Constructor Summary | |
---|---|
Options(java.util.Map state)
Constructor Options creates a new Options instance. |
Method Summary | |
---|---|
boolean |
contains(java.lang.String key)
Method checks if the state information contains the key. |
java.lang.Object |
get(java.lang.String key)
Method gets the state information for the key. |
java.lang.Object |
getAs(java.lang.String key,
java.lang.Class expectedType)
Method getAs gets the option value for the key as type of the given class. |
double |
getAsDouble(java.lang.String key,
double defaultvalue)
Method getAsDouble gets the option value for the key as Double. |
float |
getAsFloat(java.lang.String key,
float defaultvalue)
Method getAsFloat gets the option value for the key as Float. |
int |
getAsInt(java.lang.String key,
int defaultvalue)
Method getAsInt gets the option value for the key as Integer. |
long |
getAsLong(java.lang.String key,
long defaultvalue)
Method getAsLong gets the option value for the key as Long. |
java.lang.String |
getAsString(java.lang.String key,
java.lang.String defaultvalue)
Method getAsString gets the option value for the key as a String. |
java.lang.String[] |
getAsStringArray(java.lang.String key,
java.lang.String[] defaultvalue,
java.lang.String delemiter)
Method getAsStringArray gets the option value for the key as String[]. |
boolean |
is(java.lang.String key)
Method gets the boolean value from the option stored under the given key. |
boolean |
is(java.lang.String key,
boolean defaulvalue)
Method is gets the option value for the key as boolean. |
boolean |
isDisabled()
Method checks if the disabled option is set. |
boolean |
isEmpty()
Methods checks for an empty shared state. |
boolean |
isModuleBanner()
Method checks if the moduleBanner option is set. |
boolean |
isTryFirstPass()
Method checks if the tryFirstPass option is set. |
boolean |
isTryMappedPass()
Method checks if the tryMappedPass option is set. |
boolean |
isUseFirstPass()
Method checks if the useFirstPass option is set. |
boolean |
isUseMappedPass()
Method checks if the useMappedPass option is set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String OPTION_TRY_FIRST_PASS
public static final java.lang.String OPTION_USE_FIRST_PASS
public static final java.lang.String OPTION_TRY_MAPPED_PASS
public static final java.lang.String OPTION_USE_MAPPED_PASS
public static final java.lang.String OPTION_MODULEBANNER
public static final java.lang.String OPTION_DISABLED
Constructor Detail |
---|
public Options(java.util.Map state)
state
- the ${FIELD_NAME}.Method Detail |
---|
public double getAsDouble(java.lang.String key, double defaultvalue) throws java.lang.NumberFormatException
key
- the key.defaultvalue
- the defaultvalue.
java.lang.NumberFormatException
- if error occurs.public float getAsFloat(java.lang.String key, float defaultvalue) throws java.lang.NumberFormatException
key
- the key.defaultvalue
- the defaultvalue.
java.lang.NumberFormatException
- if error occurs.public int getAsInt(java.lang.String key, int defaultvalue) throws java.lang.NumberFormatException
key
- the key.defaultvalue
- the defaultvalue.
java.lang.NumberFormatException
- if the set value is no Integer.public long getAsLong(java.lang.String key, long defaultvalue)
key
- the key.defaultvalue
- the defaultvalue.
java.lang.NumberFormatException
- if the set value is no Long.public java.lang.String getAsString(java.lang.String key, java.lang.String defaultvalue)
key
- the key.defaultvalue
- defines the default value if the option is empty.
public java.lang.String[] getAsStringArray(java.lang.String key, java.lang.String[] defaultvalue, java.lang.String delemiter)
key
- the key.defaultvalue
- the defaultvalue.delemiter
- the delemiter like in StringTokenizer.
StringTokenizer
public boolean is(java.lang.String key, boolean defaulvalue)
key
- the key.defaulvalue
- the default value.
public boolean contains(java.lang.String key)
key
- of type String identifying a state information.
public boolean isDisabled()
OPTION_DISABLED
public boolean is(java.lang.String key)
Boolean
it returns its value,
otherwise it tries to get a Boolean value from the String representation of the value.
key
- the option key.
public java.lang.Object get(java.lang.String key)
key
- of type String identifying a state information.
public boolean isEmpty()
public boolean isModuleBanner()
OPTION_MODULEBANNER
public boolean isTryFirstPass()
OPTION_TRY_FIRST_PASS
public boolean isTryMappedPass()
OPTION_TRY_MAPPED_PASS
public boolean isUseFirstPass()
OPTION_USE_FIRST_PASS
public boolean isUseMappedPass()
OPTION_USE_MAPPED_PASS
public java.lang.Object getAs(java.lang.String key, java.lang.Class expectedType) throws java.lang.IllegalArgumentException
key
- the key.expectedType
- the expected class of the key.
java.lang.NumberFormatException
- if error occurs.
java.lang.IllegalArgumentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |