Class WarmerActions
java.lang.Object
org.frontcache.io.WarmerActions
The cache warmer's management actions, with no HttpServletRequest in sight - the
ConfigWriteAction arrangement, for the same reason: the gates are what matter here, and they
are testable without a servlet container. FrontCacheIOServlet does the parameter extraction
and the ApiKey verdict.
The gates, in order
front-cache.warmer.enabled=falserefuses everything exceptwarmer-statusandwarmer-lists;- everything that starts, changes or writes needs
ApiKey.isAuthorizedToWrite- a configured API key, whereisAuthorizedlets an un-keyed node through; front-cache.warmer.list-write=falserefuses the list-writing actions only. That is the setting for a fleet whose warmer/ is deployed from git or an image, and it is separate fromfront-cache.management.config-writeon purpose: such a fleet commonly locks its config and still wants to upload a list.
-
Method Summary
Modifier and TypeMethodDescriptionstatic WarmerListActionResponsedeleteList(CacheWarmer warmer, String name, boolean authorizedToWrite) static WarmerListActionResponsegetList(CacheWarmer warmer, String name, String grep) static WarmerListsActionResponselists(CacheWarmer warmer) static StringloopbackTarget(WarmerConfig config, int localPort) Where warm requests go:front-cache.warmer.loopback-urlif it is set, otherwisehttp://127.0.0.1:<the local port the management request arrived on>- the connector the management API was reached on, which in every shipped topology is the one traffic uses.static WarmerStatusActionResponsepause(CacheWarmer warmer, boolean authorizedToWrite) preflight(CacheWarmer warmer, WarmerRunParams params, boolean requestSecure, int localPort, CacheProcessor processor) static WarmerListActionResponseputList(CacheWarmer warmer, String name, InputStream body, String baseHash, boolean authorizedToWrite) static StringrawListProblem(CacheWarmer warmer, String name) static WarmerStatusActionResponseresume(CacheWarmer warmer, boolean authorizedToWrite) static WarmerStatusActionResponsestart(CacheWarmer warmer, WarmerRunParams params, boolean requestSecure, int localPort, boolean authorizedToWrite) static WarmerStatusActionResponsestatus(CacheWarmer warmer) static WarmerStatusActionResponsestop(CacheWarmer warmer, boolean authorizedToWrite) static WarmerStatusActionResponseupdate(CacheWarmer warmer, Long delayMs, Integer concurrency, boolean authorizedToWrite) static ActionResponsewithRequestDefaults(ActionResponse response, WarmerConfig config, boolean requestSecure) Sets the default key base a status response offers the Run form to the one this request implies.
-
Method Details
-
loopbackTarget
Where warm requests go:front-cache.warmer.loopback-urlif it is set, otherwisehttp://127.0.0.1:<the local port the management request arrived on>- the connector the management API was reached on, which in every shipped topology is the one traffic uses.front-cache.http-portis not a candidate: it is the PUBLIC port used to build redirects, and the bundled config sets it to 80 while Jetty listens on 9080. Alwayshttpunless configured. The management request'sisSecure()is NOT the connector's scheme: the bundled Jetty honoursX-Forwarded-Proto, so behind a TLS-terminating nginx it reads true on a plain-HTTP socket, and deriving the scheme from it sent a TLS handshake to 127.0.0.1:9080 - "Unsupported or unrecognized SSL message" on every entry. The key's scheme does not depend on the loopback's any more; seeLoopbackWarmTransport. -
withRequestDefaults
public static ActionResponse withRequestDefaults(ActionResponse response, WarmerConfig config, boolean requestSecure) Sets the default key base a status response offers the Run form to the one this request implies. The warmer's own status cannot know it: the default's scheme is a property of the management request, not of the warmer. -
status
-
lists
-
getList
-
rawListProblem
- Returns:
- null when
namemay be streamed as a download, otherwise why not
-
putList
public static WarmerListActionResponse putList(CacheWarmer warmer, String name, InputStream body, String baseHash, boolean authorizedToWrite) - Parameters:
body- the list, streamed - never buffered whole
-
deleteList
public static WarmerListActionResponse deleteList(CacheWarmer warmer, String name, boolean authorizedToWrite) -
preflight
public static WarmerPreflightActionResponse preflight(CacheWarmer warmer, WarmerRunParams params, boolean requestSecure, int localPort, CacheProcessor processor) -
start
public static WarmerStatusActionResponse start(CacheWarmer warmer, WarmerRunParams params, boolean requestSecure, int localPort, boolean authorizedToWrite) -
update
public static WarmerStatusActionResponse update(CacheWarmer warmer, Long delayMs, Integer concurrency, boolean authorizedToWrite) -
pause
-
resume
-
stop
-