Class DefaultServiceImpl

    • 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 service
        kind - 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 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​(java.lang.String serviceId,
                                  java.io.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 Detail

      • migrate

        public void migrate​(java.lang.String resourceId)
                     throws java.util.concurrent.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:
        java.util.concurrent.ExecutionException - if migration fails
      • update

        public void update​(java.net.URI location)
                    throws java.util.concurrent.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:
        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.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:
        java.util.concurrent.ExecutionException - if switching the service cannot be performed for some reason