Interface RouteGroup.RouteMounter
- 
- Enclosing interface:
- RouteGroup
 
 public static interface RouteGroup.RouteMounter
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default RouteGroup.RouteMountercache(long time, java.util.concurrent.TimeUnit timeUnit)Enables caching.RouteGroup.RouteMountercache(long time, java.util.concurrent.TimeUnit timeUnit, RouteGroup.CacheKeyGen keyGen)Enables caching.RouteGroup.RouteMounterconcurrency(int concurrencyLimit, int waitTime)Sets the maximum number of concurrent instances of this route that may be handled at one time.RouteGroup.RouteMountergzip()Delegates togzip(boolean)with a param of falseRouteGroup.RouteMountergzip(boolean withContentLength)Will encode the result in a gzip output stream if the incoming request specifies that it accepts gzip in the Accept-Encoding header.RouteGroup.RouteMounterhandler(RouteHandler handler)The handler that fetches the information from this route.RouteGroup.RouteMountermethod(HttpMethod method)The HTTP method that triggers this route.voidmount()Call this at the end to mount the routeRouteGroup.RouteMounternocache()Will set the `Cache-Control: no-cache, no-store` header on the response.RouteGroup.RouteMounterrenderer(ResponseRenderer renderer)An optional renderer that will transform the model result of the RouteHandler into a body stringRouteGroup.RouteMounterrestrict(RouteAccessControl accessControl)An optional access control object that can require security for this routeRouteGroup.RouteMountertype(java.lang.String contentType)The content type of the response.
 
- 
- 
- 
Method Detail- 
methodRouteGroup.RouteMounter method(HttpMethod method) The HTTP method that triggers this route. Default is GET
 - 
typeRouteGroup.RouteMounter type(java.lang.String contentType) The content type of the response. Default is "text/plain"
 - 
handlerRouteGroup.RouteMounter handler(RouteHandler handler) The handler that fetches the information from this route.
 - 
rendererRouteGroup.RouteMounter renderer(ResponseRenderer renderer) An optional renderer that will transform the model result of the RouteHandler into a body string
 - 
restrictRouteGroup.RouteMounter restrict(RouteAccessControl accessControl) An optional access control object that can require security for this route
 - 
concurrencyRouteGroup.RouteMounter concurrency(int concurrencyLimit, int waitTime) Sets the maximum number of concurrent instances of this route that may be handled at one time. Additional incoming requests will receive an HTTP 503. Default setting is count=5, wait=2000ms- Parameters:
- concurrencyLimit- Number of concurrent instances allowed to be executing at a time
- waitTime- Amount of time, in milliseconds, to wait for a slot to become available before a 503
 
 - 
cachedefault RouteGroup.RouteMounter cache(long time, java.util.concurrent.TimeUnit timeUnit) Enables caching. This version assumes that the route does not look at any arguments (i.e. the route's return value does not depend on any arguments, and so only a single value needs to be cached.)- Parameters:
- time- Amount of time for items in the cache to be held. Not a guarantee, as values will be soft.
- timeUnit- unit for the time argument.
 
 - 
cacheRouteGroup.RouteMounter cache(long time, java.util.concurrent.TimeUnit timeUnit, RouteGroup.CacheKeyGen keyGen) Enables caching. This version takes a CacheKeyGen, which should calculate a hashable key representing the set of params that make each request unique so that cached values can be cached based on keys. Consider using something likeMultikeyfor this purpose.
 - 
nocacheRouteGroup.RouteMounter nocache() Will set the `Cache-Control: no-cache, no-store` header on the response. Will also set the `Pragma: no-cache` header on the response for HTTP/1.0 backwards-compatibility.
 - 
gzipRouteGroup.RouteMounter gzip() Delegates togzip(boolean)with a param of false
 - 
gzipRouteGroup.RouteMounter gzip(boolean withContentLength) Will encode the result in a gzip output stream if the incoming request specifies that it accepts gzip in the Accept-Encoding header.- Parameters:
- withContentLength- if true, the response will include the Content-Length header with the length of the gzipped response. if false, the content length will not be calculated and the length will be indeterminate from the client's perspective
 
 - 
mountvoid mount() Call this at the end to mount the route
 
- 
 
-