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 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
  • Constructor Details

    • DefaultServiceImpl

      protected DefaultServiceImpl(ServiceKind kind)
      Fallback constructor setting most fields to "empty" default values.
      Parameters:
      kind - the service kind
    • DefaultServiceImpl

      protected DefaultServiceImpl(String id, ServiceKind kind)
      Fallback constructor setting most fields to "empty" default values.
      Parameters:
      id - the id of the service
      kind - 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 service
      name - the name of the service
      version - the version of the service
      description - a description of the service, may be empty
      isDeployable - whether the service is decentrally deployable
      isTopLevel - whether the service is a top-level (non-nested) service
      kind - 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(String serviceId, InputStream ymlFile)
      Creates an default service from a service id and a YAML artifact.
      Parameters:
      serviceId - the service id
      ymlFile - the YML file containing the YAML artifact with the service descriptor
  • Method Details

    • migrate

      public void migrate(String resourceId) throws ExecutionException
      Description copied from interface: Service
      Migrates 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

      public void update(URI location) throws ExecutionException
      Description copied from interface: Service
      Updates the service by the service in the given location. 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

      public void switchTo(String targetId) throws ExecutionException
      Description copied from interface: Service
      Switches to an interface-compatible service. This method cares for stopping the old service, performing a handover if adequate, starting the target service. [adaptation]
      Parameters:
      targetId - the id of the target service
      Throws:
      ExecutionException - if switching the service cannot be performed for some reason