Class FCConfig
java.lang.Object
org.frontcache.FCConfig
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddestroy()Bare bot user-agent keywords from conf/bots.conf.static InputStreamgetConfigInputStream(String name) 1.URL patterns that are never cached, from conf/dynamic-urls.conf.static Propertiesstatic StringgetProperty(String key) static StringgetProperty(String key, String defaultValue) static FilegetWritableConfigFile(String name) The file under FRONTCACHE_HOME/conf a management write should target, or null when this node has no conf directory on disk at all.static intRe-reads conf/dynamic-urls.conf.static voidsetProperty(String key, String value)
-
Field Details
-
FRONT_CACHE_HOME_SYSTEM_KEY
- See Also:
-
FRONT_CACHE_HOME_ENVIRONMENT_KEY
- See Also:
-
FRONTCACHE_ID_KEY
- See Also:
-
DEFAULT_FRONTCACHE_ID
- See Also:
-
DEFAULT_DOMAIN
- See Also:
-
-
Constructor Details
-
FCConfig
public FCConfig()
-
-
Method Details
-
getBotUserAgentKeywords
Bare bot user-agent keywords from conf/bots.conf. One node serves one site, so there is one set. conf/bots.conf holds classification RULES as well as bare keywords as of 2.9.0, andBotClassifieris its only reader - this delegates rather than parsing the file a second time, because two readers of one config file is how a console ends up reporting something the engine is not doing. -
destroy
public static void destroy() -
getProperty
-
getProperty
-
setProperty
-
getProperties
- Returns:
-
getWritableConfigFile
The file under FRONTCACHE_HOME/conf a management write should target, or null when this node has no conf directory on disk at all. Null means refuse the write, not pick somewhere else.getConfigInputStream(String)falls back to the classpath, so the file the console DISPLAYS may not be a file on disk - it can come from inside the war. There is then nothing to write, and inventing a location is worse than saying so. The returned file need not exist: a conf directory with no guard-rules.conf in it is the normal state of a node that has never used guard rules, and creating that file is exactly what an operator adding their first rule is asking for. The caller reports the creation - seeFrontCacheIOServlet.setConfig. -
getConfigInputStream
1. get input stream from inside jars (/frontcache.properties) 2. get input stream from system variable frontcache.home 3. get input stream from environment variable FRONTCACHE_HOME/conf/frontcache.properties- Parameters:
name-- Returns:
-
reloadDynamicURLs
public static int reloadDynamicURLs()Re-reads conf/dynamic-urls.conf. Called by thereload-dynamic-urlsmanagement action. This file had no live reload before. It is read byinit(), whose only caller is this class's static initializer - the call inFrontCacheEngine.getFrontCache()is commented out - soFrontCacheEngine.reload()does not re-read it either, and adding a URL pattern meant restarting the node.- Returns:
- how many patterns are now active
-
getDynamicURLs
-
getDynamicURLPatterns
-