Package | Description |
---|---|
ratpack.dropwizard.metrics |
Integration with Dropwizard Metrics Library.
|
ratpack.error |
Types that deal with handling application errors.
|
ratpack.groovy.handling |
Groovy specific extensions to classes in the
ratpack.handling package. |
ratpack.groovy.render |
Specialised Groovy support for rendering.
|
ratpack.groovy.template |
Support for templating based on embedded Groovy code in text.
|
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.http |
The HTTP protocol.
|
ratpack.hystrix |
Provides integration with the Hystrix library.
|
ratpack.pac4j |
Integration with pac4j for authentication/authorization.
|
ratpack.parse |
Parsing in Ratpack refers to deserializing a request body into a Java object of some type.
|
ratpack.render |
The renderer framework provides a pluggable mechanism for serializing objects to the response.
|
ratpack.server |
Objects used to start a ratpack application.
|
ratpack.sse |
Support for Server Sent Events.
|
ratpack.websocket |
Support for Websockets.
|
Modifier and Type | Method and Description |
---|---|
void |
MetricsWebsocketBroadcastHandler.handle(Context context) |
Modifier and Type | Method and Description |
---|---|
void |
ClientErrorHandler.error(Context context,
int statusCode)
Handle a client error.
|
void |
ServerErrorHandler.error(Context context,
Throwable throwable)
Processes the given exception that occurred processing the given context.
|
Modifier and Type | Interface and Description |
---|---|
interface |
GroovyContext
Subclass of
Context that adds Groovy friendly variants of methods. |
Modifier and Type | Method and Description |
---|---|
static GroovyContext |
GroovyContext.from(Context ctx)
Creates a Groovy context from a context.
|
void |
GroovyHandler.handle(Context context)
Delegates to
GroovyHandler.handle(GroovyContext) . |
Modifier and Type | Method and Description |
---|---|
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Class<? extends Handler> handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Closure<?> handler) |
default GroovyChain |
GroovyChain.onlyIf(Predicate<? super Context> test,
Handler handler) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Action<? super Chain> action) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Class<? extends Action<? super Chain>> action) |
default GroovyChain |
GroovyChain.when(Predicate<? super Context> test,
Closure<?> handlers) |
Modifier and Type | Method and Description |
---|---|
void |
GroovyRendererSupport.render(Context context,
T object)
Delegates to
GroovyRendererSupport.render(GroovyContext, Object) , wrapping the given context in a GroovyContext . |
Modifier and Type | Method and Description |
---|---|
void |
Markup.render(Context context) |
Modifier and Type | Field and Description |
---|---|
static TypeToken<Context> |
Context.TYPE
A type token for this type.
|
Modifier and Type | Method and Description |
---|---|
Context |
Context.getContext()
Returns this.
|
Modifier and Type | Method and Description |
---|---|
void |
Handler.handle(Context ctx)
Handles the context.
|
void |
InjectionHandler.handle(Context context)
Invokes the custom "handle" method, extracting necessary parameters from the context to satisfy the call.
|
default void |
RequestLogger.handle(Context ctx)
Adds
RequestLogger.log(RequestOutcome) as a context close action , effectively logging the request. |
void |
ResponseTimer.handle(Context ctx)
Adds the number of milliseconds of elapsed time between
Request.getTimestamp() and when the response is ready to be sent. |
void |
Redirector.redirect(Context context,
String location,
int code)
Issue a redirect to the client.
|
Modifier and Type | Method and Description |
---|---|
default Chain |
Chain.onlyIf(Predicate<? super Context> test,
Class<? extends Handler> handler) |
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.when(Predicate<? super Context> test,
Action<? super Chain> action) |
default Chain |
Chain.when(Predicate<? super Context> test,
Class<? extends Action<? super Chain>> action) |
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 |
---|---|
void |
HealthCheckHandler.handle(Context ctx)
Renders health checks.
|
Modifier and Type | Method and Description |
---|---|
void |
ResponseChunks.render(Context context)
Render this object to the response.
|
Modifier and Type | Method and Description |
---|---|
void |
HystrixMetricsEventStreamHandler.handle(Context context) |
Modifier and Type | Method and Description |
---|---|
Iterable<? extends Client<?,?>> |
RatpackPac4j.ClientsProvider.get(Context ctx) |
static Promise<UserProfile> |
RatpackPac4j.login(Context ctx,
Class<? extends Client<?,?>> clientType)
Logs the user in by redirecting to the authenticator, or provides the user profile if already logged in.
|
static Operation |
RatpackPac4j.logout(Context ctx)
Logs out the current user, removing their profile from the session.
|
static Promise<Optional<UserProfile>> |
RatpackPac4j.userProfile(Context ctx)
Obtains the logged in user's profile, if the user is logged in.
|
static <T extends UserProfile> |
RatpackPac4j.userProfile(Context ctx,
Class<T> type)
Obtains the logged in user's profile, of the given type, if the user is logged in.
|
static Promise<WebContext> |
RatpackPac4j.webContext(Context ctx)
Creates a Pac4j
WebContext implementation based on Ratpack's context. |
Modifier and Type | Method and Description |
---|---|
<T> T |
Parser.parse(Context context,
TypedData requestBody,
Parse<T,O> parse)
Deserializes the request body of the context into an object.
|
<T> T |
NoOptParserSupport.parse(Context context,
TypedData requestBody,
Parse<T,Void> parse)
Delegates to
NoOptParserSupport.parse(ratpack.handling.Context, ratpack.http.TypedData, TypeToken) , discarding the opts object of the given parse . |
protected abstract <T> T |
NoOptParserSupport.parse(Context context,
TypedData requestBody,
TypeToken<T> type)
The parser implementation.
|
Modifier and Type | Method and Description |
---|---|
Promise<T> |
RenderableDecorator.decorate(Context context,
T object)
Decorates the given object on its way to being rendered.
|
void |
Renderable.render(Context context)
Render this object to the response.
|
void |
Renderer.render(Context context,
T object)
Render the given object to the response.
|
abstract void |
RendererSupport.render(Context context,
T t)
Render the given object to the response.
|
Modifier and Type | Method and Description |
---|---|
static <T> Renderer<T> |
Renderer.of(Class<T> type,
BiConsumer<? super Context,? super T> impl)
Creates a renderer implementation from the given arguments.
|
static <T> RenderableDecorator<T> |
RenderableDecorator.of(Class<T> type,
BiFunction<? super Context,? super T,? extends T> impl)
Creates a renderable decorator implementation for the given type that uses the function as decorator.
|
static <T> RenderableDecorator<T> |
RenderableDecorator.ofAsync(Class<T> type,
BiFunction<? super Context,? super T,? extends Promise<T>> impl)
Creates a renderable decorator implementation for the given type that uses the function as decorator.
|
Modifier and Type | Method and Description |
---|---|
default HttpUrlBuilder |
PublicAddress.builder(Context ctx)
Creates a URL builder using the public address as the base.
|
URI |
PublicAddress.get(Context ctx)
The advertised public address.
|
default URI |
PublicAddress.get(Context ctx,
Action<? super HttpUrlBuilder> action)
Creates a URL by building a URL based on the public address.
|
default URI |
PublicAddress.get(Context ctx,
String path)
Creates a URL by appending the given path to the public address
|
Modifier and Type | Method and Description |
---|---|
void |
ServerSentEvents.render(Context context)
Render this object to the response.
|
Modifier and Type | Method and Description |
---|---|
static <T> WebSocketConnector<T> |
WebSockets.websocket(Context context,
Function<WebSocket,T> openAction) |
static void |
WebSockets.websocket(Context context,
WebSocketHandler<?> handler) |
static void |
WebSockets.websocketBroadcast(Context context,
Publisher<String> broadcaster)
Sets up a websocket that sends the published Strings to a client.
|
static void |
WebSockets.websocketByteBufBroadcast(Context context,
Publisher<ByteBuf> broadcaster)
Sets up a websocket that sends the published byte buffers to a client.
|