public interface ConfigurationService
ConfigurableComponent
marker interface.
When a ConfigurableComponent is registered, the Configuration Service will call its "update"
method with the latest saved configuration as returned the ConfigurationAdmin or, if none
is available, with the Configuration properties fabricated from the default attribute values as
specified in the ObjectClassDefinition of this service.
In OSGi terms, this process in similar to the Auto Configuration Service.
The ConfigurationService assumes that Meta Type Information XML resource
for a given Declarative Service with name abc" to be stored under OSGI-INF/metatype/abc.xml.
This is an extra restriction over the OSGi specification: the Meta Type Information XML resource
must be named as the name of the Declarative Service Component.
Modifier and Type | Method and Description |
---|---|
ComponentConfiguration |
getComponentConfiguration(String pid)
Returns the ComponentConfiguration for the component identified with specified PID (service's persistent identity).
|
List<ComponentConfiguration> |
getComponentConfigurations()
Returns the list of ConfigurableComponents currently registered with the ConfigurationService.
|
Set<String> |
getConfigurableComponentPids()
Return the PIDs (service's persistent identity) for all the services that
implements the ConfigurableComponent Maker interface and registered themselves
with the container.
|
List<ComponentConfiguration> |
getSnapshot(long sid)
Loads a snapshot given its ID and return the component configurations stored in that snapshot.
|
Set<Long> |
getSnapshots()
Returns the ID of all the snapshots taken by the ConfigurationService.
|
long |
rollback()
Rolls back to the last saved snapshot if available.
|
void |
rollback(long id)
Rolls back to the specified snapshot id.
|
long |
snapshot()
Takes a new snapshot of the current configuration of all the registered ConfigurableCompoenents.
|
void |
updateConfiguration(String pid,
Map<String,Object> properties)
Updates the Configuration of the registered component with the specified pid.
|
void |
updateConfigurations(List<ComponentConfiguration> configs) |
Set<String> getConfigurableComponentPids()
List<ComponentConfiguration> getComponentConfigurations() throws EsfException
EsfException
ComponentConfiguration getComponentConfiguration(String pid) throws EsfException
pid
- The ID of the component whose configuration is requested.EsfException
void updateConfiguration(String pid, Map<String,Object> properties) throws EsfException
pid
- The ID of the component whose configuration is requested.properties
- Properties to be used as the new Configuration for the specified Component.EsfException
- if the properties specified do not pass the validation of the ObjectClassDefinitionvoid updateConfigurations(List<ComponentConfiguration> configs) throws EsfException
EsfException
Set<Long> getSnapshots() throws EsfException
EsfException
List<ComponentConfiguration> getSnapshot(long sid) throws EsfException
sid
- - ID of the snapshot to be loadedEsfException
long snapshot() throws EsfException
EsfException
long rollback() throws EsfException
EsfException
- if no snapshots are available orvoid rollback(long id) throws EsfException
id
- ID of the snapshot we need to rollback toEsfException
- if the snapshot is not foundCopyright © 2013. All Rights Reserved.