com.flexive.shared.interfaces
Interface GenericConfigurationEngine

All Known Subinterfaces:
ConfigurationEngine, ConfigurationEngineLocal, DivisionConfigurationEngine, DivisionConfigurationEngineLocal, GlobalConfigurationEngine, GlobalConfigurationEngineLocal, UserConfigurationEngine, UserConfigurationEngineLocal

public interface GenericConfigurationEngine

Generic configuration interface. Provides a generic interface for configuration methods based on the Parameter interface.

Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
com.flexive.core.configuration.GenericConfigurationImpl, Parameter

Method Summary
<T> T
get(Parameter<T> parameter)
          Retrieves the value of the given parameter.
<T> T
get(Parameter<T> parameter, java.lang.String key)
          Retrieves the value for the given parameter using the given key.
<T> T
get(Parameter<T> parameter, java.lang.String key, boolean ignoreDefault)
          Retrieves the value for the given parameter using the given key.
<T> java.util.Map<java.lang.String,T>
getAll(Parameter<T> parameter)
          Retrieves all key/value pairs stored under the path of the given parameter.
<T> java.util.Collection<java.lang.String>
getKeys(Parameter<T> parameter)
          Retrieves all keys stored under the path of the given parameter.
<T> void
put(Parameter<T> parameter, java.lang.String key, T value)
          Set a parameter containing a value of type T using the given key.
<T> void
put(Parameter<T> parameter, T value)
          Set a parameter containing a value of type T.
<T> void
remove(Parameter<T> parameter)
          Removes a parameter from the database.
<T> void
remove(Parameter<T> parameter, java.lang.String key)
          Removes a parameter from the database using the given key.
<T> void
removeAll(Parameter<T> parameter)
          Remove all parameters stored under this parameter's path.
 

Method Detail

put

<T> void put(Parameter<T> parameter,
             T value)
         throws FxApplicationException
Set a parameter containing a value of type T.

Type Parameters:
T - value type to be set (e.g. String, Integer, ...)
Parameters:
parameter - parameter data containing path and key
value - value to be set
Throws:
FxApplicationException - TODO
FxUpdateException - if the value could not be set or updated
FxNoAccessException - if the caller is not allowed to update/set this parameter

put

<T> void put(Parameter<T> parameter,
             java.lang.String key,
             T value)
         throws FxApplicationException
Set a parameter containing a value of type T using the given key. This method is useful for setting aggregate parameters with varying keys. Use getParameters(Parameter<T&g;t parameter) to retrieve a map with all keys stored under the path of the given parameter.

Type Parameters:
T - value type to be set
Parameters:
parameter - parameter data containing the path
key - key to be used for this value
value - value to be set
Throws:
FxApplicationException - TODO
FxUpdateException - if the value could not be updated
FxNoAccessException - if the caller is not allowed to update/set this parameter

get

<T> T get(Parameter<T> parameter)
      throws FxApplicationException
Retrieves the value of the given parameter.

Type Parameters:
T - value type of the parameter
Parameters:
parameter - parameter data containing the path and key
Returns:
the value stored under the given path and key
Throws:
FxApplicationException - TODO
FxLoadException - if the value could not be loaded
FxNotFoundException - if the parameter is not set

get

<T> T get(Parameter<T> parameter,
          java.lang.String key)
      throws FxApplicationException
Retrieves the value for the given parameter using the given key. This method is useful for getting a single value of aggregate parameters. When all values for an aggregate parameter should be retrieved, use getParameters instead.

Type Parameters:
T - value type of the parameter
Parameters:
parameter - parameter data containing the path
key - key to be used
Returns:
the value stored under the given path and key
Throws:
FxApplicationException - TODO
FxLoadException - if the value could not be loaded
FxNotFoundException - if the parameter is not set

get

<T> T get(Parameter<T> parameter,
          java.lang.String key,
          boolean ignoreDefault)
      throws FxApplicationException
Retrieves the value for the given parameter using the given key. This method is useful for getting a single value of aggregate parameters. When all values for an aggregate parameter should be retrieved, use getParameters instead. The default value may be disabled through the ignoreDefault parameter, making this method more useful for checking if a parameter exists.

Type Parameters:
T - value type of the parameter
Parameters:
parameter - parameter data containing the path
key - key to be used
ignoreDefault - if the parameter's default value should be used default
Returns:
the value stored under the given path and key
Throws:
FxApplicationException - TODO
FxLoadException - if the value could not be loaded
FxNotFoundException - if the parameter is not set

getAll

<T> java.util.Map<java.lang.String,T> getAll(Parameter<T> parameter)
                                         throws FxApplicationException
Retrieves all key/value pairs stored under the path of the given parameter.

Type Parameters:
T - value type of the parameter
Parameters:
parameter - parameter data containing the path
Returns:
all key/value-pairs under the given path
Throws:
FxApplicationException - TODO
FxLoadException - when an error occured reading the keys

getKeys

<T> java.util.Collection<java.lang.String> getKeys(Parameter<T> parameter)
                                               throws FxApplicationException
Retrieves all keys stored under the path of the given parameter.

Type Parameters:
T - value type of the parameter
Parameters:
parameter - parameter containing the path
Returns:
all keys stored under the path of the given parameter.
Throws:
FxApplicationException - TODO

remove

<T> void remove(Parameter<T> parameter)
            throws FxApplicationException
Removes a parameter from the database.

Type Parameters:
T - value type of the parameter
Parameters:
parameter - parameter to be removed
Throws:
FxApplicationException - TODO
FxRemoveException - if the parameter could not be removed
FxNoAccessException - if the caller is not allowed to remove this parameter

remove

<T> void remove(Parameter<T> parameter,
                java.lang.String key)
            throws FxApplicationException
Removes a parameter from the database using the given key.

Type Parameters:
T - value type of the parameter
Parameters:
parameter - parameter containing the path to be removed
key - the key to be removed
Throws:
FxApplicationException - TODO
FxRemoveException - if the parameter could not be removed
FxNoAccessException - if the caller is not allowed to remove this parameter

removeAll

<T> void removeAll(Parameter<T> parameter)
               throws FxApplicationException
Remove all parameters stored under this parameter's path.

Type Parameters:
T - value type of the parameter
Parameters:
parameter - the parameter to be removed
Throws:
FxApplicationException - TODO
FxRemoveException - if the parameters could not be removed
FxNoAccessException - if the caller is not allowed to remove this parameter