Class SpringCloudServiceSetup


  • @ConfigurationProperties(prefix="service-mgr")
    @Component
    public class SpringCloudServiceSetup
    extends de.iip_ecosphere.platform.services.ServiceSetup
    Configures the service manager.
    Author:
    Holger Eichelberger, SSE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getAvailabilityRetryDelay()
      Returns the delay between two availability checks.
      java.lang.String getBrokerHost()
      Returns the name of the broker host.
      int getBrokerPort()
      Returns the broker port.
      boolean getDeleteArtifacts()
      Returns whether artifacts may be deleted.
      java.lang.String getDescriptorName()
      Returns the name of the descriptor file to load from an artifact.
      java.io.File getDownloadDir()
      Returns the download directory for artifacts.
      java.lang.String getExecutable​(java.lang.String executable)
      Returns the configured value for an executable, i.e., either from the configured executables mapping or the Executable.
      java.util.List<java.lang.String> getJavaOpts()
      Returns the Java command line options.
      java.io.File getSharedLibs()
      Returns the directory for shared service libraries.
      int getWaitingTime()
      Returns the waiting time for longer operations, e.g., deploying a service.
      void setAvailabilityRetryDelay​(int availabilityRetryDelay)
      Changes the delay between two availability checks.
      void setBrokerHost​(java.lang.String brokerHost)
      Defines the name of the broker host.
      void setBrokerPort​(int brokerPort)
      Defines the broker port.
      void setDeleteArtifacts​(boolean deleteArtifacts)
      Defines whether artifacts may be deleted.
      void setDescriptorName​(java.lang.String descriptorName)
      Defines the name of the descriptor file to load from an artifact.
      void setDownloadDir​(java.io.File downloadDir)
      Defines the download directory for artifacts.
      void setExecutables​(java.util.HashMap<java.lang.String,​java.lang.String> executables)
      Defines the executables mapping, i.e., an optional mapping of OS command names to paths or other command names that are available on the respective target system.
      void setJavaOpts​(java.util.List<java.lang.String> javaOpts)
      Sets the Java command line options.
      void setSharedLibs​(java.io.File sharedLibs)
      Changes the directory for shared service libraries.
      void setWaitingTime​(int waitingTime)
      Defines the waiting time for longer operations, e.g., deploying a service.
      • Methods inherited from class de.iip_ecosphere.platform.services.ServiceSetup

        getAas, getNetMgr, getServiceCmdArgs, getServiceProtocol, getTransport, setAas, setNetMgr, setServiceCmdArgs, setServiceProtocol, setTransport
      • Methods inherited from class java.lang.Object

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

      • brokerHost

        private java.lang.String brokerHost
      • brokerPort

        private int brokerPort
      • deleteArtifacts

        private boolean deleteArtifacts
      • downloadDir

        private java.io.File downloadDir
      • descriptorName

        private java.lang.String descriptorName
      • waitingTime

        private int waitingTime
      • availabilityRetryDelay

        private int availabilityRetryDelay
      • executables

        private java.util.HashMap<java.lang.String,​java.lang.String> executables
      • javaOpts

        private java.util.List<java.lang.String> javaOpts
      • sharedLibs

        private java.io.File sharedLibs
    • Constructor Detail

      • SpringCloudServiceSetup

        public SpringCloudServiceSetup()
    • Method Detail

      • getBrokerHost

        public java.lang.String getBrokerHost()
        Returns the name of the broker host.
        Returns:
        the host name (usually "localhost")
      • getBrokerPort

        public int getBrokerPort()
        Returns the broker port.
        Returns:
        the broker port (by default 8883)
      • getDeleteArtifacts

        public boolean getDeleteArtifacts()
        Returns whether artifacts may be deleted.
        Returns:
        true for delete, false else
      • getDownloadDir

        public java.io.File getDownloadDir()
        Returns the download directory for artifacts.
        Returns:
        the download directory (if null use temporary directory/files)
      • getSharedLibs

        public java.io.File getSharedLibs()
        Returns the directory for shared service libraries.
        Returns:
        the shared library directory (if null or empty for none)
      • getDescriptorName

        public java.lang.String getDescriptorName()
        Returns the name of the descriptor file to load from an artifact.
        Returns:
        the name of the descriptor file
      • getWaitingTime

        public int getWaitingTime()
        Returns the waiting time for longer operations, e.g., deploying a service.
        Returns:
        the waiting time in ms
      • getAvailabilityRetryDelay

        public int getAvailabilityRetryDelay()
        Returns the delay between two availability checks.
        Returns:
        the retry delay in ms
      • getExecutable

        public java.lang.String getExecutable​(java.lang.String executable)
        Returns the configured value for an executable, i.e., either from the configured executables mapping or the Executable. The idea here is to allow the configuration to override commands that are available via the OS path in certain cases.
        Parameters:
        executable - the executable to look for
        Returns:
        either executable or the mapped executable value
      • getJavaOpts

        public java.util.List<java.lang.String> getJavaOpts()
        Returns the Java command line options.
        Returns:
        the command line options (disables by default log4j format lookups)
      • setBrokerHost

        public void setBrokerHost​(java.lang.String brokerHost)
        Defines the name of the broker host. [required by Spring]
        Parameters:
        brokerHost - the host name
      • setBrokerPort

        public void setBrokerPort​(int brokerPort)
        Defines the broker port. [required by Spring]
        Parameters:
        brokerPort - the broker port
      • setDeleteArtifacts

        public void setDeleteArtifacts​(boolean deleteArtifacts)
        Defines whether artifacts may be deleted. [required by Spring]
        Parameters:
        deleteArtifacts - true for delete, false else
      • setDownloadDir

        public void setDownloadDir​(java.io.File downloadDir)
        Defines the download directory for artifacts. [required by Spring]
        Parameters:
        downloadDir - the download directory (if null use temporary directory/files)
      • setSharedLibs

        public void setSharedLibs​(java.io.File sharedLibs)
        Changes the directory for shared service libraries.
        Parameters:
        sharedLibs - the shared library directory (if null or empty for none)
      • setDescriptorName

        public void setDescriptorName​(java.lang.String descriptorName)
        Defines the name of the descriptor file to load from an artifact. [required by Spring]
        Parameters:
        descriptorName - the name of the descriptor file (ignored if null or empty)
      • setWaitingTime

        public void setWaitingTime​(int waitingTime)
        Defines the waiting time for longer operations, e.g., deploying a service. [required by Spring]
        Parameters:
        waitingTime - the waiting time in ms
      • setAvailabilityRetryDelay

        public void setAvailabilityRetryDelay​(int availabilityRetryDelay)
        Changes the delay between two availability checks. [required by Spring]
        Parameters:
        availabilityRetryDelay - the retry delay in ms
      • setExecutables

        public void setExecutables​(java.util.HashMap<java.lang.String,​java.lang.String> executables)
        Defines the executables mapping, i.e., an optional mapping of OS command names to paths or other command names that are available on the respective target system. [required by Spring]
        Parameters:
        executables - the executables mapping
      • setJavaOpts

        public void setJavaOpts​(java.util.List<java.lang.String> javaOpts)
        Sets the Java command line options. [required by Spring]
        Parameters:
        javaOpts - the command line options