Package org.restheart

Class Configuration


  • public class Configuration
    extends Object
    Utility class to help dealing with the configuration file.
    Author:
    Andrea Di Cesare <andrea@softinstigate.com>
    • Field Detail

      • VERSION

        public static final String VERSION
        the version is read from the JAR's MANIFEST.MF file, which is automatically generated by the Maven build process
    • Constructor Detail

      • Configuration

        public Configuration()
        Creates a new instance of Configuration with defaults values.
      • Configuration

        public Configuration​(Path confFilePath)
                      throws ConfigurationException
        Creates a new instance of Configuration from the configuration file For any missing property the default value is used.
        Parameters:
        confFilePath - the path of the configuration file
        Throws:
        ConfigurationException
      • Configuration

        public Configuration​(Path confFilePath,
                             boolean silent)
                      throws ConfigurationException
        Creates a new instance of Configuration from the configuration file For any missing property the default value is used.
        Parameters:
        confFilePath - the path of the configuration file
        silent -
        Throws:
        ConfigurationException
      • Configuration

        public Configuration​(Map<String,​Object> conf,
                             boolean silent)
                      throws ConfigurationException
        Creates a new instance of Configuration from the configuration file For any missing property the default value is used.
        Parameters:
        conf - the key-value configuration map
        silent -
        Throws:
        ConfigurationException
    • Method Detail

      • convertListToIntArray

        public static int[] convertListToIntArray​(List<Object> integers)
        Parameters:
        integers -
        Returns:
      • getOrDefault

        public static <V> V getOrDefault​(Map<String,​Object> conf,
                                         String key,
                                         V defaultValue,
                                         boolean silent)
        Type Parameters:
        V -
        Parameters:
        conf -
        key -
        defaultValue -
        silent -
        Returns:
      • getStaticResourcesMounts

        public List<Map<String,​Object>> getStaticResourcesMounts()
        Returns:
        the staticResourcesMounts
      • isAnsiConsole

        public boolean isAnsiConsole()
        Returns:
        true if the Ansi console is enabled
      • isHttpsListener

        public boolean isHttpsListener()
        Returns:
        the httpsListener
      • getHttpsPort

        public int getHttpsPort()
        Returns:
        the httpsPort
      • getHttpsHost

        public String getHttpsHost()
        Returns:
        the httpsHost
      • isHttpListener

        public boolean isHttpListener()
        Returns:
        the httpListener
      • getHttpPort

        public int getHttpPort()
        Returns:
        the httpPort
      • getHttpHost

        public String getHttpHost()
        Returns:
        the httpHost
      • isAjpListener

        public boolean isAjpListener()
        Returns:
        the ajpListener
      • getAjpPort

        public int getAjpPort()
        Returns:
        the ajpPort
      • getAjpHost

        public String getAjpHost()
        Returns:
        the ajpHost
      • getPluginsDirectory

        public String getPluginsDirectory()
        Returns:
        the pluginsDirectory
      • isUseEmbeddedKeystore

        public boolean isUseEmbeddedKeystore()
        Returns:
        the useEmbeddedKeystore
      • getKeystoreFile

        public String getKeystoreFile()
        Returns:
        the keystoreFile
      • getKeystorePassword

        public String getKeystorePassword()
        Returns:
        the keystorePassword
      • getCertPassword

        public String getCertPassword()
        Returns:
        the certPassword
      • getLogFilePath

        public String getLogFilePath()
        Returns:
        the logFilePath
      • getLogLevel

        public ch.qos.logback.classic.Level getLogLevel()
        Returns:
        the logLevel
      • isLogToConsole

        public boolean isLogToConsole()
        Returns:
        the logToConsole
      • isLogToFile

        public boolean isLogToFile()
        Returns:
        the logToFile
      • getTraceHeaders

        public List<String> getTraceHeaders()
      • getIoThreads

        public int getIoThreads()
        Returns:
        the ioThreads
      • getWorkerThreads

        public int getWorkerThreads()
        Returns:
        the workerThreads
      • getBufferSize

        public int getBufferSize()
        Returns:
        the bufferSize
      • isDirectBuffers

        public boolean isDirectBuffers()
        Returns:
        the directBuffers
      • isForceGzipEncoding

        public boolean isForceGzipEncoding()
        Returns:
        the forceGzipEncoding
      • getRequestsLimit

        public int getRequestsLimit()
        Returns:
        the requestsLimit
      • logExchangeDump

        public Integer logExchangeDump()
        Returns:
        the logExchangeDump Boolean
      • getConnectionOptions

        public Map<String,​Object> getConnectionOptions()
        Returns:
        the connectionOptions
      • getInstanceName

        public String getInstanceName()
        Returns:
        the instanceName
      • isAllowUnescapedCharactersInUrl

        public boolean isAllowUnescapedCharactersInUrl()