@Service public class ConfigurationsImpl extends Object implements Configurations
Constructor and Description |
---|
ConfigurationsImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addConfiguration(DynConfiguration dynConf)
Add a dynamic configuration on the configuration file.
|
void |
addProperties(String name,
String value,
String compId,
String compName)
Add a component property name and value on stored and base
configurations.
|
void |
deleteConfiguration(Element conf)
Delete a configuration element from the configuration file.
|
Element |
findConfiguration(String name)
Find the first configuration element with given name.
|
DynConfiguration |
getActiveConfiguration()
Get current dynamic configuration from configuration file.
|
List<Element> |
getAllConfigurations()
Get all configuration elements.
|
Element |
getBaseConfiguration()
Get the base configuration from configuration.
|
Node |
getKeyElement(Element prop)
Get the key element of a property element.
|
Element |
getProperty(String configuration,
String property)
Get a property element from a configuration with some name.
|
Node |
getValueElement(Element prop)
Get the value element of a property element.
|
DynComponent |
parseComponent(Element comp,
String name)
Parse a component element to a dynamic component.
|
DynConfiguration |
parseConfiguration(Element conf,
String property)
Parse a configuration element to a dynamic configuration.
|
DynProperty |
parseProperty(Element prop)
Parse a property element to a dynamic property.
|
void |
saveConfiguration(Element elem)
Save the document of an element on the configuration file.
|
void |
setActiveConfiguration(String name)
Set the active configuration on the configuration file.
|
DynProperty |
updateProperty(String configuration,
String property,
String value)
Set a value on a configuration property.
|
public void addConfiguration(DynConfiguration dynConf)
addConfiguration
in interface Configurations
public void deleteConfiguration(Element conf)
deleteConfiguration
in interface Configurations
conf
- Configuration element to deletepublic DynConfiguration parseConfiguration(Element conf, String property)
All configuration component properties will be processed if name is null. If name not null, only specified property name will be processed.
parseConfiguration
in interface Configurations
conf
- Configuration elementproperty
- Property name to parse or all if nullpublic DynComponent parseComponent(Element comp, String name)
All component properties will be processed if name is null. If name not null, only specified property name will be processed.
parseComponent
in interface Configurations
comp
- Component elementname
- Property name to parse or all if nullpublic DynProperty parseProperty(Element prop)
parseProperty
in interface Configurations
prop
- Property elementpublic Node getKeyElement(Element prop)
getKeyElement
in interface Configurations
prop
- Property elementpublic Node getValueElement(Element prop)
getValueElement
in interface Configurations
prop
- Property elementpublic Element findConfiguration(String name)
findConfiguration
in interface Configurations
name
- Configuration element namepublic Element getBaseConfiguration()
getBaseConfiguration
in interface Configurations
public List<Element> getAllConfigurations()
getAllConfigurations
in interface Configurations
public Element getProperty(String configuration, String property)
getProperty
in interface Configurations
configuration
- Configuration nameproperty
- Property namepublic void saveConfiguration(Element elem)
saveConfiguration
in interface Configurations
public DynConfiguration getActiveConfiguration()
If no dynamic configuration active, null will be returned.
getActiveConfiguration
in interface Configurations
public void setActiveConfiguration(String name)
setActiveConfiguration
in interface Configurations
name
- Configuration namepublic void addProperties(String name, String value, String compId, String compName)
addProperties
in interface Configurations
name
- Property namevalue
- Property valuecompId
- Component idcompName
- Component namepublic DynProperty updateProperty(String configuration, String property, String value)
If null value, value element no written.
updateProperty
in interface Configurations
configuration
- Configuration name to updateproperty
- Property name to updatevalue
- Value to setCopyright © 2010–2015 General Directorate for Information Technologies (DGTI) of the Regional Ministry of Finance and Public Administration of the Generalitat Valenciana.. All rights reserved.