Class YamlService

  • All Implemented Interfaces:
    Service

    public class YamlService
    extends de.iip_ecosphere.platform.services.environment.AbstractYamlService
    implements Service
    Information about a single service.
    Author:
    Holger Eichelberger, SSE
    • Constructor Summary

      Constructors 
      Constructor Description
      YamlService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      long getDisk()
      Returns the desired disk space for instances of this service.
      java.lang.String getEnsembleWith()
      Returns the service id of the ensemble leader.
      int getInstances()
      Returns the desired number of instances of this service to be started in the same process.
      long getMemory()
      Returns the desired memory for instances of this service.
      java.util.List<YamlTypedData> getParameters()
      Returns the service-specific configurable parameters.
      YamlProcess getProcess()
      Returns an optional attached process realizing the service.
      java.util.List<YamlRelation> getRelations()
      Returns the service-specific relations and command line arguments.
      void setCmdArg​(java.util.List<java.lang.String> cmdArg)
      Defines the command line arguments.
      void setCpus​(int cpus)
      Defines the desired number of CPUs for instances of this service.
      void setDisk​(long disk)
      Defines the desired disk space for instances of this service.
      void setEnsembleWith​(java.lang.String ensembleWith)
      Defines the service id of the ensemble leader starting this service.
      void setInstances​(int instances)
      Defines the desired number of instances of this service to be started in the same process.
      void setMemory​(long memory)
      Defines the desired memory for instances of this service.
      void setParameters​(java.util.List<YamlTypedData> parameters)
      Defines the service-specific configurable parameter.
      void setProcess​(YamlProcess process)
      Defines an optional attached process realizing the service.
      void setRelations​(java.util.List<YamlRelation> relations)
      Defines the service-specific relations and command line arguments.
      • Methods inherited from class de.iip_ecosphere.platform.services.environment.AbstractYamlService

        getApplicationId, getApplicationInstanceId, getDescription, getId, getKind, getName, getNetMgtKey, getServiceId, getTransportChannel, getVersion, isDeployable, isTopLevel, setApplicationId, setDeployable, setDescription, setId, setKind, setName, setNetMgtKey, setTopLevel, setTransportChannel, setVersion
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • cmdArg

        private java.util.List<java.lang.String> cmdArg
      • ensembleWith

        private java.lang.String ensembleWith
      • instances

        private int instances
      • memory

        private long memory
      • disk

        private long disk
      • cpus

        private int cpus
    • Constructor Detail

      • YamlService

        public YamlService()
    • Method Detail

      • getCmdArg

        public java.util.List<java.lang.String> getCmdArg()
        Description copied from interface: Service
        Returns additional/optional command line arguments required to start the service. Placeholders are not replaced.
        Specified by:
        getCmdArg in interface Service
        Returns:
        the command line arguments (may be empty for none)
      • getCmdArg

        public java.util.List<java.lang.String> getCmdArg​(int port,
                                                          java.lang.String protocol)
        Description copied from interface: Service
        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 Service.PROTOCOL_PLACEHOLDER will be replaced with the AAS protocol.
        Specified by:
        getCmdArg in interface Service
        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

        public java.lang.String getEnsembleWith()
        Description copied from interface: Service
        Returns the service id of the ensemble leader. The ensemble services shall then be started on its own.
        Specified by:
        getEnsembleWith in interface Service
        Returns:
        the service id of the ensemble leader (may be null for none)
      • getRelations

        public java.util.List<YamlRelation> getRelations()
        Description copied from interface: Service
        Returns the service-specific relations and command line arguments.
        Specified by:
        getRelations in interface Service
        Returns:
        the relations, may be empty
      • getParameters

        public java.util.List<YamlTypedData> getParameters()
        Description copied from interface: Service
        Returns the service-specific configurable parameters.
        Specified by:
        getParameters in interface Service
        Returns:
        the parameter, may be empty
      • getProcess

        public YamlProcess getProcess()
        Description copied from interface: Service
        Returns an optional attached process realizing the service.
        Specified by:
        getProcess in interface Service
        Returns:
        the process information, may be null
      • getInstances

        public int getInstances()
        Description copied from interface: Service
        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.
        Specified by:
        getInstances in interface Service
        Returns:
        the number of instances, ignored if not positive
      • getMemory

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

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

        public int getCpus()
        Description copied from interface: Service
        Returns the desired number of CPUs for instances of this service. This property is considered during deployment only if the deployer supports it.
        Specified by:
        getCpus in interface Service
        Returns:
        the desired number of CPUs , ignored if not positive
      • setCmdArg

        public void setCmdArg​(java.util.List<java.lang.String> cmdArg)
        Defines the command line arguments. [required by SnakeYaml]
        Parameters:
        cmdArg - the command line arguments (may be empty for none)
      • setEnsembleWith

        public void setEnsembleWith​(java.lang.String ensembleWith)
        Defines the service id of the ensemble leader starting this service. [required by SnakeYaml]
        Parameters:
        ensembleWith - the service id of the ensemble leader (may be null for none)
      • setRelations

        public void setRelations​(java.util.List<YamlRelation> relations)
        Defines the service-specific relations and command line arguments. [required by SnakeYaml]
        Parameters:
        relations - the relations, may be empty
      • setParameters

        public void setParameters​(java.util.List<YamlTypedData> parameters)
        Defines the service-specific configurable parameter. [required by SnakeYaml]
        Parameters:
        parameters - the parameters, may be empty
      • setProcess

        public void setProcess​(YamlProcess process)
        Defines an optional attached process realizing the service. [required by SnakeYaml]
        Parameters:
        process - the process information, may be null
      • setInstances

        public void setInstances​(int instances)
        Defines 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.
        Parameters:
        instances - the number of instances, ignored if not positive
      • setMemory

        public void setMemory​(long memory)
        Defines the desired memory for instances of this service. This property is considered during deployment only if the deployer supports it.
        Parameters:
        memory - the desired memory in Mebibytes (i.e., "m"), ignored if not positive
      • setDisk

        public void setDisk​(long disk)
        Defines the desired disk space for instances of this service. This property is considered during deployment only if the deployer supports it.
        Parameters:
        disk - the desired disk space in Mebibytes (i.e., "m"), ignored if not positive
      • setCpus

        public void setCpus​(int cpus)
        Defines the desired number of CPUs for instances of this service. This property is considered during deployment only if the deployer supports it.
        Parameters:
        cpus - the desired number of CPUs , ignored if not positive