Package | Description |
---|---|
ratpack.dropwizard.metrics |
Integration with Dropwizard 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.server |
Groovy implementations of the Ratpack server building classes.
|
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.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 | Interface and Description |
---|---|
interface |
RequestTimingHandler |
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()
Creates a handler defining function from a "handlers.groovy" Groovy script.
|
static Function<Registry,Handler> |
Groovy.Script.handlers(boolean compileStatic)
Creates a handler defining function from a "handlers.groovy" Groovy script.
|
static Function<Registry,Handler> |
Groovy.Script.handlers(boolean compileStatic,
String scriptPath)
Creates a handler defining function from a Groovy script.
|
static Function<Registry,Handler> |
Groovy.Script.handlersWithArgs(boolean compileStatic,
String scriptPath,
String... args)
Creates a handler defining function from a Groovy script.
|
Modifier and Type | Class and Description |
---|---|
class |
GroovyHandler
A handler subclass that makes a
GroovyContext available. |
Modifier and Type | Method and Description |
---|---|
default Handler |
GroovyChain.chain(Closure<?> closure)
Creates a handler from the given closure.
|
Modifier and Type | Method and Description |
---|---|
GroovyChain |
GroovyChain.all(Handler handler)
Adds the given handler to this.
|
GroovyChain |
GroovyChainAction.all(Handler handler)
Adds the given handler to this.
|
default 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. |
default 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 . |
default 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. |
default 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 . |
default GroovyChain |
GroovyChain.onlyIf(Closure<?> test,
Handler handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Handler handler) |
default GroovyChain |
GroovyChain.options(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is OPTIONS and the path is at the current root. |
default GroovyChain |
GroovyChain.options(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 OPTIONS . |
default 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. |
default 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 . |
default GroovyChain |
GroovyChain.path(Handler handler) |
default GroovyChain |
GroovyChain.path(String path,
Handler handler)
Adds a handler that delegates to the given handler if the relative
path
matches the given path exactly. |
default 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. |
default 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 . |
default 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. |
default 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.all(Class<? extends Handler> handler) |
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.onlyIf(Closure<?> test,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.options(Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.options(String path,
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.path(Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.path(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 |
---|---|
GroovyRatpackServerSpec |
GroovyRatpackServerSpec.handler(Function<? super Registry,? extends Handler> handlerFactory) |
Modifier and Type | Method and Description |
---|---|
static HandlingResult |
GroovyRequestFixture.handle(Handler handler,
Closure<?> closure)
Unit test a
Handler . |
Modifier and Type | Interface and Description |
---|---|
interface |
RequestLogger
A handler that logs information about the request.
|
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.
|
default 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.files(ServerConfig serverConfig,
Action<? super FileHandlerSpec> config)
Creates a handler that serves files from the file system.
|
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.next()
A handler that simply delegates to the next handler.
|
static Handler |
Handlers.notFound()
Convenience for
clientError(404) . |
static Handler |
Handlers.onlyIf(Predicate<? super Context> test,
Handler handler)
Creates a handler that delegates to the given handler if the predicate applies to the context.
|
static Handler |
Handlers.options()
A handler that delegates to the next handler if the request is OPTIONS, otherwise raises a 405 client error.
|
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. |
static Handler |
Handlers.when(Predicate<? super Context> test,
Handler handler)
Creates a handler that inserts and delegates the given handler if the predicate applies to the context.
|
Modifier and Type | Method and Description |
---|---|
Chain |
Chain.all(Handler handler)
Adds the given handler to this.
|
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. |
default 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. |
default 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. |
default 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. |
default 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 . |
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.
|
default Chain |
Chain.onlyIf(Predicate<? super Context> test,
Handler handler)
Invokes the given handler only if the predicate passes.
|
static Handler |
Handlers.onlyIf(Predicate<? super Context> test,
Handler handler)
Creates a handler that delegates to the given handler if the predicate applies to the context.
|
default Chain |
Chain.options(Handler handler)
Adds a handler that delegates to the given handler if
the
request HTTPMethod is OPTIONS and the path is at the current root. |
default Chain |
Chain.options(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 OPTIONS . |
default 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. |
default 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 . |
default Chain |
Chain.path(Handler handler) |
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.
|
default Chain |
Chain.path(String path,
Handler handler)
Adds a handler that delegates to the given handler if the relative
path
matches the given path exactly. |
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.
|
default 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. |
default 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.
|
default 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. |
default 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. |
static Handler |
Handlers.when(Predicate<? super Context> test,
Handler handler)
Creates a handler that inserts and delegates the given handler if the predicate applies to the context.
|
Modifier and Type | Method and Description |
---|---|
default Chain |
Chain.all(Class<? extends Handler> handler) |
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.onlyIf(Predicate<? super Context> test,
Class<? extends Handler> handler) |
default Chain |
Chain.options(Class<? extends Handler> handler) |
default Chain |
Chain.options(String path,
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.path(Class<? extends Handler> handler) |
default Chain |
Chain.path(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 |
---|---|
static Handler |
RatpackPac4j.authenticator(org.pac4j.core.client.Client<?,?>... clients)
|
static Handler |
RatpackPac4j.authenticator(String path,
org.pac4j.core.client.Client<?,?>... clients)
Creates a handler that implements authentication when the request path matches, and makes a Pac4j
Clients available to downstream handlers otherwise. |
static Handler |
RatpackPac4j.authenticator(String path,
RatpackPac4j.ClientsProvider clientsProvider)
Creates a handler that implements authentication when the request path matches, and makes a Pac4j
Clients available to downstream handlers otherwise. |
static <C extends org.pac4j.core.credentials.Credentials,U extends org.pac4j.core.profile.UserProfile> |
RatpackPac4j.requireAuth(Class<? extends org.pac4j.core.client.Client<C,U>> clientType,
org.pac4j.core.authorization.Authorizer<? super U>... authorizers)
An authentication and authorization “filter”.
|
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.
|
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.
|
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 . |