@ProviderType
public interface CloudServiceFactory
CloudService
S in the framework.
The Component creates multiple component instances upon reception of a configuration
created through the Configuration Service.
ConfigurationService
,
CloudServiceFactory simplifies this process and offers more control.
CloudService
/DataService
/DataTransportService
cloud stack represents an example of the above architecture
and can serve as a reference implementation for alternative Cloud stacks.
ConfigurationService
to create component configurations.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KURA_CLOUD_SERVICE_FACTORY_PID
The name of the property set in a @{link CloudService} configuration created
through
createConfiguration(java.lang.String) . |
Modifier and Type | Method and Description |
---|---|
void |
createConfiguration(java.lang.String pid)
Creates a
CloudService instance and initializes its configuration with the defaults
expressed in the Metatype of the target component factory providing the CloudService. |
void |
deleteConfiguration(java.lang.String pid)
Deletes a previously created configuration deactivating the associated
CloudService instance. |
java.lang.String |
getFactoryPid()
Returns the factory PID of the OSGi Factory Component represented by this CloudServiceFactory.
|
java.util.Set<java.lang.String> |
getManagedCloudServicePids()
Return a set of services managed by this factory
It is up to the factory how it does assembles this. |
java.util.List<java.lang.String> |
getStackComponentsPids(java.lang.String pid)
Returns the list of kura.service.pids that compose the cloud stack associated with the provided
kura.service.pid of the factory component configuration.
|
static final java.lang.String KURA_CLOUD_SERVICE_FACTORY_PID
createConfiguration(java.lang.String)
.
The property is set in the cloud service instance to relate it with the Factory that generated the whole cloud
stack.java.lang.String getFactoryPid()
void createConfiguration(java.lang.String pid) throws KuraException
CloudService
instance and initializes its configuration with the defaults
expressed in the Metatype of the target component factory providing the CloudService.
ConfigurationService.createFactoryConfiguration(java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>, boolean)
to perform the actual creation of the component instance and the persistence of the component configuration.
ComponentContext.locateServices(java.lang.String)
by filtering on the kura.service.pid property.
<reference name="myCloudServiceReference" policy="static" bind="setMyCloudService" unbind="unsetMyCloudService" cardinality="1..1" interface="org.eclipse.kura.cloud.CloudService"/> <property name="myCloudServiceReference.target" type="String" value="(kura.service.pid=myCloudService)"/> <reference name="anotherCloudServiceReference" policy="static" bind="setAnotherCloudService" unbind="unsetAnotherCloudService" cardinality="1..1" interface="org.eclipse.kura.cloud.CloudService"/> <property name="anotherCloudServiceReference.target" type="String" value="(kura.service.pid=anotherCloudService)"/>
pid
- the Kura persistent identifier, kura.service.pid, of the factory component configuration.KuraException
java.util.List<java.lang.String> getStackComponentsPids(java.lang.String pid) throws KuraException
pid
- the Kura persistent identifier, kura.service.pid, of the factory component configuration.KuraException
- if the specified kura.service.pid is not correct or compliant with what the factory
implementation expectsvoid deleteConfiguration(java.lang.String pid) throws KuraException
CloudService
instance.pid
- the Kura persistent identifier, kura.service.pid, of the factory component configuration.KuraException
java.util.Set<java.lang.String> getManagedCloudServicePids() throws KuraException
getStackComponentsPids(String)
of the same factory instance.
CloudService
.null
KuraException