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 KuraException
KuraException
ComponentConfiguration getComponentConfiguration(String pid) throws KuraException
pid
- The ID of the component whose configuration is requested.KuraException
void updateConfiguration(String pid, Map<String,Object> properties) throws KuraException
pid
- The ID of the component whose configuration is requested.properties
- Properties to be used as the new Configuration for the specified Component.KuraException
- if the properties specified do not pass the validation of the ObjectClassDefinitionvoid updateConfigurations(List<ComponentConfiguration> configs) throws KuraException
KuraException
Set<Long> getSnapshots() throws KuraException
KuraException
List<ComponentConfiguration> getSnapshot(long sid) throws KuraException
sid
- - ID of the snapshot to be loadedKuraException
long snapshot() throws KuraException
KuraException
long rollback() throws KuraException
KuraException
- if no snapshots are available orvoid rollback(long id) throws KuraException
id
- ID of the snapshot we need to rollback toKuraException
- if the snapshot is not foundCopyright © 2014. All Rights Reserved.