Package org.restheart.mongodb
Class MongoServiceConfiguration
- java.lang.Object
-
- org.restheart.mongodb.MongoServiceConfiguration
-
public class MongoServiceConfiguration extends Object
Utility class to help dealing with the restheart configuration file.- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMongoServiceConfiguration.METRICS_GATHERING_LEVEL
-
Field Summary
Fields Modifier and Type Field Description static StringCONNECTION_OPTIONS_KEYundertow connetction optionsstatic org.slf4j.LoggerLOGGER
-
Constructor Summary
Constructors Constructor Description MongoServiceConfiguration()Creates a new instance of Configuration with defaults values.
-
Method Summary
-
-
-
Field Detail
-
CONNECTION_OPTIONS_KEY
public static final String CONNECTION_OPTIONS_KEY
undertow connetction options- See Also:
- Constant Field Values
-
LOGGER
public static final org.slf4j.Logger LOGGER
-
-
Method Detail
-
get
public static MongoServiceConfiguration get()
-
init
public static MongoServiceConfiguration init(Map<String,Object> confs)
-
init
public static MongoServiceConfiguration init(Map<String,Object> confs, boolean silent)
-
initFromFile
public static MongoServiceConfiguration initFromFile(Path confFile, boolean silent)
-
convertListToIntArray
public static int[] convertListToIntArray(List<Object> integers)
- Parameters:
integers-- Returns:
-
isLocalCacheEnabled
public boolean isLocalCacheEnabled()
- Returns:
- the localCacheEnabled
-
getLocalCacheTtl
public long getLocalCacheTtl()
- Returns:
- the localCacheTtl
-
getRequestsLimit
public int getRequestsLimit()
- Returns:
- the requestsLimit
-
getQueryTimeLimit
public long getQueryTimeLimit()
- Returns:
- the queryTimeLimit
-
getAggregationTimeLimit
public long getAggregationTimeLimit()
- Returns:
- the aggregationTimeLimit
-
getAggregationCheckOperators
public boolean getAggregationCheckOperators()
- Returns:
- the aggregationCheckOperators
-
getEagerLinearSliceWidht
public int getEagerLinearSliceWidht()
- Returns:
- the eagerLinearSliceWidht
-
getEagerLinearSliceDelta
public int getEagerLinearSliceDelta()
- Returns:
- the eagerLinearSliceDelta
-
getEagerLinearSliceHeights
public int[] getEagerLinearSliceHeights()
- Returns:
- the eagerLinearSliceHeights
-
getEagerRndSliceMinWidht
public int getEagerRndSliceMinWidht()
- Returns:
- the eagerRndSliceMinWidht
-
getEagerRndMaxCursors
public int getEagerRndMaxCursors()
- Returns:
- the eagerRndMaxCursors
-
getEagerPoolSize
public int getEagerPoolSize()
- Returns:
- the eagerPoolSize
-
getMongoUri
public com.mongodb.MongoClientURI getMongoUri()
- Returns:
- the mongoUri
-
isSchemaCacheEnabled
public boolean isSchemaCacheEnabled()
- Returns:
- the schemaCacheEnabled
-
getSchemaCacheTtl
public long getSchemaCacheTtl()
- Returns:
- the schemaCacheTtl
-
getDbEtagCheckPolicy
public ExchangeKeys.ETAG_CHECK_POLICY getDbEtagCheckPolicy()
- Returns:
- the dbEtagCheckPolicy
-
getCollEtagCheckPolicy
public ExchangeKeys.ETAG_CHECK_POLICY getCollEtagCheckPolicy()
- Returns:
- the collEtagCheckPolicy
-
getDocEtagCheckPolicy
public ExchangeKeys.ETAG_CHECK_POLICY getDocEtagCheckPolicy()
- Returns:
- the docEtagCheckPolicy
-
getConnectionOptions
public Map<String,Object> getConnectionOptions()
- Returns:
- the connectionOptions
-
getInstanceBaseURL
public String getInstanceBaseURL()
- Returns:
- the instanceBaseURL
-
getDefaultRepresentationFormat
public ExchangeKeys.REPRESENTATION_FORMAT getDefaultRepresentationFormat()
- Returns:
- the defaultRepresentationFromat
-
getConfigurationFileMap
public Map<String,Object> getConfigurationFileMap()
- Returns:
- the configurationFileMap
-
getCursorBatchSize
public int getCursorBatchSize()
- Returns:
- the cursorBatchSize
-
getMaxPagesize
public int getMaxPagesize()
- Returns:
- the maxPagesize
-
getDefaultPagesize
public int getDefaultPagesize()
- Returns:
- the defaultPagesize
-
getMetricsGatheringLevel
public MongoServiceConfiguration.METRICS_GATHERING_LEVEL getMetricsGatheringLevel()
- Returns:
-
gatheringAboveOrEqualToLevel
public boolean gatheringAboveOrEqualToLevel(MongoServiceConfiguration.METRICS_GATHERING_LEVEL level)
decides whether metrics are gathered at the given log level or not- Parameters:
level- Metrics Gathering Level- Returns:
- true if gathering Above Or Equal To Level
-
-