Package org.languagetool.server
Class HTTPServerConfig
- java.lang.Object
-
- org.languagetool.server.HTTPServerConfig
-
- Direct Known Subclasses:
HTTPSServerConfig
public class HTTPServerConfig extends java.lang.Object
- Since:
- 2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
HTTPServerConfig.Mode
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
abTest
protected java.lang.String
allowOriginUrl
protected java.util.List<java.lang.String>
blockedReferrers
protected int
cacheSize
protected long
cacheTTLSeconds
protected java.lang.String
dbDriver
protected boolean
dbLogging
protected java.lang.String
dbPassword
protected java.lang.String
dbUrl
protected java.lang.String
dbUsername
static java.lang.String
DEFAULT_HOST
static int
DEFAULT_PORT
The default port on which the server is running (8081).protected java.util.List<java.lang.String>
disabledRuleIds
protected java.io.File
fasttextBinary
protected java.io.File
fasttextModel
protected org.languagetool.GlobalConfig
globalConfig
protected java.util.List<org.languagetool.Language>
hiddenMatchesLanguages
protected java.lang.String
hiddenMatchesServer
protected int
hiddenMatchesServerFailTimeout
protected int
hiddenMatchesServerTimeout
protected int
ipFingerprintFactor
(package private) static java.lang.String
LANGUAGE_MODEL_OPTION
protected java.io.File
languageModelDir
protected int
maxCheckThreads
protected long
maxCheckTimeMillis
protected long
maxCheckTimeWithApiKeyMillis
protected float
maxErrorsPerWordRate
protected int
maxPipelinePoolSize
protected int
maxSpellingSuggestions
protected int
maxTextHardLength
protected int
maxTextLength
protected int
maxTextLengthWithApiKey
protected int
maxWorkQueueSize
protected HTTPServerConfig.Mode
mode
protected java.io.File
neuralNetworkModelDir
(package private) static java.lang.String
NN_MODEL_OPTION
protected boolean
pipelineCaching
protected int
pipelineExpireTime
protected boolean
pipelinePrewarming
protected int
port
protected boolean
prometheusMonitoring
protected int
prometheusPort
protected boolean
publicAccess
protected int
requestLimit
protected int
requestLimitInBytes
protected int
requestLimitPeriodInSeconds
protected java.io.File
rulesConfigFile
protected java.lang.String
secretTokenKey
protected java.net.URI
serverURL
protected boolean
skipLoggingChecks
protected boolean
skipLoggingRuleMatches
protected int
slowRuleLoggingThreshold
protected int
timeoutRequestLimit
protected boolean
trustXForwardForHeader
protected boolean
verbose
(package private) static java.lang.String
WORD2VEC_MODEL_OPTION
protected java.io.File
word2vecModelDir
-
Constructor Summary
Constructors Constructor Description HTTPServerConfig()
Create a server configuration for the default port (DEFAULT_PORT
).HTTPServerConfig(int serverPort)
HTTPServerConfig(int serverPort, boolean verbose)
HTTPServerConfig(java.lang.String[] args)
Parse command line options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addDynamicLanguages(java.util.Properties props)
@Nullable java.lang.String
getAbTest()
@Nullable java.lang.String
getAllowOriginUrl()
Value to set as the "Access-Control-Allow-Origin" http header.(package private) @NotNull java.util.List<java.lang.String>
getBlockedReferrers()
A list of HTTP referrers that are blocked and will only get an error message.(package private) int
getCacheSize()
Cache size (in number of sentences).(package private) long
getCacheTTLSeconds()
Cache entry TTL; refreshed on access; in seconds(package private) @Nullable java.lang.String
getDatabaseDriver()
(package private) boolean
getDatabaseLogging()
(package private) @Nullable java.lang.String
getDatabasePassword()
(package private) @Nullable java.lang.String
getDatabaseUrl()
(package private) @Nullable java.lang.String
getDatabaseUsername()
java.util.List<java.lang.String>
getDisabledRuleIds()
@Nullable java.io.File
getFasttextBinary()
Get binary path for fasttext language detection@Nullable java.io.File
getFasttextModel()
Get model path for fasttext language detection(package private) java.util.List<org.languagetool.Language>
getHiddenMatchesLanguages()
Languages for whichgetHiddenMatchesServer()
will be queried.(package private) @Nullable java.lang.String
getHiddenMatchesServer()
URL of server that is queried to add additional (but hidden) matches to the result.(package private) int
getHiddenMatchesServerFailTimeout()
Period to skip requests to hidden matches server after a timeout (in milliseconds)(package private) int
getHiddenMatchesServerTimeout()
Timeout in milliseconds for queryinggetHiddenMatchesServer()
.(package private) int
getIpFingerprintFactor()
since 4.4(package private) @Nullable java.io.File
getLanguageModelDir()
Get language model directory (which contains '3grams' sub directory) ornull
.(package private) int
getMaxCheckThreads()
(package private) long
getMaxCheckTimeMillis()
(package private) long
getMaxCheckTimeWithApiKeyMillis()
(package private) float
getMaxErrorsPerWordRate()
Maximum errors per word rate, checking will stop if the rate is higher.int
getMaxPipelinePoolSize()
(package private) int
getMaxSpellingSuggestions()
Maximum number of spelling errors for which a suggestion will be generated per check.(package private) int
getMaxTextHardLength()
Limit for maximum text length - text cannot be longer than this, even if user has valid secret token.(package private) int
getMaxTextLength()
(package private) int
getMaxTextLengthWithApiKey()
Maximum text length for users that can identify themselves with an API key.(package private) int
getMaxWorkQueueSize()
(package private) HTTPServerConfig.Mode
getMode()
java.io.File
getNeuralNetworkModelDir()
Get base directory for neural network models ornull
protected java.lang.String
getOptionalProperty(java.util.Properties props, java.lang.String propertyName, java.lang.String defaultValue)
int
getPipelineExpireTime()
int
getPort()
int
getPrometheusPort()
protected java.lang.String
getProperty(java.util.Properties props, java.lang.String propertyName, java.io.File config)
(package private) int
getRequestLimit()
(package private) int
getRequestLimitInBytes()
(package private) int
getRequestLimitPeriodInSeconds()
(package private) @Nullable java.io.File
getRulesConfigFile()
(package private) @Nullable java.lang.String
getSecretTokenKey()
Optional JWT token key.@Nullable java.net.URI
getServerURL()
int
getSlowRuleLoggingThreshold()
(package private) int
getTimeoutRequestLimit()
(package private) boolean
getTrustXForwardForHeader()
(package private) @Nullable java.io.File
getWord2VecModelDir()
Get word2vec model directory (which contains 'en' sub directories and final_embeddings.txt and dictionary.txt) ornull
.boolean
isPipelineCachingEnabled()
boolean
isPipelinePrewarmingEnabled()
boolean
isPrometheusMonitoring()
boolean
isPublicAccess()
boolean
isSkipLoggingChecks()
(package private) boolean
isSkipLoggingRuleMatches()
boolean
isVerbose()
private void
parseConfigFile(java.io.File file, boolean loadLangModel, boolean loadWord2VecModel, boolean loadNeuralNetworkModel)
void
setAbTest(@Nullable java.lang.String abTest)
void
setAllowOriginUrl(java.lang.String allowOriginUrl)
(package private) void
setBlockedReferrers(java.util.List<java.lang.String> blockedReferrers)
(package private) void
setCacheSize(int sentenceCacheSize)
Set cache size (in number of sentences).(package private) void
setCacheTTLSeconds(long cacheTTLSeconds)
Set cache entry TTL in seconds(package private) void
setDatabaseDriver(java.lang.String dbDriver)
(package private) void
setDatabaseLogging(boolean logging)
Whether meta data about each search (like in the logfile) should be logged to the database.(package private) void
setDatabasePassword(java.lang.String dbPassword)
(package private) void
setDatabaseUrl(java.lang.String dbUrl)
(package private) void
setDatabaseUsername(java.lang.String dbUsername)
void
setFasttextBinary(java.io.File binary)
Set binary path for fasttext language detectionvoid
setFasttextModel(java.io.File model)
Set model path for fasttext language detectionprivate void
setFasttextPaths(java.lang.String fasttextModelPath, java.lang.String fasttextBinaryPath)
void
setLanguageModelDirectory(java.lang.String langModelDir)
(package private) void
setMaxCheckThreads(int maxCheckThreads)
(package private) void
setMaxCheckTimeMillis(int maxCheckTimeMillis)
void
setMaxPipelinePoolSize(int maxPipelinePoolSize)
void
setMaxTextHardLength(int len)
void
setMaxTextLength(int len)
private void
setNeuralNetworkModelDir(java.lang.String nnModelDir)
void
setPipelineCaching(boolean pipelineCaching)
void
setPipelineExpireTime(int pipelineExpireTime)
void
setPipelinePrewarming(boolean pipelinePrewarming)
(package private) void
setSecretTokenKey(java.lang.String secretTokenKey)
void
setServerURL(@Nullable java.lang.String url)
(package private) void
setTrustXForwardForHeader(boolean trustXForwardForHeader)
Set totrue
if this is running behind a (reverse) proxy which sets theX-forwarded-for
HTTP header.private void
setWord2VecModelDirectory(java.lang.String w2vModelDir)
-
-
-
Field Detail
-
DEFAULT_HOST
public static final java.lang.String DEFAULT_HOST
- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
The default port on which the server is running (8081).- See Also:
- Constant Field Values
-
LANGUAGE_MODEL_OPTION
static final java.lang.String LANGUAGE_MODEL_OPTION
- See Also:
- Constant Field Values
-
WORD2VEC_MODEL_OPTION
static final java.lang.String WORD2VEC_MODEL_OPTION
- See Also:
- Constant Field Values
-
NN_MODEL_OPTION
static final java.lang.String NN_MODEL_OPTION
- See Also:
- Constant Field Values
-
verbose
protected boolean verbose
-
publicAccess
protected boolean publicAccess
-
port
protected int port
-
allowOriginUrl
protected java.lang.String allowOriginUrl
-
serverURL
protected java.net.URI serverURL
-
maxTextLength
protected int maxTextLength
-
maxTextHardLength
protected int maxTextHardLength
-
maxTextLengthWithApiKey
protected int maxTextLengthWithApiKey
-
secretTokenKey
protected java.lang.String secretTokenKey
-
maxCheckTimeMillis
protected long maxCheckTimeMillis
-
maxCheckTimeWithApiKeyMillis
protected long maxCheckTimeWithApiKeyMillis
-
maxCheckThreads
protected int maxCheckThreads
-
mode
protected HTTPServerConfig.Mode mode
-
languageModelDir
protected java.io.File languageModelDir
-
word2vecModelDir
protected java.io.File word2vecModelDir
-
pipelineCaching
protected boolean pipelineCaching
-
pipelinePrewarming
protected boolean pipelinePrewarming
-
maxPipelinePoolSize
protected int maxPipelinePoolSize
-
pipelineExpireTime
protected int pipelineExpireTime
-
fasttextModel
protected java.io.File fasttextModel
-
fasttextBinary
protected java.io.File fasttextBinary
-
neuralNetworkModelDir
protected java.io.File neuralNetworkModelDir
-
requestLimit
protected int requestLimit
-
requestLimitInBytes
protected int requestLimitInBytes
-
timeoutRequestLimit
protected int timeoutRequestLimit
-
requestLimitPeriodInSeconds
protected int requestLimitPeriodInSeconds
-
ipFingerprintFactor
protected int ipFingerprintFactor
-
trustXForwardForHeader
protected boolean trustXForwardForHeader
-
maxWorkQueueSize
protected int maxWorkQueueSize
-
rulesConfigFile
protected java.io.File rulesConfigFile
-
cacheSize
protected int cacheSize
-
cacheTTLSeconds
protected long cacheTTLSeconds
-
maxErrorsPerWordRate
protected float maxErrorsPerWordRate
-
maxSpellingSuggestions
protected int maxSpellingSuggestions
-
blockedReferrers
protected java.util.List<java.lang.String> blockedReferrers
-
hiddenMatchesServer
protected java.lang.String hiddenMatchesServer
-
hiddenMatchesServerTimeout
protected int hiddenMatchesServerTimeout
-
hiddenMatchesServerFailTimeout
protected int hiddenMatchesServerFailTimeout
-
hiddenMatchesLanguages
protected java.util.List<org.languagetool.Language> hiddenMatchesLanguages
-
dbDriver
protected java.lang.String dbDriver
-
dbUrl
protected java.lang.String dbUrl
-
dbUsername
protected java.lang.String dbUsername
-
dbPassword
protected java.lang.String dbPassword
-
dbLogging
protected boolean dbLogging
-
prometheusMonitoring
protected boolean prometheusMonitoring
-
prometheusPort
protected int prometheusPort
-
globalConfig
protected org.languagetool.GlobalConfig globalConfig
-
disabledRuleIds
protected java.util.List<java.lang.String> disabledRuleIds
-
skipLoggingRuleMatches
protected boolean skipLoggingRuleMatches
-
skipLoggingChecks
protected boolean skipLoggingChecks
-
slowRuleLoggingThreshold
protected int slowRuleLoggingThreshold
-
abTest
protected java.lang.String abTest
-
-
Constructor Detail
-
HTTPServerConfig
public HTTPServerConfig()
Create a server configuration for the default port (DEFAULT_PORT
).
-
HTTPServerConfig
public HTTPServerConfig(int serverPort)
- Parameters:
serverPort
- the port to bind to- Since:
- 2.8
-
HTTPServerConfig
public HTTPServerConfig(int serverPort, boolean verbose)
- Parameters:
serverPort
- the port to bind toverbose
- when set to true, the input text will be logged in case there is an exception
-
HTTPServerConfig
HTTPServerConfig(java.lang.String[] args)
Parse command line options.
-
-
Method Detail
-
parseConfigFile
private void parseConfigFile(java.io.File file, boolean loadLangModel, boolean loadWord2VecModel, boolean loadNeuralNetworkModel)
-
addDynamicLanguages
private void addDynamicLanguages(java.util.Properties props) throws java.io.IOException
- Throws:
java.io.IOException
-
setLanguageModelDirectory
public void setLanguageModelDirectory(java.lang.String langModelDir)
-
setWord2VecModelDirectory
private void setWord2VecModelDirectory(java.lang.String w2vModelDir)
-
setNeuralNetworkModelDir
private void setNeuralNetworkModelDir(java.lang.String nnModelDir)
-
setFasttextPaths
private void setFasttextPaths(java.lang.String fasttextModelPath, java.lang.String fasttextBinaryPath)
-
isVerbose
public boolean isVerbose()
-
isPublicAccess
public boolean isPublicAccess()
-
getPort
public int getPort()
-
getAllowOriginUrl
@Nullable public @Nullable java.lang.String getAllowOriginUrl()
Value to set as the "Access-Control-Allow-Origin" http header.null
will not return that header at all. With*
your server can be used from any other web site from Javascript/Ajax (search Cross-origin resource sharing (CORS) for details).
-
setAllowOriginUrl
public void setAllowOriginUrl(java.lang.String allowOriginUrl)
- Since:
- 4.2
-
getServerURL
@Nullable public @Nullable java.net.URI getServerURL()
- Returns:
- prefix / base URL for API requests
- Since:
- 4.8
-
setServerURL
public void setServerURL(@Nullable @Nullable java.lang.String url)
- Parameters:
url
- prefix / base URL for API requests- Since:
- 4.8
-
setMaxTextLength
public void setMaxTextLength(int len)
- Parameters:
len
- the maximum text length allowed (in number of characters), texts that are longer will cause an exception when being checked, unless the user can provide a JWT 'token' parameter with a 'maxTextLength' claim
-
setMaxTextHardLength
public void setMaxTextHardLength(int len)
- Parameters:
len
- the maximum text length allowed (in number of characters), texts that are longer will cause an exception when being checked even if the user can provide a JWT token- Since:
- 3.9
-
getMaxTextLength
int getMaxTextLength()
-
getMaxTextLengthWithApiKey
@Experimental int getMaxTextLengthWithApiKey()
Maximum text length for users that can identify themselves with an API key.- Since:
- 4.2
-
getMaxTextHardLength
int getMaxTextHardLength()
Limit for maximum text length - text cannot be longer than this, even if user has valid secret token.- Since:
- 3.9
-
getSecretTokenKey
@Nullable @Nullable java.lang.String getSecretTokenKey()
Optional JWT token key. Can be used to circumvent the maximum text length (but not maxTextHardLength).- Since:
- 3.9
-
setSecretTokenKey
void setSecretTokenKey(java.lang.String secretTokenKey)
- Since:
- 4.0
-
getRequestLimit
int getRequestLimit()
-
getTimeoutRequestLimit
int getTimeoutRequestLimit()
- Since:
- 4.0
-
getRequestLimitInBytes
int getRequestLimitInBytes()
- Since:
- 4.0
-
getRequestLimitPeriodInSeconds
int getRequestLimitPeriodInSeconds()
-
getIpFingerprintFactor
int getIpFingerprintFactor()
since 4.4
-
setMaxCheckTimeMillis
void setMaxCheckTimeMillis(int maxCheckTimeMillis)
- Parameters:
maxCheckTimeMillis
- The maximum duration allowed for a single check in milliseconds, checks that take longer will stop with an exception. Use-1
for no limit.- Since:
- 2.6
-
getMaxCheckTimeMillis
long getMaxCheckTimeMillis()
- Since:
- 2.6
-
getMaxCheckTimeWithApiKeyMillis
@Experimental long getMaxCheckTimeWithApiKeyMillis()
- Since:
- 4.2
-
getLanguageModelDir
@Nullable @Nullable java.io.File getLanguageModelDir()
Get language model directory (which contains '3grams' sub directory) ornull
.- Since:
- 2.7
-
getWord2VecModelDir
@Nullable @Nullable java.io.File getWord2VecModelDir()
Get word2vec model directory (which contains 'en' sub directories and final_embeddings.txt and dictionary.txt) ornull
.- Since:
- 4.0
-
getNeuralNetworkModelDir
public java.io.File getNeuralNetworkModelDir()
Get base directory for neural network models ornull
- Since:
- 4.4
-
getFasttextModel
@Nullable public @Nullable java.io.File getFasttextModel()
Get model path for fasttext language detection- Since:
- 4.3
-
setFasttextModel
public void setFasttextModel(java.io.File model)
Set model path for fasttext language detection- Since:
- 4.4
-
getFasttextBinary
@Nullable public @Nullable java.io.File getFasttextBinary()
Get binary path for fasttext language detection- Since:
- 4.3
-
setFasttextBinary
public void setFasttextBinary(java.io.File binary)
Set binary path for fasttext language detection- Since:
- 4.4
-
getMode
HTTPServerConfig.Mode getMode()
- Since:
- 2.7
-
setMaxCheckThreads
void setMaxCheckThreads(int maxCheckThreads)
- Parameters:
maxCheckThreads
- The maximum number of threads serving requests running at the same time. If there are more requests, they will be queued until a thread can work on them.- Since:
- 2.7
-
getMaxCheckThreads
int getMaxCheckThreads()
- Since:
- 2.7
-
setTrustXForwardForHeader
void setTrustXForwardForHeader(boolean trustXForwardForHeader)
Set totrue
if this is running behind a (reverse) proxy which sets theX-forwarded-for
HTTP header. The last IP address (but not local IP addresses) in that header will then be used for enforcing a request limitation.- Since:
- 2.8
-
getTrustXForwardForHeader
boolean getTrustXForwardForHeader()
- Since:
- 2.8
-
getMaxWorkQueueSize
int getMaxWorkQueueSize()
- Since:
- 2.9
-
isPipelineCachingEnabled
public boolean isPipelineCachingEnabled()
- Since:
- 4.4 Cache initalized JLanguageTool instances and share between non-parallel requests with identical paramenters Improves response time (especially when dealing with many small requests without specific settings), but increases memory usage
-
isPipelinePrewarmingEnabled
public boolean isPipelinePrewarmingEnabled()
- Since:
- 4.4 Before starting to listen for requests, create a few pipelines for frequently used request settings and run simple checks on them; prevents long response time / request overload on the first real incoming requests
-
getMaxPipelinePoolSize
public int getMaxPipelinePoolSize()
- Since:
- 4.4 Keep pipelines ready for this many different request settings
-
getPipelineExpireTime
public int getPipelineExpireTime()
- Since:
- 4.4 Expire pipelines for a specific request setting after this many seconds without any matching request elapsed
-
setPipelineCaching
public void setPipelineCaching(boolean pipelineCaching)
- Since:
- 4.4
-
setPipelinePrewarming
public void setPipelinePrewarming(boolean pipelinePrewarming)
- Since:
- 4.4
-
setMaxPipelinePoolSize
public void setMaxPipelinePoolSize(int maxPipelinePoolSize)
- Since:
- 4.4
-
setPipelineExpireTime
public void setPipelineExpireTime(int pipelineExpireTime)
- Since:
- 4.4
-
getCacheSize
int getCacheSize()
Cache size (in number of sentences).- Since:
- 3.7
-
setCacheSize
void setCacheSize(int sentenceCacheSize)
Set cache size (in number of sentences).- Since:
- 4.2
-
getCacheTTLSeconds
long getCacheTTLSeconds()
Cache entry TTL; refreshed on access; in seconds- Since:
- 4.6
-
setCacheTTLSeconds
void setCacheTTLSeconds(long cacheTTLSeconds)
Set cache entry TTL in seconds- Since:
- 4.6
-
getMaxErrorsPerWordRate
float getMaxErrorsPerWordRate()
Maximum errors per word rate, checking will stop if the rate is higher. For example, with a rate of 0.33, the checking would stop if the user's text has so many errors that more than every 3rd word causes a rule match. Note that this may not apply for very short texts.- Since:
- 4.0
-
getMaxSpellingSuggestions
int getMaxSpellingSuggestions()
Maximum number of spelling errors for which a suggestion will be generated per check. It makes sense to limit this as generating suggestions is a CPU-heavy task.- Since:
- 4.2
-
getBlockedReferrers
@NotNull @NotNull java.util.List<java.lang.String> getBlockedReferrers()
A list of HTTP referrers that are blocked and will only get an error message.- Since:
- 4.2
-
setBlockedReferrers
void setBlockedReferrers(java.util.List<java.lang.String> blockedReferrers)
- Since:
- 4.2
-
getHiddenMatchesServer
@Nullable @Experimental @Nullable java.lang.String getHiddenMatchesServer()
URL of server that is queried to add additional (but hidden) matches to the result.- Since:
- 4.0
-
getHiddenMatchesServerTimeout
@Experimental int getHiddenMatchesServerTimeout()
Timeout in milliseconds for queryinggetHiddenMatchesServer()
.- Since:
- 4.0
-
getHiddenMatchesServerFailTimeout
@Experimental int getHiddenMatchesServerFailTimeout()
Period to skip requests to hidden matches server after a timeout (in milliseconds)- Since:
- 4.5
-
getHiddenMatchesLanguages
@Experimental java.util.List<org.languagetool.Language> getHiddenMatchesLanguages()
Languages for whichgetHiddenMatchesServer()
will be queried.- Since:
- 4.0
-
getRulesConfigFile
@Nullable @Nullable java.io.File getRulesConfigFile()
- Returns:
- the file from which server rules configuration should be loaded, or
null
- Since:
- 3.0
-
getDatabaseDriver
@Nullable @Experimental @Nullable java.lang.String getDatabaseDriver()
- Returns:
- the database driver name like
org.mariadb.jdbc.Driver
, ornull
- Since:
- 4.2
-
setDatabaseDriver
@Experimental void setDatabaseDriver(java.lang.String dbDriver)
- Since:
- 4.2
-
getDatabaseUrl
@Nullable @Experimental @Nullable java.lang.String getDatabaseUrl()
- Returns:
- the database url like
jdbc:mysql://localhost:3306/languagetool
, ornull
- Since:
- 4.2
-
setDatabaseUrl
@Experimental void setDatabaseUrl(java.lang.String dbUrl)
- Since:
- 4.2
-
getDatabaseUsername
@Nullable @Experimental @Nullable java.lang.String getDatabaseUsername()
- Returns:
- the database username, or
null
- Since:
- 4.2
-
setDatabaseUsername
@Experimental void setDatabaseUsername(java.lang.String dbUsername)
- Since:
- 4.2
-
getDatabasePassword
@Nullable @Experimental @Nullable java.lang.String getDatabasePassword()
- Returns:
- the database password matching
getDatabaseUsername()
, ornull
- Since:
- 4.2
-
setDatabasePassword
@Experimental void setDatabasePassword(java.lang.String dbPassword)
- Since:
- 4.2
-
setDatabaseLogging
@Experimental void setDatabaseLogging(boolean logging)
Whether meta data about each search (like in the logfile) should be logged to the database.- Since:
- 4.4
-
getDatabaseLogging
@Experimental boolean getDatabaseLogging()
- Since:
- 4.4
-
isPrometheusMonitoring
public boolean isPrometheusMonitoring()
- Returns:
- Since:
- 4.6
-
getPrometheusPort
public int getPrometheusPort()
- Returns:
- Since:
- 4.6
-
getSlowRuleLoggingThreshold
@Experimental public int getSlowRuleLoggingThreshold()
- Returns:
- threshold for rule computation time until a warning gets logged, in milliseconds
- Since:
- 4.5
-
isSkipLoggingRuleMatches
boolean isSkipLoggingRuleMatches()
- Since:
- 4.5
-
isSkipLoggingChecks
public boolean isSkipLoggingChecks()
- Since:
- 4.6
-
getDisabledRuleIds
public java.util.List<java.lang.String> getDisabledRuleIds()
- Since:
- 4.7
-
getAbTest
@Experimental @Nullable public @Nullable java.lang.String getAbTest()
- Since:
- 4.4 See if a specific A/B-Test is to be run
-
setAbTest
@Experimental public void setAbTest(@Nullable @Nullable java.lang.String abTest)
- Since:
- 4.4 Enable a specific A/B-Test to be run (or null to disable all tests)
-
getProperty
protected java.lang.String getProperty(java.util.Properties props, java.lang.String propertyName, java.io.File config)
- Throws:
IllegalConfigurationException
- if property is not set
-
getOptionalProperty
protected java.lang.String getOptionalProperty(java.util.Properties props, java.lang.String propertyName, java.lang.String defaultValue)
-
-