Class SpringCloudServiceSetup
- java.lang.Object
-
- de.iip_ecosphere.platform.services.ServiceSetup
-
- de.iip_ecosphere.platform.services.spring.SpringCloudServiceSetup
-
@ConfigurationProperties(prefix="service-mgr") @Component public class SpringCloudServiceSetup extends de.iip_ecosphere.platform.services.ServiceSetupConfigures the service manager.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description private intavailabilityRetryDelayprivate java.lang.StringbrokerHostprivate intbrokerPortprivate booleandeleteArtifactsprivate java.lang.StringdescriptorNameprivate java.io.FiledownloadDirprivate java.util.HashMap<java.lang.String,java.lang.String>executablesprivate java.util.List<java.lang.String>javaOptsprivate java.io.FilesharedLibsprivate intwaitingTime
-
Constructor Summary
Constructors Constructor Description SpringCloudServiceSetup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAvailabilityRetryDelay()Returns the delay between two availability checks.java.lang.StringgetBrokerHost()Returns the name of the broker host.intgetBrokerPort()Returns the broker port.booleangetDeleteArtifacts()Returns whether artifacts may be deleted.java.lang.StringgetDescriptorName()Returns the name of the descriptor file to load from an artifact.java.io.FilegetDownloadDir()Returns the download directory for artifacts.java.lang.StringgetExecutable(java.lang.String executable)Returns the configured value for an executable, i.e., either from the configured executables mapping or theExecutable.java.util.List<java.lang.String>getJavaOpts()Returns the Java command line options.java.io.FilegetSharedLibs()Returns the directory for shared service libraries.intgetWaitingTime()Returns the waiting time for longer operations, e.g., deploying a service.voidsetAvailabilityRetryDelay(int availabilityRetryDelay)Changes the delay between two availability checks.voidsetBrokerHost(java.lang.String brokerHost)Defines the name of the broker host.voidsetBrokerPort(int brokerPort)Defines the broker port.voidsetDeleteArtifacts(boolean deleteArtifacts)Defines whether artifacts may be deleted.voidsetDescriptorName(java.lang.String descriptorName)Defines the name of the descriptor file to load from an artifact.voidsetDownloadDir(java.io.File downloadDir)Defines the download directory for artifacts.voidsetExecutables(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.voidsetJavaOpts(java.util.List<java.lang.String> javaOpts)Sets the Java command line options.voidsetSharedLibs(java.io.File sharedLibs)Changes the directory for shared service libraries.voidsetWaitingTime(int waitingTime)Defines the waiting time for longer operations, e.g., deploying a service.
-
-
-
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
-
-
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:
truefor delete,falseelse
-
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 theExecutable. 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
executableor 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-truefor delete,falseelse
-
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
-
-