|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ail.core.configure.ConfigurationHandler
public class ConfigurationHandler
| Method Summary | |
|---|---|
java.util.Collection<java.lang.String> |
getConfigurationNamespaceParent(ConfigurationOwner owner,
CoreUser user,
Core core)
Return the namespace(s) of the configuration(s) which are the parent, grandparent, etc of this namespae As configurations optionally have "parent" configuration that they inherit from, this method returns a collection of namespaces with one element for each configuration in the hierarchy. |
java.util.Collection<java.lang.String> |
getConfigurationSources(ConfigurationOwner owner,
CoreUser user,
Core core)
Return the source of the configuration being used by this instance of core. |
Group |
getGroup(java.lang.String name,
ConfigurationOwner owner,
CoreUser user,
Core core)
Fetch the named group the from current configuration. |
static ConfigurationHandler |
getInstance()
Get a reference to the instance of the handler. |
java.util.Collection<java.lang.String> |
getNamespaces()
Fetch a list of all the namespaces that have configurations associated with them. |
java.util.Collection<ConfigurationSummary> |
getNamespacesHistorySummary(java.lang.String namespace)
Fetch the details of all the elements in a namespaces history. |
java.util.Collection<ConfigurationSummary> |
getNamespacesSummary()
Fetch the details of all the namespaces that have configurations associated with them. |
Parameter |
getParameter(java.lang.String paramName,
ConfigurationOwner owner,
CoreUser user,
Core core)
Fetch the named parameter from the current configuration. |
java.util.Properties |
getParametersAsProperties(java.lang.String name,
ConfigurationOwner owner,
CoreUser user,
Core core)
Fetch all the Parameters in a group and return them as a java.util.Properties. |
java.lang.String |
getParameterValue(java.lang.String paramName,
ConfigurationOwner owner,
CoreUser user,
Core core)
Get the value of a parameter by name. |
java.lang.String |
getParameterValue(java.lang.String paramName,
java.lang.String defaultValue,
ConfigurationOwner owner,
CoreUser user,
Core core)
Return the value of a parameter or a default value if the parameter is undefined. |
XMLMapping |
getXMLMapping(ConfigurationOwner owner,
CoreUser user,
Core core)
Locate and return the XMLMapping associated with a configuration. |
Configuration |
loadConfiguration(ConfigurationOwner owner,
CoreUser user,
Core core)
Load (fetch and return) the configuration associated with the current namespace and versionEffectiveDate. |
Configuration |
loadConfiguration(java.lang.String namespace,
CoreUser user,
Core core)
Load (fetch and return) the configuration associated with the current namespace and versionEffectiveDate. |
static void |
reset()
This method resets the ConfigurationHandlers internal cache. |
static void |
reset(java.lang.String namespace)
This method removes a specific namespace from the ConfigurationHandlers's internal cache. |
void |
saveConfiguration(ConfigurationOwner owner,
Configuration config,
Core core)
Save (update/create) the configuration associated with the current namespace. |
void |
saveConfiguration(java.lang.String namespace,
Configuration config,
Core core)
Save (update/create) the configuration associated with the current namespace. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ConfigurationHandler getInstance()
public static void reset()
Aside from a performance hit, as configuration records are loaded 'on demand' over time, resetting the cache will have no harmful side effects.
public static void reset(java.lang.String namespace)
Removing a namespace from the cache only has a very small performance hit.
namespace - The namespace to remove from the cache.
public void saveConfiguration(java.lang.String namespace,
Configuration config,
Core core)
namespace - The configuration namespace to save this config under.config - The configuration to save.core - The instance of core making the request.
public void saveConfiguration(ConfigurationOwner owner,
Configuration config,
Core core)
owner - The configuration owner.config - The configuration to save.core - The instance of core making the request.
public Configuration loadConfiguration(ConfigurationOwner owner,
CoreUser user,
Core core)
owner - The Configuration owner.user - The configuration user we're loading the config for.core - The instance of Core making the request.
public Configuration loadConfiguration(java.lang.String namespace,
CoreUser user,
Core core)
namespace - Namespace to load the configuration of.owner - The Configuration owner.core - The instance of Core making the request.public java.util.Collection<java.lang.String> getNamespaces()
public java.util.Collection<ConfigurationSummary> getNamespacesSummary()
ConfigurationSummary objects.public java.util.Collection<ConfigurationSummary> getNamespacesHistorySummary(java.lang.String namespace)
ConfigurationSummary objects.
public Parameter getParameter(java.lang.String paramName,
ConfigurationOwner owner,
CoreUser user,
Core core)
The core's own configuration is used as a back-stop. If the group being searched for is not in the namespace defined by the configuration owner, then the core's configuration is checked.
paramName - The name of the parameter to retrieve.owner - The configuration ownercore - The instance of Core making the call.
public java.lang.String getParameterValue(java.lang.String paramName,
ConfigurationOwner owner,
CoreUser user,
Core core)
String x=getParameter("parameterName").getValue();
String x=getParameterValue("parameterName");
paramName - Name of the parameter to fetch the value forowner - The owning configurationuser - The user making the requestcore - The core being used by the requester.
public java.lang.String getParameterValue(java.lang.String paramName,
java.lang.String defaultValue,
ConfigurationOwner owner,
CoreUser user,
Core core)
paramName - Name of the parameter to return the value of.defaultValue - If the parameter is undefined return this insteadowner - The owning configurationuser - The user making the requestcore - The core being used by the requester.
default if it is undefined.
public Group getGroup(java.lang.String name,
ConfigurationOwner owner,
CoreUser user,
Core core)
owner), and the versionEffectiveDate (taken from
core). The group's name may be dot separated indicating
that the group is nested within other groups.The core's own configuration is used as a back-stop. If the group being searched for is not in the namespace defined by the configuration owner, then the core's configuration is checked.
owner - The configuration owner.core - The instance of Core making the call.
public java.util.Properties getParametersAsProperties(java.lang.String name,
ConfigurationOwner owner,
CoreUser user,
Core core)
If the group specified does not exist, null is returned. If the group does exist but contains no Parameters, an empty Properties object is returned.
name - The name of the group whose parameters will be used.owner - The Configuration owner.core - The instance of Core making the call.
public java.util.Collection<java.lang.String> getConfigurationSources(ConfigurationOwner owner,
CoreUser user,
Core core)
owner - The configuration's owneruser - The user asking for the sourcecore - The core being used - and who's source will be returned
public java.util.Collection<java.lang.String> getConfigurationNamespaceParent(ConfigurationOwner owner,
CoreUser user,
Core core)
owner - The configuration's owneruser - The user asking for the sourcecore - The core being used - and who's source will be returned
public XMLMapping getXMLMapping(ConfigurationOwner owner,
CoreUser user,
Core core)
owner - The class owning the configurationuser - The class using the configurationcore - The core used by the user
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||