Package org.languagetool.server
Class HTTPServerConfig
java.lang.Object
org.languagetool.server.HTTPServerConfig
- Direct Known Subclasses:
HTTPSServerConfig
- Since:
- 2.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Patternprotected intprotected String(package private) booleanprotected intprotected longprotected intprotected intprotected intprotected Stringprotected booleanprotected intprotected Stringprotected longprotected Stringprotected Stringstatic final Stringstatic final intThe default port on which the server is running (8081).protected booleanprotected intprotected intprotected Fileprotected Fileprotected GlobalConfigprotected booleanprotected int(package private) static final Stringprotected Fileprotected booleanprivate static final org.slf4j.Loggerprotected booleanprotected Stringprotected intprotected longprotected longprotected longprotected floatprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected HTTPServerConfig.Modeprotected Stringprotected Fileprotected Stringprotected booleanprotected intprotected booleanprotected intprotected booleanprotected booleanprotected booleanprotected intprotected booleanprotected Stringprotected longprotected intprotected longprotected Stringcaching to avoid database hits for e.g.protected Stringprotected Stringprotected Stringprotected intprotected longprotected booleanprotected booleanprotected Fileprotected intprotected Stringprotected intprotected intprotected intprotected booleanprotected Fileprotected Fileprotected Stringprotected Stringprotected Stringprotected intprotected URIprotected booleanprotected booleanprotected intprotected booleanprotected intprotected intprotected intprotected intprotected Patternprotected booleanprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionCreate a server configuration for the default port (DEFAULT_PORT).HTTPServerConfig(int serverPort) HTTPServerConfig(int serverPort, boolean verbose) HTTPServerConfig(String[] args) Parse command line options. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddDynamicLanguages(Properties props) Clients that a A/B test runs on; null -> disabledintValue to set as the "Access-Control-Allow-Origin" http header.A list of HTTP referrers that are blocked and will only get an error message.(package private) intCache size (in number of sentences).(package private) longCache entry TTL; refreshed on access; in secondsintNumber of seconds to skip database requests when a potential downtime has been detected(package private) StringintRate in percent of requests (0-100) of errors during database queries until circuit breaker opens(package private) boolean(package private) StringintRate in percent of requests (0-100) of timeouts during database queries until circuit breaker opens(package private) String(package private) Stringintlongtimeout for database requests (for now, only requests for credentials to log in)booleanintintGet binary path for fasttext language detectionGet model path for fasttext language detectionbooleanWhether requests with credentials should be treated as anonymous requests in case of DB errors/timeout or throw an error(package private) intsince 4.4(package private) FileGet language model directory (which contains '3grams' sub directory) ornull.(package private) int(package private) long(package private) long(package private) long(package private) floatMaximum errors per word rate, checking will stop if the rate is higher.intint(package private) intMaximum number of spelling errors for which a suggestion will be generated per check.(package private) int(package private) intLimit for maximum text length - text cannot be longer than this, even if user has valid secret token.(package private) int(package private) intFor users that have an account, but no premium subscription(package private) int(package private) intint(package private) HTTPServerConfig.ModegetMode()protected StringgetOptionalProperty(Properties props, String propertyName, String defaultValue) intintgetPort()intprotected StringgetProperty(Properties props, String propertyName, File config) longTimeout for establishing the initial connection, including e.g.intlongintlongTimeout for regular commands(package private) File(package private) int(package private) int(package private) intint(package private) Fileintintintintint(package private) int(package private) booleanbooleanbooleanbooleanboolean(package private) booleanbooleanbooleanbooleanbooleanAllow using redis sentinel for automated failoverbooleanbooleanboolean(package private) boolean(package private) booleanWhether the server can be stopped by sending a command (useful for tests only).booleanprivate voidparseConfigFile(File file, boolean loadLangModel) voidvoidsetAbTestClients(String pattern) Clients that a A/B test runs on; null -> disabledvoidsetAbTestRollout(int abTestRollout) voidsetAllowOriginUrl(String allowOriginUrl) (package private) voidsetBlockedReferrers(List<String> blockedReferrers) (package private) voidsetCacheSize(int sentenceCacheSize) Set cache size (in number of sentences).(package private) voidsetCacheTTLSeconds(long cacheTTLSeconds) Set cache entry TTL in secondsvoidsetDatabaseDownIntervalSeconds(int databaseDownIntervalSeconds) (package private) voidsetDatabaseDriver(String dbDriver) voidsetDatabaseErrorRateThreshold(int databaseErrorRateThreshold) (package private) voidsetDatabaseLogging(boolean logging) Whether meta data about each search (like in the logfile) should be logged to the database.(package private) voidsetDatabasePassword(String dbPassword) voidsetDatabaseTimeoutRateThreshold(int databaseTimeoutRateThreshold) (package private) voidsetDatabaseUrl(String dbUrl) (package private) voidsetDatabaseUsername(String dbUsername) voidsetDbMaxConnections(int dbMaxConnections) voidsetDbTimeoutSeconds(long dbTimeoutSeconds) timeout for database requests (for now, only requests for credentials to log in)voidsetDefaultThirdPartyAI(boolean defaultThirdPartyAI) voidsetFasttextBinary(File binary) Set binary path for fasttext language detectionvoidsetFasttextModel(File model) Set model path for fasttext language detection(package private) voidsetFasttextPaths(String fasttextModelPath, String fasttextBinaryPath) voidsetGracefulDatabaseFailure(boolean gracefulDatabaseFailure) Whether requests with credentials should be treated as anonymous requests in case of DB errors/timeout or throw an errorvoidsetLanguageModelDirectory(String langModelDir) (package private) voidsetMaxCheckThreads(int maxCheckThreads) (package private) voidsetMaxCheckTimeMillisAnonymous(int maxCheckTimeMillis) (package private) voidsetMaxCheckTimeMillisLoggedIn(int maxCheckTimeMillis) (package private) voidsetMaxCheckTimeMillisPremium(int maxCheckTimeMillis) voidsetMaxPipelinePoolSize(int maxPipelinePoolSize) (package private) voidsetMaxTextCheckerThreads(int maxTextCheckerThreads) voidsetMaxTextHardLength(int len) voidsetMaxTextLengthAnonymous(int len) voidsetMaxTextLengthLoggedIn(int len) voidsetMaxTextLengthPremium(int len) voidsetNgramLangIdentData(File ngramLangIdentData) voidsetPipelineCaching(boolean pipelineCaching) voidsetPipelineExpireTime(int pipelineExpireTime) voidsetPipelinePrewarming(boolean pipelinePrewarming) (package private) voidsetPremiumAlways(boolean premiumAlways) voidsetPremiumOnly(boolean premiumOnly) voidsetRedisCertificate(String redisCertificate) voidsetRedisKey(String redisKey) voidsetRedisKeyPassword(String redisKeyPassword) voidsetRedisUseSentinel(boolean redisUseSentinel) voidsetRequestLimit(int requestLimit) voidsetRequestLimitAccessToken(String requestLimitAccessToken) voidsetRequestLimitPeriodInSeconds(int requestLimitPeriodInSeconds) voidsetRequestLimitWhitelistLimit(int requestLimitWhitelistLimit) voidsetRequestLimitWhitelistUsers(List<String> requestLimitWhitelistUsers) voidsetRestrictManagedAccounts(boolean restrictManagedAccounts) voidsetSentinelHost(String sentinelHost) voidsetSentinelMasterId(String sentinelMasterId) voidsetSentinelPassword(String sentinelPassword) voidsetSentinelPort(int sentinelPort) voidsetServerURL(String url) voidsetTextCheckerQueueSize(int textCheckerQueueSize) voidsetTrustedSources(String pattern) (package private) voidsetTrustXForwardForHeader(boolean trustXForwardForHeader) Set totrueif this is running behind a (reverse) proxy which sets theX-forwarded-forHTTP header.
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
DEFAULT_HOST
- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORTThe default port on which the server is running (8081).- See Also:
-
LANGUAGE_MODEL_OPTION
- See Also:
-
verbose
protected boolean verbose -
publicAccess
protected boolean publicAccess -
port
protected int port -
minPort
protected int minPort -
maxPort
protected int maxPort -
allowOriginUrl
-
logIp
protected boolean logIp -
logIpMatchingPattern
-
serverURL
-
maxTextLengthAnonymous
protected int maxTextLengthAnonymous -
maxTextLengthLoggedIn
protected int maxTextLengthLoggedIn -
maxTextLengthPremium
protected int maxTextLengthPremium -
maxTextHardLength
protected int maxTextHardLength -
maxCheckTimeMillisAnonymous
protected long maxCheckTimeMillisAnonymous -
maxCheckTimeMillisLoggedIn
protected long maxCheckTimeMillisLoggedIn -
maxCheckTimeMillisPremium
protected long maxCheckTimeMillisPremium -
maxCheckThreads
protected int maxCheckThreads -
maxTextCheckerThreads
protected int maxTextCheckerThreads -
textCheckerQueueSize
protected int textCheckerQueueSize -
mode
-
languageModelDir
-
ruleIdToConfidenceFile
-
pipelineCaching
protected boolean pipelineCaching -
pipelinePrewarming
protected boolean pipelinePrewarming -
maxPipelinePoolSize
protected int maxPipelinePoolSize -
pipelineExpireTime
protected int pipelineExpireTime -
fasttextModel
-
fasttextBinary
-
requestLimit
protected int requestLimit -
requestLimitInBytes
protected int requestLimitInBytes -
timeoutRequestLimit
protected int timeoutRequestLimit -
requestLimitPeriodInSeconds
protected int requestLimitPeriodInSeconds -
requestLimitWhitelistUsers
-
requestLimitWhitelistLimit
protected int requestLimitWhitelistLimit -
ipFingerprintFactor
protected int ipFingerprintFactor -
trustXForwardForHeader
protected boolean trustXForwardForHeader -
maxWorkQueueSize
protected int maxWorkQueueSize -
rulesConfigFile
-
remoteRulesConfigFile
-
cacheSize
protected int cacheSize -
cacheTTLSeconds
protected long cacheTTLSeconds -
maxErrorsPerWordRate
protected float maxErrorsPerWordRate -
maxSpellingSuggestions
protected int maxSpellingSuggestions -
blockedReferrers
-
trustedSources
-
requestLimitAccessToken
-
defaultThirdPartyAI
protected boolean defaultThirdPartyAI -
anonymousAccessAllowed
boolean anonymousAccessAllowed -
gracefulDatabaseFailure
protected boolean gracefulDatabaseFailure -
restrictManagedAccounts
protected boolean restrictManagedAccounts -
dbDriver
-
dbUrl
-
dbUsername
-
dbPassword
-
dbTimeoutSeconds
protected long dbTimeoutSeconds -
dbMaxConnections
protected int dbMaxConnections -
databaseTimeoutRateThreshold
protected int databaseTimeoutRateThreshold -
databaseErrorRateThreshold
protected int databaseErrorRateThreshold -
databaseDownIntervalSeconds
protected int databaseDownIntervalSeconds -
dbLogging
protected boolean dbLogging -
prometheusMonitoring
protected boolean prometheusMonitoring -
prometheusPort
protected int prometheusPort -
globalConfig
-
disabledRuleIds
-
stoppable
protected boolean stoppable -
passwortLoginAccessListPath
-
redisHost
caching to avoid database hits for e.g. dictionaries null -> disabled -
redisPort
protected int redisPort -
redisDatabase
protected int redisDatabase -
redisUseSSL
protected boolean redisUseSSL -
redisCertificate
-
redisKey
-
redisKeyPassword
-
redisPassword
-
redisDictTTL
protected long redisDictTTL -
redisTimeout
protected long redisTimeout -
redisConnectionTimeout
protected long redisConnectionTimeout -
redisUseSentinel
protected boolean redisUseSentinel -
sentinelHost
-
sentinelPort
protected int sentinelPort -
sentinelPassword
-
sentinelMasterId
-
skipLoggingRuleMatches
protected boolean skipLoggingRuleMatches -
skipLoggingChecks
protected boolean skipLoggingChecks -
slowRuleLoggingThreshold
protected int slowRuleLoggingThreshold -
abTest
-
abTestClients
-
abTestRollout
protected int abTestRollout -
ngramLangIdentData
-
localApiMode
protected boolean localApiMode -
motherTongue
-
preferredLanguages
-
dictLimitUser
protected int dictLimitUser -
dictLimitTeam
protected int dictLimitTeam -
styleGuideLimitUser
protected int styleGuideLimitUser -
styleGuideLimitTeam
protected int styleGuideLimitTeam -
KNOWN_OPTION_KEYS
-
-
Constructor Details
-
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 totrue, the input text will be logged in case there is an exception
-
HTTPServerConfig
HTTPServerConfig(String[] args) Parse command line options.
-
-
Method Details
-
setPremiumOnly
public void setPremiumOnly(boolean premiumOnly) -
isAnonymousAccessAllowed
public boolean isAnonymousAccessAllowed() -
isRestrictManagedAccounts
public boolean isRestrictManagedAccounts()- Returns:
- whether user creation should be restricted (e.g. according to subscriptions in cloud usage) or be unlimited (for self-hosted installations)
- Since:
- 4.9
-
setRestrictManagedAccounts
public void setRestrictManagedAccounts(boolean restrictManagedAccounts) -
parseConfigFile
-
addDynamicLanguages
- Throws:
IOException
-
setLanguageModelDirectory
-
setFasttextPaths
-
isVerbose
public boolean isVerbose() -
isPublicAccess
public boolean isPublicAccess() -
getPort
public int getPort() -
getMinPort
public int getMinPort() -
getMaxPort
public int getMaxPort() -
getAllowOriginUrl
Value to set as the "Access-Control-Allow-Origin" http header.nullwill 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
- Since:
- 4.2
-
getServerURL
- Returns:
- prefix / base URL for API requests
- Since:
- 4.8
-
setServerURL
- Parameters:
url- prefix / base URL for API requests- Since:
- 4.8
-
setMaxTextLengthAnonymous
public void setMaxTextLengthAnonymous(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 an API key
-
setMaxTextLengthLoggedIn
public void setMaxTextLengthLoggedIn(int len) -
setMaxTextLengthPremium
public void setMaxTextLengthPremium(int len) -
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 an API key- Since:
- 3.9
-
getMaxTextLengthAnonymous
int getMaxTextLengthAnonymous() -
getMaxTextLengthLoggedIn
int getMaxTextLengthLoggedIn()For users that have an account, but no premium subscription -
getMaxTextLengthPremium
int getMaxTextLengthPremium() -
getMaxTextHardLength
int getMaxTextHardLength()Limit for maximum text length - text cannot be longer than this, even if user has valid secret token.- Since:
- 3.9
-
getRequestLimitWhitelistUsers
- Since:
- 5.3 use a higher request limit for a list of users
-
setRequestLimitWhitelistUsers
-
getRequestLimitWhitelistLimit
public int getRequestLimitWhitelistLimit()- Since:
- 5.3 use a higher request limit for a list of users
-
setRequestLimitWhitelistLimit
public void setRequestLimitWhitelistLimit(int requestLimitWhitelistLimit) -
getRequestLimit
int getRequestLimit() -
getTimeoutRequestLimit
int getTimeoutRequestLimit()- Since:
- 4.0
-
getRequestLimitInBytes
int getRequestLimitInBytes()- Since:
- 4.0
-
getRequestLimitPeriodInSeconds
int getRequestLimitPeriodInSeconds() -
setRequestLimit
public void setRequestLimit(int requestLimit) - Since:
- 6.3
-
setRequestLimitPeriodInSeconds
public void setRequestLimitPeriodInSeconds(int requestLimitPeriodInSeconds) - Since:
- 6.3
-
getRequestLimitAccessToken
- Since:
- 6.3 Can configure a secret value for the Header X-Request-Limit-Access-Token that allows skipping limtis
-
setRequestLimitAccessToken
- Since:
- 6.3
-
getIpFingerprintFactor
int getIpFingerprintFactor()since 4.4- Returns:
- if > 0: allow n more requests per IP if fingerprints differ if invalid input: '<'= 0: disable fingerprinting, only rely on IP address
-
setMaxCheckTimeMillisAnonymous
void setMaxCheckTimeMillisAnonymous(int maxCheckTimeMillis) - Parameters:
maxCheckTimeMillis- The maximum duration allowed for a single check in milliseconds, checks that take longer will stop with an exception. Use-1for no limit.- Since:
- 4.4
-
getMaxCheckTimeMillisAnonymous
long getMaxCheckTimeMillisAnonymous()- Since:
- 4.4
-
setMaxCheckTimeMillisLoggedIn
void setMaxCheckTimeMillisLoggedIn(int maxCheckTimeMillis) - Since:
- 4.4
-
getMaxCheckTimeMillisLoggedIn
long getMaxCheckTimeMillisLoggedIn()- Since:
- 4.4
-
setMaxCheckTimeMillisPremium
void setMaxCheckTimeMillisPremium(int maxCheckTimeMillis) - Since:
- 4.4
-
getMaxCheckTimeMillisPremium
- Since:
- 4.4
-
getLanguageModelDir
Get language model directory (which contains '3grams' sub directory) ornull.- Since:
- 2.7
-
getFasttextModel
Get model path for fasttext language detection- Since:
- 4.3
-
setFasttextModel
Set model path for fasttext language detection- Since:
- 4.4
-
getFasttextBinary
Get binary path for fasttext language detection- Since:
- 4.3
-
setFasttextBinary
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
-
setMaxTextCheckerThreads
void setMaxTextCheckerThreads(int maxTextCheckerThreads) - Parameters:
maxTextCheckerThreads- The maximum number of threads in the worker pool processing text checks running at the same time.- Since:
- 5.6
-
getMaxTextCheckerThreads
int getMaxTextCheckerThreads()- Since:
- 5.6
-
getTextCheckerQueueSize
public int getTextCheckerQueueSize() -
setTextCheckerQueueSize
public void setTextCheckerQueueSize(int textCheckerQueueSize) -
setTrustXForwardForHeader
void setTrustXForwardForHeader(boolean trustXForwardForHeader) Set totrueif this is running behind a (reverse) proxy which sets theX-forwarded-forHTTP 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 initialized JLanguageTool instances and share between non-parallel requests with identical parameters. 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
A list of HTTP referrers that are blocked and will only get an error message.- Since:
- 4.2
-
setBlockedReferrers
- Since:
- 4.2
-
getTrustedSources
-
setTrustedSources
-
getRulesConfigFile
- Returns:
- the file from which server rules configuration should be loaded, or
null - Since:
- 3.0
-
getRemoteRulesConfigFile
- Returns:
- the file from which remote rules should be configured, or
null - Since:
- 4.9
-
getDatabaseDriver
- Returns:
- the database driver name like
org.mariadb.jdbc.Driver, ornull - Since:
- 4.2
-
setDatabaseDriver
- Since:
- 4.2
-
getDatabaseUrl
- Returns:
- the database url like
jdbc:mysql://localhost:3306/languagetool, ornull - Since:
- 4.2
-
setDatabaseUrl
- Since:
- 4.2
-
getDatabaseUsername
- Returns:
- the database username, or
null - Since:
- 4.2
-
setDatabaseUsername
- Since:
- 4.2
-
getDatabasePassword
- Returns:
- the database password matching
getDatabaseUsername(), ornull - Since:
- 4.2
-
setDatabasePassword
- Since:
- 4.2
-
setDatabaseLogging
void setDatabaseLogging(boolean logging) Whether meta data about each search (like in the logfile) should be logged to the database.- Since:
- 4.4
-
getDatabaseLogging
boolean getDatabaseLogging()- Since:
- 4.4
-
getDbTimeoutSeconds
public long getDbTimeoutSeconds()timeout for database requests (for now, only requests for credentials to log in)- Since:
- 4.7
-
setDbTimeoutSeconds
public void setDbTimeoutSeconds(long dbTimeoutSeconds) timeout for database requests (for now, only requests for credentials to log in)- Since:
- 4.7
-
getDatabaseTimeoutRateThreshold
public int getDatabaseTimeoutRateThreshold()Rate in percent of requests (0-100) of timeouts during database queries until circuit breaker opens- Since:
- 5.5
-
setDatabaseTimeoutRateThreshold
public void setDatabaseTimeoutRateThreshold(int databaseTimeoutRateThreshold) -
getDatabaseErrorRateThreshold
public int getDatabaseErrorRateThreshold()Rate in percent of requests (0-100) of errors during database queries until circuit breaker opens- Since:
- 5.5
-
setDatabaseErrorRateThreshold
public void setDatabaseErrorRateThreshold(int databaseErrorRateThreshold) -
getDatabaseDownIntervalSeconds
public int getDatabaseDownIntervalSeconds()Number of seconds to skip database requests when a potential downtime has been detected- Since:
- 5.5
-
setDatabaseDownIntervalSeconds
public void setDatabaseDownIntervalSeconds(int databaseDownIntervalSeconds) -
getGracefulDatabaseFailure
public boolean getGracefulDatabaseFailure()Whether requests with credentials should be treated as anonymous requests in case of DB errors/timeout or throw an error- Since:
- 4.7
-
setGracefulDatabaseFailure
public void setGracefulDatabaseFailure(boolean gracefulDatabaseFailure) Whether requests with credentials should be treated as anonymous requests in case of DB errors/timeout or throw an error- Since:
- 4.7
-
isPrometheusMonitoring
public boolean isPrometheusMonitoring()- Since:
- 4.6
-
getPrometheusPort
public int getPrometheusPort()- Since:
- 4.6
-
getRedisHost
-
getRedisPort
public int getRedisPort() -
getRedisDatabase
public int getRedisDatabase() -
isRedisUseSSL
public boolean isRedisUseSSL() -
getRedisPassword
-
getRedisDictTTLSeconds
public long getRedisDictTTLSeconds() -
getRedisTimeoutMilliseconds
public long getRedisTimeoutMilliseconds()Timeout for regular commands- Returns:
-
getRedisConnectionMilliseconds
public long getRedisConnectionMilliseconds()Timeout for establishing the initial connection, including e.g. SSL handshake and commands like SENTINEL, ... -
getSlowRuleLoggingThreshold
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
- Since:
- 4.7
-
isStoppable
boolean isStoppable()Whether the server can be stopped by sending a command (useful for tests only). -
getAbTest
- Since:
- 4.4 Get a list of active A/B-Tests
-
setAbTest
- Since:
- 4.4 Enable A/B-Tests to be run (comma seperated for a list or null to disable all tests)
-
getAbTestClients
Clients that a A/B test runs on; null -> disabled- Since:
- 4.9
-
setAbTestClients
Clients that a A/B test runs on; null -> disabled- Since:
- 4.9
-
setAbTestRollout
- Parameters:
abTestRollout- percentage [0,100] of users to include in ab test rollout- Since:
- 4.9
-
getAbTestRollout
- Since:
- 4.9
-
setNgramLangIdentData
- Since:
- 5.2
-
getNgramLangIdentData
- Since:
- 5.2
-
getProperty
- Throws:
IllegalConfigurationException- if property is not set
-
getOptionalProperty
-
isPremiumAlways
boolean isPremiumAlways()- Since:
- 5.1
-
setPremiumAlways
void setPremiumAlways(boolean premiumAlways) - Since:
- 5.1
-
isPremiumOnly
public boolean isPremiumOnly() -
isRedisUseSentinel
public boolean isRedisUseSentinel()Allow using redis sentinel for automated failover -
setRedisUseSentinel
public void setRedisUseSentinel(boolean redisUseSentinel) -
getSentinelHost
-
setSentinelHost
-
getSentinelPort
public int getSentinelPort() -
setSentinelPort
public void setSentinelPort(int sentinelPort) -
getSentinelPassword
-
setSentinelPassword
-
getSentinelMasterId
-
setSentinelMasterId
-
getRedisCertificate
-
setRedisCertificate
-
getRedisKey
-
setRedisKey
-
getRedisKeyPassword
-
setRedisKeyPassword
-
getPasswortLoginAccessListPath
-
isLocalApiMode
public boolean isLocalApiMode() -
getMotherTongue
-
getPreferedLanguages
-
getDictLimitUser
public int getDictLimitUser() -
getDictLimitTeam
public int getDictLimitTeam() -
getStyleGuideLimitUser
public int getStyleGuideLimitUser() -
getStyleGuideLimitTeam
public int getStyleGuideLimitTeam() -
getDbMaxConnections
public int getDbMaxConnections()- Returns:
- max number of active connections in DB connection pool
- Since:
- 6.2
-
setDbMaxConnections
public void setDbMaxConnections(int dbMaxConnections) - Parameters:
dbMaxConnections- max number of active connections in DB connection pool- Since:
- 6.2
-
getRuleIdToConfidenceFile
- Since:
- 6.4
-
getDefaultThirdPartyAI
public boolean getDefaultThirdPartyAI() -
setDefaultThirdPartyAI
public void setDefaultThirdPartyAI(boolean defaultThirdPartyAI)
-