Class 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.ConfigurationSource configurationSource  
      private static java.util.stream.Stream<java.lang.String> MANDATORY_PROPERTIES  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getBatchSize()
      Retrieves the number of attestation results to process at a time.
      int getCorePoolSize()
      Retrieves the number of core threads for the queue processor
      java.lang.String getDatabaseConnectionString()
      Retrieves the connection string
      java.lang.String getDatabasePassword()
      Retrieves the database password
      java.lang.String getDatabaseUser()
      Retrieve the database user
      int getMaximumPoolSize()
      Retrieves the maximum number of threads for the queue processor
      long getThreadKeepAliveInSeconds()
      The number of seconds a thread will remain alive even without work to do.
      java.util.Properties toProperties()
      Convert this configuration to a Properties
      • Methods inherited from class java.lang.Object

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

      • MANDATORY_PROPERTIES

        private static final java.util.stream.Stream<java.lang.String> MANDATORY_PROPERTIES
      • configurationSource

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

      • DefaultConfiguration

        public DefaultConfiguration()
        Default constructor
    • Method Detail

      • getDatabaseUser

        public java.lang.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 java.lang.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 java.lang.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
      • 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 java.util.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.