Class DefaultServiceImpl
- java.lang.Object
-
- de.iip_ecosphere.platform.services.environment.AbstractService
-
- de.iip_ecosphere.platform.services.environment.DefaultServiceImpl
-
- All Implemented Interfaces:
ParameterConfigurerProvider,Service,ServiceBase
- Direct Known Subclasses:
FamilyServiceStub
public class DefaultServiceImpl extends AbstractService
Default service implementation realizing the left open methods ofAbstractServiceempty. UsesAbstractService.reconfigure(Map, ParameterConfigurerProvider, boolean, ServiceState), andAbstractService.rollbackReconfigurationOnFailure()to generically implementAbstractService.reconfigure(Map), i.e., define the relevant parameters for
-
-
Field Summary
-
Fields inherited from interface de.iip_ecosphere.platform.services.environment.switching.ServiceBase
APPLICATION_SEPARATOR, DEFAULT_APPLICATION_INSTANCE_ID
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultServiceImpl(ServiceKind kind)Fallback constructor setting most fields to "empty" default values.protectedDefaultServiceImpl(YamlService yaml)Creates a default service from YAML information.protectedDefaultServiceImpl(java.lang.String id, ServiceKind kind)Fallback constructor setting most fields to "empty" default values.DefaultServiceImpl(java.lang.String serviceId, java.io.InputStream ymlFile)Creates an default service from a service id and a YAML artifact.protectedDefaultServiceImpl(java.lang.String id, java.lang.String name, de.iip_ecosphere.platform.support.iip_aas.Version version, java.lang.String description, boolean isDeployable, boolean isTopLevel, ServiceKind kind)Creates a default service.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmigrate(java.lang.String resourceId)Migrates a service.voidswitchTo(java.lang.String targetId)Switches to an interface-compatible service.voidupdate(java.net.URI location)Updates the service by the service in the givenlocation.-
Methods inherited from class de.iip_ecosphere.platform.services.environment.AbstractService
activate, addConfigurer, addConfigurer, addConfigurer, createInstance, createInstance, createInstance, getDescription, getId, getKind, getName, getNetMgtKeyAddress, getResourceAsStream, getState, getVersion, initializeFrom, isDeployable, isTopLevel, notifyReconfigured, passivate, reconf, reconfigure, reconfigure, rollbackReconfigurationOnFailure, setLibJars, setState, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.iip_ecosphere.platform.services.environment.Service
getParameterConfigurer, getParameterNames
-
-
-
-
Constructor Detail
-
DefaultServiceImpl
protected DefaultServiceImpl(ServiceKind kind)
Fallback constructor setting most fields to "empty" default values.- Parameters:
kind- the service kind
-
DefaultServiceImpl
protected DefaultServiceImpl(java.lang.String id, ServiceKind kind)Fallback constructor setting most fields to "empty" default values.- Parameters:
id- the id of the servicekind- the service kind
-
DefaultServiceImpl
protected DefaultServiceImpl(java.lang.String id, java.lang.String name, de.iip_ecosphere.platform.support.iip_aas.Version version, java.lang.String description, boolean isDeployable, boolean isTopLevel, ServiceKind kind)Creates a default service.- Parameters:
id- the id of the servicename- the name of the serviceversion- the version of the servicedescription- a description of the service, may be emptyisDeployable- whether the service is decentrally deployableisTopLevel- whether the service is a top-level (non-nested) servicekind- the service kind
-
DefaultServiceImpl
protected DefaultServiceImpl(YamlService yaml)
Creates a default service from YAML information.- Parameters:
yaml- the service information as read from YAML
-
DefaultServiceImpl
public DefaultServiceImpl(java.lang.String serviceId, java.io.InputStream ymlFile)Creates an default service from a service id and a YAML artifact.- Parameters:
serviceId- the service idymlFile- the YML file containing the YAML artifact with the service descriptor
-
-
Method Detail
-
migrate
public void migrate(java.lang.String resourceId) throws java.util.concurrent.ExecutionExceptionDescription copied from interface:ServiceMigrates a service. However, it may be required to migrate/move the containing artifact. [adaptation]- Parameters:
resourceId- the target resource id, e.g., a device- Throws:
java.util.concurrent.ExecutionException- if migration fails
-
update
public void update(java.net.URI location) throws java.util.concurrent.ExecutionExceptionDescription copied from interface:ServiceUpdates the service by the service in the givenlocation. This operation is responsible for stopping the running service (if needed), replacing it, starting the new service.- Parameters:
location- the location of the new service, e.g., an URL- Throws:
java.util.concurrent.ExecutionException- if the given service cannot be updated for some reason, e.g., because the replacement service is not an evolved version of the running service
-
switchTo
public void switchTo(java.lang.String targetId) throws java.util.concurrent.ExecutionExceptionDescription copied from interface:ServiceSwitches to an interface-compatible service. This method cares for stopping the old service, performing a handover if adequate, starting thetargetservice. [adaptation]- Parameters:
targetId- the id of the target service- Throws:
java.util.concurrent.ExecutionException- if switching the service cannot be performed for some reason
-
-