public interface IRouteBuilder<R extends IRequestContext<?>>
| Modifier and Type | Method and Description |
|---|---|
IRouteBuilder<R> |
accept(ContentTypeDefaults... acceptedContentTypes)
Sets the accepted
Content-Types. |
IRouteBuilder<R> |
accept(Set<ContentTypeDefaults> acceptedContentTypes)
Sets the accepted
Content-Types. |
IRouteBuilder<R> |
acceptAsString(Set<String> acceptedContentTypes)
Sets the accepted
Content-Types. |
IRouteBuilder<R> |
acceptAsString(String... acceptedContentTypes)
Sets the accepted
Content-Types. |
IRouteBuilder<R> |
after(IHandler<R> afterFilter)
Adds an "after" filter which will only be applied to this particular route.
|
IRouteBuilder<R> |
ALL()
Adds all HTTP methods as being supported.
|
IRouteBuilder<R> |
allRoutingTypes()
This route will be considered for all routing types.
|
IRouteBuilder<R> |
before(IHandler<R> beforeFilter)
Adds a "before" filter which will only be applied to this particular route.
|
IRouteBuilder<R> |
cache()
Adds cache headers.
|
IRouteBuilder<R> |
cache(int seconds)
Adds public cache headers.
|
IRouteBuilder<R> |
cache(int seconds,
boolean isPrivate)
Adds cache headers.
|
IRouteBuilder<R> |
cache(int seconds,
boolean isPrivate,
Integer secondsCdn)
Adds cache headers.
|
IRoute<R> |
create(IHandler<R> mainHandler)
Creates and returns the route without adding it to
the router.
|
IRouteBuilder<R> |
DELETE()
Adds
DELETE as a supported HTTP method. |
IRouteBuilder<R> |
exception()
This route will be considered during an
Exception routing process. |
IRouteBuilder<R> |
found()
This route will be considered during a
Found routing process. |
IRouteBuilder<R> |
GET()
Addss
GET as a supported HTTP method. |
IRouteBuilder<R> |
HEAD()
Adds
HEAD as a supported HTTP method. |
IRouteBuilder<R> |
html()
Adds
application/html as an accepted Content-Type. |
IRouteBuilder<R> |
id(String id)
An id that can be used to identify the route.
|
IRouteBuilder<R> |
json()
Adds
application/json as an accepted Content-Type. |
IRouteBuilder<R> |
noCache()
Automatically adds "no-cache" headers to the response.
|
IRouteBuilder<R> |
notFound()
This route will be considered during a
Not Found routing process. |
IRouteBuilder<R> |
OPTIONS()
Adds
OPTIONS as a supported HTTP method. |
IRouteBuilder<R> |
PATCH()
Adds
PATCH as a supported HTTP method. |
IRouteBuilder<R> |
path(String path)
The path of the route.
|
IRouteBuilder<R> |
pos(int position)
The position of the handler.
|
IRouteBuilder<R> |
POST()
Adds
POST as a supported HTTP method. |
IRouteBuilder<R> |
PUT()
Adds
PUT as a supported HTTP method. |
void |
save(IHandler<R> mainHandler)
Creates the route and saves it to the router.
|
IRouteBuilder<R> |
SOME(HttpMethod... httpMethods)
Adds the specified HTTP methods as being supported.
|
IRouteBuilder<R> |
SOME(Set<HttpMethod> httpMethods)
Adds the specified HTTP methods as being supported.
|
IRouteBuilder<R> |
TRACE()
Adds
TRACE as a supported HTTP method. |
IRouteBuilder<R> |
xml()
Adds
application/xml as an accepted Content-Type. |
IRouteBuilder<R> id(String id)
IRouteBuilder<R> path(String path)
IRouteBuilder<R> pos(int position)
IRouteBuilder<R> found()
Found routing process.IRouteBuilder<R> notFound()
Not Found routing process.IRouteBuilder<R> exception()
Exception routing process.IRouteBuilder<R> allRoutingTypes()
IRouteBuilder<R> before(IHandler<R> beforeFilter)
IRouteBuilder<R> after(IHandler<R> afterFilter)
IRouteBuilder<R> acceptAsString(String... acceptedContentTypes)
Content-Types.
This route will only be considered for requests specifying those
Content-Types as being accepted
(using the Accept header).IRouteBuilder<R> acceptAsString(Set<String> acceptedContentTypes)
Content-Types.
This route will only be considered for requests specifying those
Content-Types as being accepted
(using the Accept header).IRouteBuilder<R> accept(ContentTypeDefaults... acceptedContentTypes)
Content-Types.
This route will only be considered for requests specifying those
Content-Types as being accepted
(using the Accept header).IRouteBuilder<R> accept(Set<ContentTypeDefaults> acceptedContentTypes)
Content-Types.
This route will only be considered for requests specifying those
Content-Types as being accepted
(using the Accept header).IRouteBuilder<R> html()
application/html as an accepted Content-Type.IRouteBuilder<R> json()
application/json as an accepted Content-Type.IRouteBuilder<R> xml()
application/xml as an accepted Content-Type.IRouteBuilder<R> GET()
GET as a supported HTTP method.
If you started the creation of the route from an
IRouter object, you already specified some
supported HTTP methods. This one will simply be added.IRouteBuilder<R> POST()
POST as a supported HTTP method.
If you started the creation of the route from an
IRouter object, you already specified some
supported HTTP methods. This one will simply be added.IRouteBuilder<R> PUT()
PUT as a supported HTTP method.
If you started the creation of the route from an
IRouter object, you already specified some
supported HTTP methods. This one will simply be added.IRouteBuilder<R> DELETE()
DELETE as a supported HTTP method.
If you started the creation of the route from an
IRouter object, you already specified some
supported HTTP methods. This one will simply be added.IRouteBuilder<R> OPTIONS()
OPTIONS as a supported HTTP method.
If you started the creation of the route from an
IRouter object, you already specified some
supported HTTP methods. This one will simply be added.IRouteBuilder<R> TRACE()
TRACE as a supported HTTP method.
If you started the creation of the route from an
IRouter object, you already specified some
supported HTTP methods. This one will simply be added.IRouteBuilder<R> HEAD()
HEAD as a supported HTTP method.
If you started the creation of the route from an
IRouter object, you already specified some
supported HTTP methods. This one will simply be added.IRouteBuilder<R> PATCH()
PATCH as a supported HTTP method.
If you started the creation of the route from an
IRouter object, you already specified some
supported HTTP methods. This one will simply be added.IRouteBuilder<R> ALL()
IRouter object, you already specified some
supported HTTP methods. By calling this method, all
methods will now be suported.IRouteBuilder<R> SOME(Set<HttpMethod> httpMethods)
IRouter object, you already specified some
supported HTTP methods. Those new ones will simply be added.IRouteBuilder<R> SOME(HttpMethod... httpMethods)
IRouter object, you already specified some
supported HTTP methods. Those new ones will simply be added.void save(IHandler<R> mainHandler)
IRouter object, an exception will be
thrown.IRoute<R> create(IHandler<R> mainHandler)
save(...) instead to save the route
to the router at the end of the build process!IRouteBuilder<R> noCache()
IRouteBuilder<R> cache()
Uses the default cache configurations, provided
by ISpincastConfig
IRouteBuilder<R> cache(int seconds)
seconds - The number of seconds the resource associated with
this route should be cached.IRouteBuilder<R> cache(int seconds, boolean isPrivate)
seconds - The number of seconds the resource associated with
this route should be cached.isPrivate - should the cache be private?
(help)IRouteBuilder<R> cache(int seconds, boolean isPrivate, Integer secondsCdn)
seconds - The number of seconds the resource associated with
this route should be cached.isPrivate - should the cache be private?
(help)secondsCdn - The number of seconds the resource associated with
this route should be cached by a CDN/proxy. If null, it
won't be used.Copyright © 2016. All rights reserved.