Interface Service

  • All Known Implementing Classes:
    YamlService

    public interface Service
    Information about a single service. getId() and getName() must be given, both not empty, #getKind() and getVersion() must be given, with version in format of Version. #getCmdArg() or getEnsembleWith() be empty. #getDependencies() and #getRelations() must be given but may be empty. If elements are given, the elements must be valid. #getProcess() may be absent, i.e. null, but if given it must be valid. getInstances(), getMemory(), getDisk(), getCpus() are replaced by default values if invalid.
    Author:
    Holger Eichelberger, SSE
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PROTOCOL_PLACEHOLDER  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getApplicationId()
      Returns the application id this service is assigned to.
      java.lang.String getApplicationInstanceId()
      Returns the application instance id this service is running within.
      java.util.List<java.lang.String> getCmdArg()
      Returns additional/optional command line arguments required to start the service.
      java.util.List<java.lang.String> getCmdArg​(int port, java.lang.String protocol)
      Returns additional/optional command line arguments required to start the service.
      int getCpus()
      Returns the desired number of CPUs for instances of this service.
      java.lang.String getDescription()
      Returns the description of the service.
      long getDisk()
      Returns the desired disk space for instances of this service.
      java.lang.String getEnsembleWith()
      Returns the service id of the ensemble leader.
      java.lang.String getId()
      Returns the name of the service.
      int getInstances()
      Returns the desired number of instances of this service to be started in the same process.
      de.iip_ecosphere.platform.services.environment.ServiceKind getKind()
      Returns the service kind.
      long getMemory()
      Returns the desired memory for instances of this service.
      java.lang.String getName()
      Returns the name of the service.
      java.lang.String getNetMgtKey()
      Returns the network management key of a service instance this service is relying on.
      java.util.List<? extends TypedData> getParameters()
      Returns the service-specific configurable parameters.
      ProcessSpec getProcess()
      Returns an optional attached process realizing the service.
      java.util.List<? extends Relation> getRelations()
      Returns the service-specific relations and command line arguments.
      de.iip_ecosphere.platform.support.iip_aas.Version getVersion()
      Returns the version of the service.
      boolean isDeployable()
      Returns whether this service is decentrally deployable.
      boolean isTopLevel()
      Whether this is a top-level service or a nested service, e.g., in a family.
    • Field Detail

      • PROTOCOL_PLACEHOLDER

        static final java.lang.String PROTOCOL_PLACEHOLDER
        See Also:
        Constant Field Values
    • Method Detail

      • getId

        java.lang.String getId()
        Returns the name of the service.
        Returns:
        the name
      • getApplicationId

        java.lang.String getApplicationId()
        Returns the application id this service is assigned to.
        Returns:
        the application id
      • getApplicationInstanceId

        java.lang.String getApplicationInstanceId()
        Returns the application instance id this service is running within.
        Returns:
        the application instance id (may be empty for the default application instance)
      • getNetMgtKey

        java.lang.String getNetMgtKey()
        Returns the network management key of a service instance this service is relying on.
        Returns:
        the network management key, may be empty or null for none
      • getName

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

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

        java.lang.String getDescription()
        Returns the description of the service.
        Returns:
        the description
      • getCmdArg

        java.util.List<java.lang.String> getCmdArg()
        Returns additional/optional command line arguments required to start the service. Placeholders are not replaced.
        Returns:
        the command line arguments (may be empty for none)
      • getCmdArg

        java.util.List<java.lang.String> getCmdArg​(int port,
                                                   java.lang.String protocol)
        Returns additional/optional command line arguments required to start the service. The port placeholder Endpoint.PORT_PLACEHOLDER will be replaced with the command port the platform is using to send administrative commands to the service (see Service). Similarly PROTOCOL_PLACEHOLDER will be replaced with the AAS protocol.
        Parameters:
        port - the port used for the command communication
        protocol - the protocol used for the command communication
        Returns:
        the resolved command line arguments (may be empty for none)
      • getEnsembleWith

        java.lang.String getEnsembleWith()
        Returns the service id of the ensemble leader. The ensemble services shall then be started on its own.
        Returns:
        the service id of the ensemble leader (may be null for none)
      • getRelations

        java.util.List<? extends Relation> getRelations()
        Returns the service-specific relations and command line arguments.
        Returns:
        the relations, may be empty
      • getParameters

        java.util.List<? extends TypedData> getParameters()
        Returns the service-specific configurable parameters.
        Returns:
        the parameter, may be empty
      • getProcess

        ProcessSpec getProcess()
        Returns an optional attached process realizing the service.
        Returns:
        the process information, may be null
      • getKind

        de.iip_ecosphere.platform.services.environment.ServiceKind getKind()
        Returns the service kind.
        Returns:
        the service kind
      • isDeployable

        boolean isDeployable()
        Returns whether this service is decentrally deployable.
        Returns:
        true for deployable, false for not deployable
      • isTopLevel

        boolean isTopLevel()
        Whether this is a top-level service or a nested service, e.g., in a family.
        Returns:
        true for top-level, false for nested
      • getInstances

        int getInstances()
        Returns the desired number of instances of this service to be started in the same process. This property is considered during deployment only if the deployer supports it.
        Returns:
        the number of instances, ignored if not positive
      • getMemory

        long getMemory()
        Returns the desired memory for instances of this service. This property is considered during deployment only if the deployer supports it.
        Returns:
        the desired memory in Mebibytes (i.e., "m"), ignored if not positive
      • getDisk

        long getDisk()
        Returns the desired disk space for instances of this service. This property is considered during deployment only if the deployer supports it.
        Returns:
        the desired disk space in Mebibytes (i.e., "m"), ignored if not positive
      • getCpus

        int getCpus()
        Returns the desired number of CPUs for instances of this service. This property is considered during deployment only if the deployer supports it.
        Returns:
        the desired number of CPUs , ignored if not positive