Package org.restheart
Class Configuration
- java.lang.Object
-
- org.restheart.Configuration
-
public class Configuration extends Object
Utility class to help dealing with the configuration file.- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_ROUTEstatic StringVERSIONthe version is read from the JAR's MANIFEST.MF file, which is automatically generated by the Maven build process
-
Constructor Summary
Constructors Constructor Description Configuration()Creates a new instance of Configuration with defaults values.Configuration(Path confFilePath)Creates a new instance of Configuration from the configuration file For any missing property the default value is used.Configuration(Path confFilePath, boolean silent)Creates a new instance of Configuration from the configuration file For any missing property the default value is used.Configuration(Map<String,Object> conf, boolean silent)Creates a new instance of Configuration from the configuration file For any missing property the default value is used.
-
Method Summary
-
-
-
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
-
DEFAULT_ROUTE
public static final String DEFAULT_ROUTE
- See Also:
- Constant Field Values
-
-
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 filesilent-- 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 mapsilent-- 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
-
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
-
getAuthMechanisms
public Map<String,Map<String,Object>> getAuthMechanisms()
- Returns:
- the authMechanisms
-
getAuthenticators
public Map<String,Map<String,Object>> getAuthenticators()
- Returns:
- the authenticators
-
getRequestsLimit
public int getRequestsLimit()
- Returns:
- the requestsLimit
-
getTokenManagers
public Map<String,Map<String,Object>> getTokenManagers()
- Returns:
- the tokenManagers
-
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()
-
getRestheartBaseUrl
public URI getRestheartBaseUrl() throws ConfigurationException
- Returns:
- the base URL of restheart proxy identified by proxy configuration property name="restheart"
- Throws:
ConfigurationException
-
getRestheartLocation
public URI getRestheartLocation() throws ConfigurationException
- Returns:
- the location of restheart proxy identified by proxy configuration property name="restheart"
- Throws:
ConfigurationException
-
-