Interface Service

    • Method Detail

      • getName

        java.lang.String getName()
        The name of the service.
        Returns:
        the name
      • getVersion

        de.iip_ecosphere.platform.support.iip_aas.Version getVersion()
        The version of the service.
        Returns:
        the version
      • getDescription

        java.lang.String getDescription()
        The description of the service.
        Returns:
        the description, may be empty
      • isDeployable

        boolean isDeployable()
        Returns whether the service is deployable in distributable manner or fixed in deployment location.
        Returns:
        true for deployable, false for fixed
      • isTopLevel

        boolean isTopLevel()
        Returns whether the service is a top-level service.
        Returns:
        true for top-level, false for nested
      • getKind

        ServiceKind getKind()
        Returns the service kind.
        Returns:
        the service kind
      • getNetMgtKeyAddress

        default de.iip_ecosphere.platform.support.ServerAddress getNetMgtKeyAddress()
        Returns the resolved network address of the netMgtKey specified in the service descriptor.
        Returns:
        the resolved address, may be null in particular if no key was specified in the service descriptor
      • migrate

        void migrate​(java.lang.String resourceId)
              throws java.util.concurrent.ExecutionException
        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

        void update​(java.net.URI location)
             throws java.util.concurrent.ExecutionException
        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

        void switchTo​(java.lang.String targetId)
               throws java.util.concurrent.ExecutionException
        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
      • activate

        void activate()
               throws java.util.concurrent.ExecutionException
        Activates the service. [adaptation]
        Throws:
        java.util.concurrent.ExecutionException - in case that activating fails, e.g., because the service is already active
      • passivate

        void passivate()
                throws java.util.concurrent.ExecutionException
        Passivates the service. [adaptation]
        Throws:
        java.util.concurrent.ExecutionException - in case that passivating fails, e.g., because the service is already passive
      • reconfigure

        void reconfigure​(java.util.Map<java.lang.String,​java.lang.String> values)
                  throws java.util.concurrent.ExecutionException
        Reconfigures the service. [adaptation]
        Parameters:
        values - the (service-specific) name-value mapping that shall lead to a reconfiguration of the service; values come either as primitive values or as JSON structures complying with the parameter descriptor. The service is responsible for correct JSON de-serialization according to the respective descriptor.
        Throws:
        java.util.concurrent.ExecutionException - if reconfiguration fails
      • getParameterConfigurer

        default ParameterConfigurer<?> getParameterConfigurer​(java.lang.String paramName)
        Description copied from interface: ParameterConfigurerProvider
        Returns the parameter configurer for a given parameter. We need this generic approach to ease code generation and initial setting of parameter values.
        Specified by:
        getParameterConfigurer in interface ParameterConfigurerProvider
        Parameters:
        paramName - the name of the parameter
        Returns:
        the associated parameter configurer or null if there is none