com.flexive.shared.interfaces
Interface CustomDomainConfigurationEngine<T extends java.io.Serializable>

Type Parameters:
T - The ID type
All Superinterfaces:
GenericConfigurationEngine
All Known Subinterfaces:
ApplicationConfigurationEngine, ApplicationConfigurationEngineLocal, MandatorConfigurationEngine, MandatorConfigurationEngineLocal, NodeConfigurationEngine, NodeConfigurationEngineLocal, UserConfigurationEngine, UserConfigurationEngineLocal

public interface CustomDomainConfigurationEngine<T extends java.io.Serializable>
extends GenericConfigurationEngine

Extension of GenericConfigurationEngine configurations with an arbitrary domain field (e.g. user ID).

When using the methods of GenericConfigurationEngine, the domain is automatically determined (e.g. the current user ID). This interface adds methods to store parameters for a specific domain that is not the own. For these methods, additional access restraints apply. Usually the calling user must be a global supervisors to read or update any foreign domain.

Since:
3.1
Version:
$Rev: 2906 $
Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Method Summary
<PT extends java.io.Serializable>
PT
get(T domain, Parameter<PT> parameter, java.lang.String key, boolean ignoreDefault)
          Retrieves the value for the given parameter using the given key, for a specific domain.
 java.util.Map<ParameterData,java.io.Serializable> getAll(T domain)
          Return all configuration properties for a specific domain.
 java.util.Map<ParameterData,java.io.Serializable> getAllWithXStream(T domain, java.util.Map<java.lang.String,com.thoughtworks.xstream.XStream> instances)
          Return all configuration properties for a specific domain using the provided XStream instance for conversions..
 java.util.List<T> getDomains()
          Retrieves all domains that have configuration entries.
 java.util.List<T> getDomains(Parameter parameter)
          Retrieves the domains that have configuration entries for the given parameter.
 java.util.List<T> getDomains(Parameter parameter, java.lang.String key)
          Retrieves the domains that have configuration entries for the given parameter.
<PT extends java.io.Serializable>
void
put(T domain, Parameter<PT> parameter, java.lang.String key, PT value)
          Set a parameter containing a value of type T using the given key.
<PT extends java.io.Serializable>
void
remove(T domain, Parameter<PT> parameter, java.lang.String key)
          Removes a parameter from the database using the given key.
<PT extends java.io.Serializable>
void
removeAll(T domain, Parameter<PT> parameter)
          Remove all parameters stored under this parameter's path.
 
Methods inherited from interface com.flexive.shared.interfaces.GenericConfigurationEngine
get, get, get, getAll, getAll, getAllWithXStream, getKeys, put, put, remove, remove, removeAll, tryGet
 

Method Detail

getDomains

java.util.List<T> getDomains()
                                                          throws FxApplicationException
Retrieves all domains that have configuration entries.

Returns:
all domains that have configuration entries.
Throws:
FxApplicationException - on errors
FxNoAccessException - if the caller may not retrieve the list of domains

getDomains

java.util.List<T> getDomains(Parameter parameter)
                                                          throws FxApplicationException
Retrieves the domains that have configuration entries for the given parameter.

Parameters:
parameter - parameter data containing the path and key
Returns:
the domains that have configuration entries for the given parameter.
Throws:
FxApplicationException - on errors
FxLoadException - if the domains could not be loaded
FxNoAccessException - if the caller may not retrieve the list of domains

getDomains

java.util.List<T> getDomains(Parameter parameter,
                             java.lang.String key)
                                                          throws FxApplicationException
Retrieves the domains that have configuration entries for the given parameter.

Parameters:
parameter - parameter data containing the path
key - the parameter key to be used. If null, all keys in the parameter path will be included.
Returns:
the domains that have configuration entries for the given parameter.
Throws:
FxApplicationException - on errors
FxLoadException - if the domains could not be loaded
FxNoAccessException - if the caller may not retrieve the list of domains

get

<PT extends java.io.Serializable> PT get(T domain,
                                         Parameter<PT> parameter,
                                         java.lang.String key,
                                         boolean ignoreDefault)
                                    throws FxApplicationException
Retrieves the value for the given parameter using the given key, for a specific domain. This method is useful for getting a single value of aggregate parameters. When all values for an aggregate parameter should be retrieved, use GenericConfigurationEngine.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.

Type Parameters:
PT - value type of the parameter
Parameters:
domain - the target domain
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

java.util.Map<ParameterData,java.io.Serializable> getAll(T domain)
                                                         throws FxApplicationException
Return all configuration properties for a specific domain.

Parameters:
domain - the requested domain
Returns:
all parameters for the given domain
Throws:
FxApplicationException
Since:
3.1.6

getAllWithXStream

java.util.Map<ParameterData,java.io.Serializable> getAllWithXStream(T domain,
                                                                    java.util.Map<java.lang.String,com.thoughtworks.xstream.XStream> instances)
                                                                    throws FxApplicationException
Return all configuration properties for a specific domain using the provided XStream instance for conversions..

Parameters:
domain - the requested domain
instances - XStream instances to use for conversions (mapped to class names - a wildcard parameter can be used for prefix matches (e.g. "my.config.*"))
Returns:
all parameters for the given domain
Throws:
FxApplicationException
Since:
3.2.0

put

<PT extends java.io.Serializable> void put(T domain,
                                           Parameter<PT> parameter,
                                           java.lang.String key,
                                           PT 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.

Note that usually only superusers may update parameters for foreign domains (e.g. foreign users or applications).

Type Parameters:
PT - value type to be set
Parameters:
domain - the target domain
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

remove

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

Type Parameters:
PT - value type of the parameter
Parameters:
domain - the target domain
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

<PT extends java.io.Serializable> void removeAll(T domain,
                                                 Parameter<PT> parameter)
               throws FxApplicationException
Remove all parameters stored under this parameter's path.

Type Parameters:
PT - value type of the parameter
Parameters:
domain - the target domain
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