Package | Description |
---|---|
ratpack.codahale.metrics |
Integration with Coda Hale's Metrics Library.
|
ratpack.groovy |
Support for writing Ratpack applications in the Groovy programming language.
|
ratpack.groovy.handling |
Groovy specific extensions to classes in the
ratpack.handling package. |
ratpack.groovy.test.handling | |
ratpack.handling |
The handling of application requests.
|
ratpack.health |
Health checks report on the status of key components in the system and are generally used for monitoring and reporting.
|
ratpack.hystrix |
Provides integration with the Hystrix library.
|
ratpack.launch |
Classes used to bootstrap a Ratpack application.
|
ratpack.pac4j |
Integration with pac4j for authentication/authorization.
|
ratpack.server |
Objects used to start a ratpack application.
|
ratpack.test.embed |
Support for creating embedded applications at test time, for testing Ratpack features and extensions.
|
ratpack.test.handling |
Modifier and Type | Class and Description |
---|---|
class |
MetricsWebsocketBroadcastHandler
A Handler that broadcasts metric reports via web sockets.
|
Modifier and Type | Method and Description |
---|---|
static Handler |
Groovy.chain(Registry registry,
Closure<?> closure)
Builds a chain, backed by the given registry.
|
static Handler |
Groovy.chain(ServerConfig serverConfig,
Closure<?> closure)
Builds a handler chain, with no backing registry.
|
static Handler |
Groovy.chain(ServerConfig serverConfig,
Registry registry,
Closure<?> closure)
Builds a chain, backed by the given registry.
|
static Handler |
Groovy.groovyHandler(Closure<?> closure)
Creates a handler instance from a closure.
|
Modifier and Type | Method and Description |
---|---|
static Function<Registry,Handler> |
Groovy.Script.handlers() |
static Function<Registry,Handler> |
Groovy.Script.handlers(boolean staticCompile) |
static Function<Registry,Handler> |
Groovy.Script.handlers(boolean staticCompile,
String scriptPath) |
Modifier and Type | Class and Description |
---|---|
class |
GroovyHandler
A handler subclass that makes a
GroovyContext available. |
Modifier and Type | Method and Description |
---|---|
Handler |
GroovyChain.chain(Closure<?> closure)
Creates a handler from the given closure.
|
Modifier and Type | Method and Description |
---|---|
GroovyChain |
GroovyChain.delete(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is DELETE and the path is at the current root. |
GroovyChain |
GroovyChain.delete(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is DELETE . |
GroovyChain |
GroovyChain.get(Handler handler)
Adds a handler that delegates to the given handler
if the
request HTTPMethod is GET and the path is at the
current root. |
GroovyChain |
GroovyChain.get(String path,
Handler handler)
Adds a handler that delegates to the given handler
if the relative
path matches the given path and the request
HTTPMethod is GET . |
GroovyChain |
GroovyChain.handler(Handler handler)
Adds the given handler to this.
|
GroovyChain |
GroovyChain.handler(String path,
Handler handler)
Adds a handler that delegates to the given handler if the relative
path
matches the given path exactly. |
GroovyChain |
GroovyChain.header(String headerName,
String headerValue,
Handler handler)
Adds a handler to the chain that delegates to the given handler if the request has a header with the given name and a its value matches the given value exactly.
|
GroovyChain |
GroovyChain.patch(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is PATCH and the path is at the current root. |
GroovyChain |
GroovyChain.patch(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is PATCH . |
GroovyChain |
GroovyChain.post(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is POST and the path is at the current root. |
GroovyChain |
GroovyChain.post(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is POST . |
GroovyChain |
GroovyChain.put(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is PUT and the path is at the current root. |
GroovyChain |
GroovyChain.put(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is PUT . |
Modifier and Type | Method and Description |
---|---|
default GroovyChain |
GroovyChain.delete(Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.delete(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.get(Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.get(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.handler(Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.handler(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.header(String headerName,
String headerValue,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.patch(Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.patch(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.post(Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.post(String path,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.put(Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.put(String path,
Class<? extends Handler> handler) |
Modifier and Type | Method and Description |
---|---|
static HandlingResult |
GroovyRequestFixture.handle(Handler handler,
Closure<?> closure)
Unit test a
Handler . |
Modifier and Type | Class and Description |
---|---|
class |
InjectionHandler
A super class that removes the boiler plate of retrieving objects from the context registry by injecting them based on a method signature.
|
class |
ResponseTimer
A
handler , that adds a "X-Response-Time" header to all requests indicating how long it took to start sending a response in milliseconds. |
Modifier and Type | Method and Description |
---|---|
static Handler |
Handlers.accepts(String... contentTypes)
A handler that delegates to the next handler if the request claims that it can accept one of the given types, otherwise raises a 406 client error.
|
static Handler |
Handlers.assets(ServerConfig serverConfig,
String path,
List<String> indexFiles)
A handler that serves static assets at the given file system path, relative to the contextual file system binding.
|
static Handler |
RequestId.bind()
Creates a new request ID (using the
RequestId.Generator from the context) and inserts it into the request registry. |
static Handler |
RequestId.bindAndLog() |
Handler |
Chain.chain(Action<? super Chain> action)
Constructs a handler using the given action to define a chain.
|
default Handler |
Chain.chain(Class<? extends Action<? super Chain>> action) |
static Handler |
Handlers.chain(Handler... handlers)
Creates a handler chain from the given handlers.
|
static Handler |
Handlers.chain(List<? extends Handler> handlers)
Creates a handler chain from the given handlers.
|
static Handler |
Handlers.chain(Registry registry,
Action<? super Chain> action)
Builds a chain, backed by the given registry.
|
static Handler |
Handlers.chain(ServerConfig serverConfig,
Action<? super Chain> action)
Builds a handler chain, with no backing registry.
|
static Handler |
Handlers.chain(ServerConfig serverConfig,
Registry registry,
Action<? super Chain> action)
Builds a chain, backed by the given registry.
|
static Handler |
Handlers.clientError(int statusCode)
A handler that simply calls
Context.clientError(int) with the given status code. |
static Handler |
Handlers.contentTypes(String... contentTypes)
A handler that delegates to the next handler if the content type of the request is one of the given types, otherwise raises a 415 client error.
|
Handler |
HandlerDecorator.decorate(Registry serverRegistry,
Handler rest)
Creates a new handler that decorates the application handlers, given as the
rest argument. |
static Handler |
Handlers.delete()
A handler that delegates to the next handler if the request is DELETE, otherwise raises a 405 client error.
|
static Handler |
Handlers.fileSystem(ServerConfig serverConfig,
String path,
Handler handler)
A handlers that changes the
FileSystemBinding for the given handlers. |
static Handler |
Handlers.get()
A handler that delegates to the next handler if the request is GET, otherwise raises a 405 client error.
|
static Handler |
Handlers.header(String headerName,
String headerValue,
Handler handler)
Creates a handler that delegates to the given handler if the
request has a HTTPHeader with the
given name and a it's value matches the given value exactly. |
static Handler |
Handlers.host(String hostName,
Handler handler)
Creates a handler that delegates to the given handler if the
request has a HTTPHost with the
given name that matches the given value exactly. |
static Handler |
Handlers.next()
A handler that simply delegates to the next handler.
|
static Handler |
Handlers.notFound()
Convenience for
clientError(404) . |
static Handler |
Handlers.patch()
A handler that delegates to the next handler if the request is PATCH, otherwise raises a 405 client error.
|
static Handler |
Handlers.path(PathBinder pathBinder,
Handler handler)
Creates a handler that delegates to the given handlers if the request can be bound by the given path binder.
|
static Handler |
Handlers.path(String path,
Handler handler)
Creates a handler that delegates to the given handlers if the request matches the given path exactly.
|
static Handler |
Handlers.post()
A handler that delegates to the next handler if the request is POST, otherwise raises a 405 client error.
|
static Handler |
Handlers.prefix(String prefix,
Handler handler)
Creates a handler that delegates to the given handlers if the request path starts with the given prefix.
|
static Handler |
Handlers.put()
A handler that delegates to the next handler if the request is PUT, otherwise raises a 405 client error.
|
static Handler |
Handlers.redirect(int code,
String location)
Creates a handler that always issues a redirect using
Context.redirect(int, String) with exactly the given code and location. |
static Handler |
Handlers.register(Registry registry)
A handler that simply calls
Context.next(Registry) with the given registry. |
static Handler |
Handlers.register(Registry registry,
Handler handler)
A handler that simply calls
Context.insert(Registry, Handler...) with the given registry and handler. |
Modifier and Type | Method and Description |
---|---|
static Handler |
Handlers.chain(Handler... handlers)
Creates a handler chain from the given handlers.
|
Handler |
HandlerDecorator.decorate(Registry serverRegistry,
Handler rest)
Creates a new handler that decorates the application handlers, given as the
rest argument. |
ByMethodSpec |
ByMethodSpec.delete(Handler handler)
Defines the action to to take if the request has a HTTP method of DELETE.
|
Chain |
Chain.delete(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is DELETE and the path is at the current root. |
Chain |
Chain.delete(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is DELETE . |
static Handler |
Handlers.fileSystem(ServerConfig serverConfig,
String path,
Handler handler)
A handlers that changes the
FileSystemBinding for the given handlers. |
ByMethodSpec |
ByMethodSpec.get(Handler handler)
Defines the action to to take if the request has a HTTP method of GET.
|
Chain |
Chain.get(Handler handler)
Adds a handler that delegates to the given handler
if the
request HTTPMethod is GET and the path is at the
current root. |
Chain |
Chain.get(String path,
Handler handler)
Adds a handler that delegates to the given handler
if the relative
path matches the given path and the request
HTTPMethod is GET . |
Chain |
Chain.handler(Handler handler)
Adds the given handler to this.
|
Chain |
Chain.handler(String path,
Handler handler)
Adds a handler that delegates to the given handler if the relative
path
matches the given path exactly. |
Chain |
Chain.header(String headerName,
String headerValue,
Handler handler)
Adds a handler to the chain that delegates to the given handler if the request has a header with the given name and a its value matches the given value exactly.
|
static Handler |
Handlers.header(String headerName,
String headerValue,
Handler handler)
Creates a handler that delegates to the given handler if the
request has a HTTPHeader with the
given name and a it's value matches the given value exactly. |
static Handler |
Handlers.host(String hostName,
Handler handler)
Creates a handler that delegates to the given handler if the
request has a HTTPHost with the
given name that matches the given value exactly. |
ByContentSpec |
ByContentSpec.html(Handler handler)
Specifies that the given handler should be used if the client wants content of type "text/html".
|
void |
Context.insert(Handler... handlers)
Inserts some handlers into the pipeline, then delegates to the first.
|
void |
Context.insert(Registry registry,
Handler... handlers)
Inserts some handlers into the pipeline to execute with the given registry, then delegates to the first.
|
ByContentSpec |
ByContentSpec.json(Handler handler)
Specifies that the given handler should be used if the client wants content of type "application/json".
|
ByMethodSpec |
ByMethodSpec.named(String methodName,
Handler handler)
Defines the action to to take if the request has a HTTP method of
methodName . |
ByContentSpec |
ByContentSpec.noMatch(Handler handler)
Specifies that the given handler should be used if the client's requested content type cannot be matched with any of the other handlers.
|
ByMethodSpec |
ByMethodSpec.patch(Handler handler)
Defines the action to to take if the request has a HTTP method of PATCH.
|
Chain |
Chain.patch(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is PATCH and the path is at the current root. |
Chain |
Chain.patch(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is PATCH . |
static Handler |
Handlers.path(PathBinder pathBinder,
Handler handler)
Creates a handler that delegates to the given handlers if the request can be bound by the given path binder.
|
static Handler |
Handlers.path(String path,
Handler handler)
Creates a handler that delegates to the given handlers if the request matches the given path exactly.
|
ByContentSpec |
ByContentSpec.plainText(Handler handler)
Specifies that the given handler should be used if the client wants content of type "text/plain".
|
ByMethodSpec |
ByMethodSpec.post(Handler handler)
Defines the action to to take if the request has a HTTP method of POST.
|
Chain |
Chain.post(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is POST and the path is at the current root. |
Chain |
Chain.post(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is POST . |
static Handler |
Handlers.prefix(String prefix,
Handler handler)
Creates a handler that delegates to the given handlers if the request path starts with the given prefix.
|
static HandlerDecorator |
HandlerDecorator.prepend(Handler handler)
A factory for decorator impls that effectively inserts the given handler before the “rest” of the handlers.
|
ByMethodSpec |
ByMethodSpec.put(Handler handler)
Defines the action to to take if the request has a HTTP method of PUT.
|
Chain |
Chain.put(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is PUT and the path is at the current root. |
Chain |
Chain.put(String path,
Handler handler)
Adds a handler that delegates to the given handler if
the relative
path matches the given path and the request HTTPMethod
is PUT . |
static Handler |
Handlers.register(Registry registry,
Handler handler)
A handler that simply calls
Context.insert(Registry, Handler...) with the given registry and handler. |
ByContentSpec |
ByContentSpec.type(String mimeType,
Handler handler)
Specifies that the given handler should be used if the client wants content of the given MIME type.
|
ByContentSpec |
ByContentSpec.xml(Handler handler)
Specifies that the given handler should be used if the client wants content of type "application/xml".
|
Modifier and Type | Method and Description |
---|---|
static Handler |
Handlers.chain(List<? extends Handler> handlers)
Creates a handler chain from the given handlers.
|
default Chain |
Chain.delete(Class<? extends Handler> handler) |
default Chain |
Chain.delete(String path,
Class<? extends Handler> handler) |
default Chain |
Chain.get(Class<? extends Handler> handler) |
default Chain |
Chain.get(String path,
Class<? extends Handler> handler) |
default Chain |
Chain.handler(Class<? extends Handler> handler) |
default Chain |
Chain.handler(String path,
Class<? extends Handler> handler) |
default Chain |
Chain.header(String headerName,
String headerValue,
Class<? extends Handler> handler) |
default Chain |
Chain.patch(Class<? extends Handler> handler) |
default Chain |
Chain.patch(String path,
Class<? extends Handler> handler) |
default Chain |
Chain.post(Class<? extends Handler> handler) |
default Chain |
Chain.post(String path,
Class<? extends Handler> handler) |
default Chain |
Chain.put(Class<? extends Handler> handler) |
default Chain |
Chain.put(String path,
Class<? extends Handler> handler) |
Modifier and Type | Class and Description |
---|---|
class |
HealthCheckHandler
A handler that executes
health checks and renders the results. |
Modifier and Type | Class and Description |
---|---|
class |
HystrixMetricsEventStreamHandler
A Handler that streams Hystrix metrics in text/event-stream format.
|
Modifier and Type | Method and Description |
---|---|
Handler |
HandlerFactory.create(Registry registry)
Creates a handler from the given launch config.
|
Modifier and Type | Method and Description |
---|---|
static Handler |
RatpackPac4j.auth(Class<? extends Client<?,?>> clientType)
An authentication “filter”, that initiates authentication if necessary.
|
static Handler |
RatpackPac4j.callback(Client<?,?>... clients)
|
static Handler |
RatpackPac4j.callback(String path,
Client<?,?>... clients)
Returns the callback handler, which handles authentication requests.
|
Modifier and Type | Method and Description |
---|---|
default RatpackServerSpec |
RatpackServerSpec.handler(Class<? extends Handler> handlerType)
Sets the root handler by getting a handler of the given type from the server registry.
|
RatpackServerSpec |
RatpackServerSpec.handler(Function<? super Registry,? extends Handler> handlerFactory)
Sets the root handler to the return of the given function.
|
Modifier and Type | Method and Description |
---|---|
static EmbeddedApp |
EmbeddedApp.fromHandler(Handler handler)
Creates an embedded application with a default launch config (no base dir, ephemeral port) and the given handler.
|
static EmbeddedApp |
EmbeddedApp.fromHandler(Path baseDir,
Handler handler)
Creates an embedded application with a default launch config (ephemeral port) and the given handler.
|
Modifier and Type | Method and Description |
---|---|
static EmbeddedApp |
EmbeddedApp.fromHandlerFactory(Function<? super Registry,? extends Handler> handlerFactory)
Creates an embedded application with a default launch config (no base dir, ephemeral port) and the given handler.
|
static EmbeddedApp |
EmbeddedApp.fromHandlerFactory(Path baseDir,
Function<? super Registry,? extends Handler> handlerFactory)
Creates an embedded application with a default launch config (ephemeral port) and the given handler.
|
Modifier and Type | Method and Description |
---|---|
HandlingResult |
RequestFixture.handle(Handler handler)
Invokes the given handler with a newly created
Context based on the state of this fixture. |
static HandlingResult |
RequestFixture.handle(Handler handler,
Action<? super RequestFixture> action)
Unit test a single
Handler . |