|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GenericConfigurationEngine
Generic configuration interface. Provides a generic interface for
configuration methods based on the Parameter interface.
GenericConfigurationImpl,
Parameter| Method Summary | ||
|---|---|---|
|
get(Parameter<T> parameter)
Retrieves the value of the given parameter. |
|
|
get(Parameter<T> parameter,
java.lang.String key)
Retrieves the value for the given parameter using the given key. |
|
|
get(Parameter<T> parameter,
java.lang.String key,
boolean ignoreDefault)
Retrieves the value for the given parameter using the given key. |
|
java.util.Map<ParameterData,java.io.Serializable> |
getAll()
Return all parameters that are visible to the current user. |
|
|
getAll(Parameter<T> parameter)
Retrieves all key/value pairs stored under the path of the given parameter. |
|
java.util.Map<ParameterData,java.io.Serializable> |
getAllWithXStream(java.util.Map<java.lang.String,com.thoughtworks.xstream.XStream> instances)
Return all parameters that are visible to the current user using the provided XStream instance for conversions. |
|
|
getKeys(Parameter<T> parameter)
Retrieves all keys stored under the path of the given parameter. |
|
|
put(Parameter<T> parameter,
java.lang.String key,
T value)
Set a parameter containing a value of type T using
the given key. |
|
|
put(Parameter<T> parameter,
T value)
Set a parameter containing a value of type T. |
|
|
remove(Parameter<T> parameter)
Removes a parameter from the database. |
|
|
remove(Parameter<T> parameter,
java.lang.String key)
Removes a parameter from the database using the given key. |
|
|
removeAll(Parameter<T> parameter)
Remove all parameters stored under this parameter's path. |
|
|
tryGet(Parameter<T> parameter,
java.lang.String key,
boolean ignoreDefault)
Try to fetch the given parameter. |
|
| Method Detail |
|---|
<T extends java.io.Serializable> void put(Parameter<T> parameter,
T value)
throws FxApplicationException
T.
T - value type to be set (e.g. String, Integer, ...)parameter - parameter data containing path and keyvalue - value to be set
FxApplicationException - TODO
FxUpdateException - if the value could not be set or updated
FxNoAccessException - if the caller is not allowed to update/set this parameter
<T extends java.io.Serializable> void put(Parameter<T> parameter,
java.lang.String key,
T value)
throws FxApplicationException
T using
the given key. This method is useful for setting aggregate parameters with
varying keys.
Use getAll(com.flexive.shared.configuration.Parameter) to retrieve a
map with all keys stored under the path of the given parameter.
T - value type to be setparameter - parameter data containing the pathkey - key to be used for this valuevalue - value to be set
FxApplicationException - TODO
FxUpdateException - if the value could not be updated
FxNoAccessException - if the caller is not allowed to update/set this parameter
<T extends java.io.Serializable> T get(Parameter<T> parameter)
throws FxApplicationException
T - value type of the parameterparameter - parameter data containing the path and key
FxApplicationException - TODO
FxLoadException - if the value could not be loaded
FxNotFoundException - if the parameter is not set
<T extends java.io.Serializable> T get(Parameter<T> parameter,
java.lang.String key)
throws FxApplicationException
getAll(com.flexive.shared.configuration.Parameter) instead.
T - value type of the parameterparameter - parameter data containing the pathkey - key to be used
FxApplicationException - TODO
FxLoadException - if the value could not be loaded
FxNotFoundException - if the parameter is not set
<T extends java.io.Serializable> T get(Parameter<T> parameter,
java.lang.String key,
boolean ignoreDefault)
throws FxApplicationException
getAll(com.flexive.shared.configuration.Parameter) instead.
The default value may be disabled through the ignoreDefault parameter,
making this method more useful for checking if a parameter exists.
T - value type of the parameterparameter - parameter data containing the pathkey - key to be usedignoreDefault - if the parameter's default value should be used default
FxApplicationException - TODO
FxLoadException - if the value could not be loaded
FxNotFoundException - if the parameter is not set
<T extends java.io.Serializable> Pair<java.lang.Boolean,T> tryGet(Parameter<T> parameter,
java.lang.String key,
boolean ignoreDefault)
ConfigurationEngine to avoid
throwing (possibly expensive) application exceptions from EJB calls.
parameter - the parameterignoreDefault -
java.util.Map<ParameterData,java.io.Serializable> getAll()
throws FxApplicationException
FxApplicationException
java.util.Map<ParameterData,java.io.Serializable> getAllWithXStream(java.util.Map<java.lang.String,com.thoughtworks.xstream.XStream> instances)
throws FxApplicationException
instances - XStream instances per class name to use for conversions (when none is defined, the default XStream instance is used).
A wildcard parameter can be used for prefix matches (e.g. "my.config.*")
FxApplicationException
<T extends java.io.Serializable> java.util.Map<java.lang.String,T> getAll(Parameter<T> parameter)
throws FxApplicationException
Note: the values stored under the parameter's path must be of the same type,
i.e. they must be of type T.
T - value type of the parameterparameter - parameter data containing the path
FxApplicationException - TODO
FxLoadException - when an error occured reading the keys
<T extends java.io.Serializable> java.util.Collection<java.lang.String> getKeys(Parameter<T> parameter)
throws FxApplicationException
Note: the values stored under the parameter's path must be of the same type,
i.e. they must be of type T.
T - value type of the parameterparameter - parameter containing the path
FxApplicationException - TODO
<T extends java.io.Serializable> void remove(Parameter<T> parameter)
throws FxApplicationException
T - value type of the parameterparameter - parameter to be removed
FxApplicationException - TODO
FxRemoveException - if the parameter could not be removed
FxNoAccessException - if the caller is not allowed to remove this parameter
<T extends java.io.Serializable> void remove(Parameter<T> parameter,
java.lang.String key)
throws FxApplicationException
T - value type of the parameterparameter - parameter containing the path to be removedkey - the key to be removed
FxApplicationException - TODO
FxRemoveException - if the parameter could not be removed
FxNoAccessException - if the caller is not allowed to remove this parameter
<T extends java.io.Serializable> void removeAll(Parameter<T> parameter)
throws FxApplicationException
T - value type of the parameterparameter - the parameter to be removed
FxApplicationException - TODO
FxRemoveException - if the parameters could not be removed
FxNoAccessException - if the caller is not allowed to remove this parameter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||