Package | Description |
---|---|
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.server |
Objects used to start a ratpack application.
|
ratpack.spring.config | |
ratpack.test.embed |
Support for creating embedded applications at test time, for testing Ratpack features and extensions.
|
ratpack.test.handling |
Test fixtures for exercising
Handler implementations without
start a full EmbeddedApp . |
Modifier and Type | Method and Description |
---|---|
static Action<Chain> |
Groovy.chain(Closure<?> closure)
Creates a chain action implementation from the given closure.
|
static Action<Chain> |
Groovy.chainAction(Closure<?> closure)
Creates a chain action based on the given closure.
|
Modifier and Type | Method and Description |
---|---|
static void |
Groovy.chain(Chain chain,
Closure<?> closure)
|
Modifier and Type | Interface and Description |
---|---|
interface |
GroovyChain
A Groovy oriented handler chain builder DSL.
|
Modifier and Type | Class and Description |
---|---|
class |
GroovyChainAction
A convenience super class for a standalone implementation of a
Action<GroovyChain> . |
Modifier and Type | Method and Description |
---|---|
void |
GroovyChainAction.execute(Chain chain)
Invokes
GroovyChainAction.execute() while setting the given chain as the implicit receiver. |
static GroovyChain |
GroovyChain.from(Chain chain)
Creates a Groovy chain wrapper over a chain instance.
|
Modifier and Type | Method and Description |
---|---|
default GroovyChain |
GroovyChain.fileSystem(java.lang.String path,
Action<? super Chain> action)
Adds a handler to this chain that changes the
FileSystemBinding for the given handler chain. |
default GroovyChain |
GroovyChain.fileSystem(java.lang.String path,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.host(java.lang.String hostName,
Action<? super Chain> action)
Adds a handler to the chain that delegates to the given handler chain if the request has a
Host header that matches the given value exactly. |
default GroovyChain |
GroovyChain.host(java.lang.String hostName,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.insert(Action<? super Chain> action)
Inserts the given nested handler chain.
|
default GroovyChain |
GroovyChain.insert(java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.prefix(java.lang.String prefix,
Action<? super Chain> action)
Adds a handler that delegates to the given handlers if the
relative path starts with the given
prefix . |
default GroovyChain |
GroovyChain.prefix(java.lang.String prefix,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.register(Action<? super RegistrySpec> registryAction,
Action<? super Chain> chainAction)
Adds a handler that inserts the given handler chain with a registry built by the given action via
Context.insert(ratpack.registry.Registry, Handler...) . |
default GroovyChain |
GroovyChain.register(Action<? super RegistrySpec> registryAction,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.register(Registry registry,
Action<? super Chain> action)
Adds a handler that inserts the given handler chain with the given registry via
Context.insert(ratpack.registry.Registry, Handler...) . |
default GroovyChain |
GroovyChain.register(Registry registry,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.when(boolean test,
Action<? super Chain> action)
Inlines the given chain if
test is true . |
default GroovyChain |
GroovyChain.when(boolean test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse)
Inlines the appropriate chain based on the given
test . |
default GroovyChain |
GroovyChain.when(boolean test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse)
Inlines the appropriate chain based on the given
test . |
default GroovyChain |
GroovyChain.when(boolean test,
java.lang.Class<? extends Action<? super Chain>> action)
Inlines the given chain if
test is true . |
default GroovyChain |
GroovyChain.when(boolean test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse)
Inlines the appropriate chain based on the given
test . |
default GroovyChain |
GroovyChain.when(boolean test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse)
Inlines the appropriate chain based on the given
test . |
default GroovyChain |
GroovyChain.when(Closure<?> test,
Action<? super Chain> chain) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
Action<? super Chain> ifChain,
Action<? super Chain> elseChain) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
Action<? super Chain> ifChain,
Action<? super Chain> elseChain) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
java.lang.Class<? extends Action<? super Chain>> ifAction,
java.lang.Class<? extends Action<? super Chain>> elseAction) |
default GroovyChain |
GroovyChain.when(Closure<?> test,
java.lang.Class<? extends Action<? super Chain>> ifAction,
java.lang.Class<? extends Action<? super Chain>> elseAction) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Action<? super Chain> action) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse) |
Modifier and Type | Method and Description |
---|---|
static HandlingResult |
GroovyRequestFixture.handle(Action<? super Chain> handlers,
Closure<?> closure)
Unit test a chain of
handlers . |
Modifier and Type | Method and Description |
---|---|
default Chain |
Chain.all(java.lang.Class<? extends Handler> handler) |
Chain |
Chain.all(Handler handler)
Adds the given handler to this.
|
default Chain |
Chain.delete(java.lang.Class<? extends Handler> handler) |
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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default Chain |
Chain.delete(java.lang.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 Chain |
Chain.files()
files(Action) , using the default config. |
default Chain |
Chain.files(Action<? super FileHandlerSpec> config)
Adds a handler that serves files from the file system.
|
default Chain |
Chain.fileSystem(java.lang.String path,
Action<? super Chain> action)
Adds a handler to this chain that changes the
FileSystemBinding for the given handler chain. |
default Chain |
Chain.fileSystem(java.lang.String path,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.get(java.lang.Class<? extends Handler> handler) |
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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default Chain |
Chain.get(java.lang.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 Chain |
Chain.host(java.lang.String hostName,
Action<? super Chain> action)
Adds a handler to the chain that delegates to the given handler chain if the request has a
Host header that matches the given value exactly. |
default Chain |
Chain.host(java.lang.String hostName,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.insert(Action<? super Chain> action)
Inserts the given nested handler chain.
|
default Chain |
Chain.insert(java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.notFound()
Raises a 404
Context.clientError(int) . |
default Chain |
Chain.onlyIf(Predicate<? super Context> test,
java.lang.Class<? extends Handler> handler) |
default Chain |
Chain.onlyIf(Predicate<? super Context> test,
Handler handler)
Invokes the given handler only if the predicate passes.
|
default Chain |
Chain.options(java.lang.Class<? extends Handler> handler) |
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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default Chain |
Chain.options(java.lang.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(java.lang.Class<? extends Handler> handler) |
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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default Chain |
Chain.patch(java.lang.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(java.lang.Class<? extends Handler> handler) |
default Chain |
Chain.path(Handler handler) |
default Chain |
Chain.path(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default Chain |
Chain.path(java.lang.String path,
Handler handler)
Adds a handler that delegates to the given handler if the relative
path
matches the given path exactly. |
default Chain |
Chain.post(java.lang.Class<? extends Handler> handler) |
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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default Chain |
Chain.post(java.lang.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 Chain |
Chain.prefix(java.lang.String prefix,
Action<? super Chain> action)
Adds a handler that delegates to the given handlers if the
relative path starts with the given
prefix . |
default Chain |
Chain.prefix(java.lang.String prefix,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.put(java.lang.Class<? extends Handler> handler) |
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(java.lang.String path,
java.lang.Class<? extends Handler> handler) |
default Chain |
Chain.put(java.lang.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 . |
default Chain |
Chain.redirect(int code,
java.lang.String location)
Sends an HTTP redirect to the specified location.
|
default Chain |
Chain.register(Action<? super RegistrySpec> action)
Builds a new registry via the given action, then registers it via
register(Registry) . |
default Chain |
Chain.register(Action<? super RegistrySpec> registryAction,
Action<? super Chain> action)
Adds a handler that inserts the given handler chain with a registry built by the given action via
Context.insert(ratpack.registry.Registry, Handler...) . |
default Chain |
Chain.register(Action<? super RegistrySpec> registryAction,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.register(Registry registry)
Makes the contents of the given registry available for downstream handlers of the same nesting level.
|
default Chain |
Chain.register(Registry registry,
Action<? super Chain> action)
Adds a handler that inserts the given handler chain with the given registry via
Context.insert(ratpack.registry.Registry, Handler...) . |
default Chain |
Chain.register(Registry registry,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.when(boolean test,
Action<? super Chain> action)
Inlines the given chain if
test is true . |
default Chain |
Chain.when(boolean test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse)
Inlines the appropriate chain based on the given
test . |
default Chain |
Chain.when(boolean test,
java.lang.Class<? extends Action<? super Chain>> action)
Inlines the given chain if
test is true . |
default Chain |
Chain.when(boolean test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse)
Inlines the appropriate chain based on the given
test . |
default Chain |
Chain.when(Predicate<? super Context> test,
Action<? super Chain> action) |
default Chain |
Chain.when(Predicate<? super Context> test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse) |
default Chain |
Chain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse) |
Modifier and Type | Method and Description |
---|---|
default Handler |
Chain.chain(Action<? super Chain> action)
Constructs a handler using the given action to define a chain.
|
default Handler |
Chain.chain(java.lang.Class<? extends Action<? super Chain>> action) |
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.
|
default Chain |
Chain.fileSystem(java.lang.String path,
Action<? super Chain> action)
Adds a handler to this chain that changes the
FileSystemBinding for the given handler chain. |
default Chain |
Chain.fileSystem(java.lang.String path,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.host(java.lang.String hostName,
Action<? super Chain> action)
Adds a handler to the chain that delegates to the given handler chain if the request has a
Host header that matches the given value exactly. |
default Chain |
Chain.host(java.lang.String hostName,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.insert(Action<? super Chain> action)
Inserts the given nested handler chain.
|
default Chain |
Chain.insert(java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.prefix(java.lang.String prefix,
Action<? super Chain> action)
Adds a handler that delegates to the given handlers if the
relative path starts with the given
prefix . |
default Chain |
Chain.prefix(java.lang.String prefix,
java.lang.Class<? extends Action<? super Chain>> action) |
static HandlerDecorator |
HandlerDecorator.prependHandlers(Action<? super Chain> handlers)
A factory for decorator impls that effectively inserts the given chain before the “rest” of the handlers.
|
static HandlerDecorator |
HandlerDecorator.prependHandlers(java.lang.Class<? extends Action<? super Chain>> handlers)
A factory for decorator impls that effectively inserts the given chain before the “rest” of the handlers.
|
default Chain |
Chain.register(Action<? super RegistrySpec> registryAction,
Action<? super Chain> action)
Adds a handler that inserts the given handler chain with a registry built by the given action via
Context.insert(ratpack.registry.Registry, Handler...) . |
default Chain |
Chain.register(Action<? super RegistrySpec> registryAction,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.register(Registry registry,
Action<? super Chain> action)
Adds a handler that inserts the given handler chain with the given registry via
Context.insert(ratpack.registry.Registry, Handler...) . |
default Chain |
Chain.register(Registry registry,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.when(boolean test,
Action<? super Chain> action)
Inlines the given chain if
test is true . |
default Chain |
Chain.when(boolean test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse)
Inlines the appropriate chain based on the given
test . |
default Chain |
Chain.when(boolean test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse)
Inlines the appropriate chain based on the given
test . |
default Chain |
Chain.when(boolean test,
java.lang.Class<? extends Action<? super Chain>> action)
Inlines the given chain if
test is true . |
default Chain |
Chain.when(boolean test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse)
Inlines the appropriate chain based on the given
test . |
default Chain |
Chain.when(boolean test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse)
Inlines the appropriate chain based on the given
test . |
default Chain |
Chain.when(Predicate<? super Context> test,
Action<? super Chain> action) |
default Chain |
Chain.when(Predicate<? super Context> test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse) |
default Chain |
Chain.when(Predicate<? super Context> test,
Action<? super Chain> onTrue,
Action<? super Chain> onFalse) |
default Chain |
Chain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> action) |
default Chain |
Chain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse) |
default Chain |
Chain.when(Predicate<? super Context> test,
java.lang.Class<? extends Action<? super Chain>> onTrue,
java.lang.Class<? extends Action<? super Chain>> onFalse) |
Modifier and Type | Method and Description |
---|---|
default RatpackServerSpec |
RatpackServerSpec.handlers(Action<? super Chain> handlers)
Sets the root handler to the chain specified by the given action.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Action<Chain>> |
RatpackServerCustomizerAdapter.getHandlers() |
java.util.List<Action<Chain>> |
RatpackServerCustomizer.getHandlers() |
Modifier and Type | Method and Description |
---|---|
static EmbeddedApp |
EmbeddedApp.fromHandlers(Action<? super Chain> action)
Creates an embedded application with a default launch config (no base dir, ephemeral port) and the given handler chain.
|
Modifier and Type | Method and Description |
---|---|
static HandlingResult |
RequestFixture.handle(Action<? super Chain> chainAction,
Action<? super RequestFixture> requestFixtureAction)
Unit test a
Handler chain. |
HandlingResult |
RequestFixture.handleChain(Action<? super Chain> chainAction)
Similar to
RequestFixture.handle(Handler) , but for testing a handler chain. |