Package com.suse.coco.configuration
Class DefaultConfiguration
- java.lang.Object
-
- com.suse.coco.configuration.DefaultConfiguration
-
- All Implemented Interfaces:
Configuration
public class DefaultConfiguration extends java.lang.Object implements Configuration
Default application configuration. Values are first read from the environment then from a property file which defines the default values. A part for the mandatory properties, all the settings should have a value inside the property file.
-
-
Field Summary
Fields Modifier and Type Field Description private com.suse.common.configuration.ConfigurationSourceconfigurationSourceprivate static java.util.stream.Stream<java.lang.String>MANDATORY_PROPERTIES
-
Constructor Summary
Constructors Constructor Description DefaultConfiguration()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBatchSize()Retrieves the number of attestation results to process at a time.intgetCorePoolSize()Retrieves the number of core threads for the queue processorjava.lang.StringgetDatabaseConnectionString()Retrieves the connection stringjava.lang.StringgetDatabasePassword()Retrieves the database passwordjava.lang.StringgetDatabaseUser()Retrieve the database userintgetMaximumPoolSize()Retrieves the maximum number of threads for the queue processorlonggetThreadKeepAliveInSeconds()The number of seconds a thread will remain alive even without work to do.java.util.PropertiestoProperties()Convert this configuration to a Properties
-
-
-
Method Detail
-
getDatabaseUser
public java.lang.String getDatabaseUser()
Description copied from interface:ConfigurationRetrieve the database user- Specified by:
getDatabaseUserin interfaceConfiguration- Returns:
- the user to access the database
-
getDatabasePassword
public java.lang.String getDatabasePassword()
Description copied from interface:ConfigurationRetrieves the database password- Specified by:
getDatabasePasswordin interfaceConfiguration- Returns:
- the unencrypted password to access the database
-
getDatabaseConnectionString
public java.lang.String getDatabaseConnectionString()
Description copied from interface:ConfigurationRetrieves the connection string- Specified by:
getDatabaseConnectionStringin interfaceConfiguration- Returns:
- the jdbc string to connect to the database
-
getCorePoolSize
public int getCorePoolSize()
Description copied from interface:ConfigurationRetrieves the number of core threads for the queue processor- Specified by:
getCorePoolSizein interfaceConfiguration- Returns:
- the number of core threads
-
getMaximumPoolSize
public int getMaximumPoolSize()
Description copied from interface:ConfigurationRetrieves the maximum number of threads for the queue processor- Specified by:
getMaximumPoolSizein interfaceConfiguration- Returns:
- the maximum number of threads
-
getThreadKeepAliveInSeconds
public long getThreadKeepAliveInSeconds()
Description copied from interface:ConfigurationThe number of seconds a thread will remain alive even without work to do.- Specified by:
getThreadKeepAliveInSecondsin interfaceConfiguration- Returns:
- the number of seconds a thread will be kept idle.
-
getBatchSize
public int getBatchSize()
Description copied from interface:ConfigurationRetrieves the number of attestation results to process at a time.- Specified by:
getBatchSizein interfaceConfiguration- Returns:
- the maximum number of attestation results to process.
-
toProperties
public java.util.Properties toProperties()
Description copied from interface:ConfigurationConvert this configuration to a Properties- Specified by:
toPropertiesin interfaceConfiguration- Returns:
- a
Propertiesrepresenting the configuration.
-
-