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
Default service implementation realizing the left open methods of
AbstractService empty. Uses
AbstractService.reconfigure(Map, ParameterConfigurerProvider, boolean, ServiceState),
and AbstractService.rollbackReconfigurationOnFailure() to generically implement AbstractService.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
ConstructorsModifierConstructorDescriptionprotectedFallback constructor setting most fields to "empty" default values.protectedCreates a default service from YAML information.protectedDefaultServiceImpl(String id, ServiceKind kind) Fallback constructor setting most fields to "empty" default values.DefaultServiceImpl(String serviceId, InputStream ymlFile) Creates an default service from a service id and a YAML artifact.protectedDefaultServiceImpl(String id, String name, de.iip_ecosphere.platform.support.Version version, String description, boolean isDeployable, boolean isTopLevel, ServiceKind kind) Creates a default service. -
Method Summary
Methods inherited from class de.iip_ecosphere.platform.services.environment.AbstractService
activate, addConfigurer, addConfigurer, addConfigurer, addTypeSubstitution, createGenericInstance, createGenericInstance, createGenericInstanceByPlugin, createGenericMultiInstance, createGenericMultiInstance, createGenericMultiInstanceByPlugin, createInstance, createInstance, createInstance, createInstanceByPlugin, getArg, getDescription, getId, getKind, getName, getNetMgtKeyAddress, getResourceAsStream, getState, getStringArg, getSubstitutedType, getTypeCreator, getTypeSubstitutions, getVersion, initializeFrom, isDeployable, isTopLevel, notifyReconfigured, passivate, reconf, reconfigure, reconfigure, rollbackReconfigurationOnFailure, setLibJars, setState, start, stop, transferDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.services.environment.Service
createType, createType, getParameterConfigurer, getParameterNames
-
Constructor Details
-
DefaultServiceImpl
Fallback constructor setting most fields to "empty" default values.- Parameters:
kind- the service kind
-
DefaultServiceImpl
Fallback constructor setting most fields to "empty" default values.- Parameters:
id- the id of the servicekind- the service kind
-
DefaultServiceImpl
protected DefaultServiceImpl(String id, String name, de.iip_ecosphere.platform.support.Version version, 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
Creates a default service from YAML information.- Parameters:
yaml- the service information as read from YAML
-
DefaultServiceImpl
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 Details
-
migrate
Description 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:
ExecutionException- if migration fails
-
update
Description 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:
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
Description 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:
ExecutionException- if switching the service cannot be performed for some reason
-