Class DefaultConfiguration

java.lang.Object
com.suse.coco.configuration.DefaultConfiguration
All Implemented Interfaces:
Configuration

public class DefaultConfiguration extends 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 Details

    • MANDATORY_PROPERTIES

      private static final Set<String> MANDATORY_PROPERTIES
    • CONNECTION_PROPERTIES

      private static final Set<String> CONNECTION_PROPERTIES
    • configurationSource

      private final com.suse.common.configuration.ConfigurationSource configurationSource
  • Constructor Details

    • DefaultConfiguration

      public DefaultConfiguration()
      Default constructor
    • DefaultConfiguration

      protected DefaultConfiguration(com.suse.common.configuration.ConfigurationSource configSource)
  • Method Details

    • getDatabaseUser

      public String getDatabaseUser()
      Description copied from interface: Configuration
      Retrieve the database user
      Specified by:
      getDatabaseUser in interface Configuration
      Returns:
      the user to access the database
    • getDatabasePassword

      public String getDatabasePassword()
      Description copied from interface: Configuration
      Retrieves the database password
      Specified by:
      getDatabasePassword in interface Configuration
      Returns:
      the unencrypted password to access the database
    • getDatabaseConnectionString

      public String getDatabaseConnectionString()
      Description copied from interface: Configuration
      Retrieves the connection string
      Specified by:
      getDatabaseConnectionString in interface Configuration
      Returns:
      the jdbc string to connect to the database
    • getDatabaseHostString

      public String getDatabaseHostString()
      Description copied from interface: Configuration
      Retrieves the database hostname string
      Specified by:
      getDatabaseHostString in interface Configuration
      Returns:
      the host string to use as part of the JDBC connection URL
    • getDatabasePort

      public int getDatabasePort()
      Description copied from interface: Configuration
      Retrieves the database port integer
      Specified by:
      getDatabasePort in interface Configuration
      Returns:
      the port integern to use as part of the JDBC connection URL
    • getDatabaseNameString

      public String getDatabaseNameString()
      Description copied from interface: Configuration
      Retrieves the database name string
      Specified by:
      getDatabaseNameString in interface Configuration
      Returns:
      the postgresql database name string to use as part of the JDBC connection URL
    • getCorePoolSize

      public int getCorePoolSize()
      Description copied from interface: Configuration
      Retrieves the number of core threads for the queue processor
      Specified by:
      getCorePoolSize in interface Configuration
      Returns:
      the number of core threads
    • getMaximumPoolSize

      public int getMaximumPoolSize()
      Description copied from interface: Configuration
      Retrieves the maximum number of threads for the queue processor
      Specified by:
      getMaximumPoolSize in interface Configuration
      Returns:
      the maximum number of threads
    • getThreadKeepAliveInSeconds

      public long getThreadKeepAliveInSeconds()
      Description copied from interface: Configuration
      The number of seconds a thread will remain alive even without work to do.
      Specified by:
      getThreadKeepAliveInSeconds in interface Configuration
      Returns:
      the number of seconds a thread will be kept idle.
    • getBatchSize

      public int getBatchSize()
      Description copied from interface: Configuration
      Retrieves the number of attestation results to process at a time.
      Specified by:
      getBatchSize in interface Configuration
      Returns:
      the maximum number of attestation results to process.
    • toProperties

      public Properties toProperties()
      Description copied from interface: Configuration
      Convert this configuration to a Properties
      Specified by:
      toProperties in interface Configuration
      Returns:
      a Properties representing the configuration.