Package | Description |
---|---|
io.jooby |
Modifier and Type | Interface and Description |
---|---|
interface |
DefaultContext
Like
Context but with couple of default methods. |
Modifier and Type | Class and Description |
---|---|
class |
ForwardingContext
Utility to class that helps to wrap and delegate to another context.
|
Modifier and Type | Method and Description |
---|---|
Context |
ForwardingContext.attribute(String key,
Object value) |
default Context |
DefaultContext.attribute(String key,
Object value) |
Context |
Context.attribute(String key,
Object value)
Set an application attribute.
|
Context |
ForwardingContext.detach(Route.Handler next) |
Context |
Context.detach(Route.Handler next)
Tells context that response will be generated form a different thread.
|
Context |
ForwardingContext.dispatch(Executor executor,
Runnable action) |
Context |
Context.dispatch(Executor executor,
Runnable action)
Dispatch context to the given executor.
|
Context |
ForwardingContext.dispatch(Runnable action) |
Context |
Context.dispatch(Runnable action)
Dispatch context to a worker threads.
|
Context |
ForwardingContext.removeResponseHeader(String name) |
Context |
Context.removeResponseHeader(String name)
Remove a response header.
|
Context |
ForwardingContext.render(Object value) |
default Context |
DefaultContext.render(Object value) |
Context |
Context.render(Object value)
Render a value and send the response to client.
|
Context |
ForwardingContext.responseStream(MediaType contentType,
SneakyThrows.Consumer<OutputStream> consumer) |
default Context |
DefaultContext.responseStream(MediaType contentType,
SneakyThrows.Consumer<OutputStream> consumer) |
Context |
Context.responseStream(MediaType contentType,
SneakyThrows.Consumer<OutputStream> consumer)
HTTP response channel as output stream.
|
Context |
ForwardingContext.responseStream(SneakyThrows.Consumer<OutputStream> consumer) |
default Context |
DefaultContext.responseStream(SneakyThrows.Consumer<OutputStream> consumer) |
Context |
Context.responseStream(SneakyThrows.Consumer<OutputStream> consumer)
HTTP response channel as output stream.
|
Context |
ForwardingContext.responseWriter(MediaType contentType,
Charset charset,
SneakyThrows.Consumer<PrintWriter> consumer) |
default Context |
DefaultContext.responseWriter(MediaType contentType,
Charset charset,
SneakyThrows.Consumer<PrintWriter> consumer) |
Context |
Context.responseWriter(MediaType contentType,
Charset charset,
SneakyThrows.Consumer<PrintWriter> consumer)
HTTP response channel as response writer.
|
Context |
ForwardingContext.responseWriter(MediaType contentType,
SneakyThrows.Consumer<PrintWriter> consumer) |
default Context |
DefaultContext.responseWriter(MediaType contentType,
SneakyThrows.Consumer<PrintWriter> consumer) |
Context |
Context.responseWriter(MediaType contentType,
SneakyThrows.Consumer<PrintWriter> consumer)
HTTP response channel as response writer.
|
Context |
ForwardingContext.responseWriter(SneakyThrows.Consumer<PrintWriter> consumer) |
default Context |
DefaultContext.responseWriter(SneakyThrows.Consumer<PrintWriter> consumer) |
Context |
Context.responseWriter(SneakyThrows.Consumer<PrintWriter> consumer)
HTTP response channel as response writer.
|
Context |
ForwardingContext.send(AttachedFile file) |
default Context |
DefaultContext.send(AttachedFile file) |
Context |
Context.send(AttachedFile file)
Send a file attached response.
|
Context |
ForwardingContext.send(byte[] data) |
Context |
Context.send(byte[] data)
Send response data.
|
Context |
ForwardingContext.send(ByteBuffer data) |
Context |
Context.send(ByteBuffer data)
Send response data.
|
Context |
ForwardingContext.send(FileChannel file) |
Context |
Context.send(FileChannel file)
Send a file response.
|
Context |
ForwardingContext.send(InputStream input) |
Context |
Context.send(InputStream input)
Send response data.
|
Context |
ForwardingContext.send(Path file) |
default Context |
DefaultContext.send(Path file) |
Context |
Context.send(Path file)
Send a file response.
|
Context |
ForwardingContext.send(ReadableByteChannel channel) |
Context |
Context.send(ReadableByteChannel channel)
Send response data.
|
Context |
ForwardingContext.send(StatusCode statusCode) |
Context |
Context.send(StatusCode statusCode)
Send an empty response with the given status code.
|
Context |
ForwardingContext.send(String data) |
default Context |
DefaultContext.send(String data) |
Context |
Context.send(String data)
Send response data.
|
Context |
ForwardingContext.send(String data,
Charset charset) |
Context |
Context.send(String data,
Charset charset)
Send response data.
|
Context |
ForwardingContext.sendError(Throwable cause) |
default Context |
DefaultContext.sendError(Throwable cause) |
Context |
Context.sendError(Throwable cause)
Send an error response.
|
Context |
ForwardingContext.sendError(Throwable cause,
StatusCode statusCode) |
default Context |
DefaultContext.sendError(Throwable cause,
StatusCode statusCode)
Send an error response.
|
Context |
Context.sendError(Throwable cause,
StatusCode statusCode)
Send an error response.
|
Context |
ForwardingContext.sendRedirect(StatusCode redirect,
String location) |
default Context |
DefaultContext.sendRedirect(StatusCode redirect,
String location) |
Context |
Context.sendRedirect(StatusCode redirect,
String location)
Send a redirect response.
|
Context |
ForwardingContext.sendRedirect(String location) |
default Context |
DefaultContext.sendRedirect(String location) |
Context |
Context.sendRedirect(String location)
Send a
302 response. |
Context |
ForwardingContext.setDefaultResponseType(MediaType contentType) |
Context |
Context.setDefaultResponseType(MediaType contentType)
Set the default response content type header.
|
Context |
ForwardingContext.setPathMap(Map<String,String> pathMap) |
Context |
Context.setPathMap(Map<String,String> pathMap)
Set path map.
|
Context |
ForwardingContext.setResponseCode(int statusCode) |
Context |
Context.setResponseCode(int statusCode)
Set response status code.
|
Context |
ForwardingContext.setResponseCode(StatusCode statusCode) |
default Context |
DefaultContext.setResponseCode(StatusCode statusCode) |
Context |
Context.setResponseCode(StatusCode statusCode)
Set response status code.
|
Context |
ForwardingContext.setResponseCookie(Cookie cookie) |
Context |
Context.setResponseCookie(Cookie cookie)
Set/add a cookie to response.
|
Context |
ForwardingContext.setResponseHeader(String name,
Date value) |
default Context |
DefaultContext.setResponseHeader(String name,
Date value) |
Context |
Context.setResponseHeader(String name,
Date value)
Set response header.
|
Context |
ForwardingContext.setResponseHeader(String name,
Instant value) |
default Context |
DefaultContext.setResponseHeader(String name,
Instant value) |
Context |
Context.setResponseHeader(String name,
Instant value)
Set response header.
|
Context |
ForwardingContext.setResponseHeader(String name,
Object value) |
default Context |
DefaultContext.setResponseHeader(String name,
Object value) |
Context |
Context.setResponseHeader(String name,
Object value)
Set response header.
|
Context |
ForwardingContext.setResponseHeader(String name,
String value) |
Context |
Context.setResponseHeader(String name,
String value)
Set response header.
|
Context |
ForwardingContext.setResponseLength(long length) |
Context |
Context.setResponseLength(long length)
Set response content length header.
|
Context |
ForwardingContext.setResponseType(MediaType contentType) |
default Context |
DefaultContext.setResponseType(MediaType contentType) |
Context |
Context.setResponseType(MediaType contentType)
Set response content type header.
|
Context |
ForwardingContext.setResponseType(MediaType contentType,
Charset charset) |
Context |
Context.setResponseType(MediaType contentType,
Charset charset)
Set response content type header.
|
Context |
ForwardingContext.setResponseType(String contentType) |
Context |
Context.setResponseType(String contentType)
Set response content type header.
|
Context |
ForwardingContext.setRoute(Route route) |
Context |
Context.setRoute(Route route)
Set matching route.
|
Modifier and Type | Method and Description |
---|---|
Object |
AssetHandler.apply(Context ctx) |
ByteRange |
ByteRange.apply(Context ctx)
For partial request this method set the following byte range response headers:
- Accept-Ranges
- Content-Range
- Content-Length
For not satisfiable requests:
- Throws a
StatusCode.REQUESTED_RANGE_NOT_SATISFIABLE
Otherwise this method does nothing. |
void |
Route.Before.apply(Context ctx)
Execute application code before next handler.
|
Object |
Route.Handler.apply(Context ctx)
Execute application code.
|
void |
Route.After.apply(Context ctx,
Object result)
Execute application logic on a route response.
|
void |
ErrorHandler.apply(Context ctx,
Throwable cause,
StatusCode statusCode)
Produces an error response using the given exception and status code.
|
static FlashMap |
FlashMap.create(Context ctx,
Cookie template)
Creates a new flash-scope using the given cookie.
|
static Session |
Session.create(Context context,
Session session)
Creates a new session and attach it to current request.
|
<T> T |
MessageDecoder.decode(Context ctx,
Type type)
Parse HTTP body into the given type.
|
void |
SessionId.deleteSessionId(Context ctx,
String sessionId)
Delete session ID in the web context.
|
byte[] |
MessageEncoder.encode(Context ctx,
Object value)
MessageEncoder a value into a byte array or
null if given object isn't supported it. |
default byte[] |
TemplateEngine.encode(Context ctx,
Object value) |
static String |
ErrorHandler.errorMessage(Context ctx,
StatusCode statusCode)
Build a line error message that describe the current web context and the status code.
|
void |
Router.Match.execute(Context context) |
String |
SessionId.findSessionId(Context ctx)
Find session ID.
|
Router.Match |
Router.match(Context ctx)
Find a matching route using the given context.
|
Router.Match |
Jooby.match(Context ctx) |
void |
Sender.Callback.onComplete(Context ctx,
Throwable cause)
Callback after for
write operation. |
String |
TemplateEngine.render(Context ctx,
ModelAndView modelAndView)
Render a model and view instance as String.
|
void |
SessionId.saveSessionId(Context ctx,
String sessionId)
Save session ID in the web context.
|
Modifier and Type | Method and Description |
---|---|
Router |
Router.use(Predicate<Context> predicate,
Router router)
Import routes from given router.
|
Jooby |
Jooby.use(Predicate<Context> predicate,
Router router) |
Constructor and Description |
---|
ForwardingContext(Context context)
Creates a new forwarding context.
|
Copyright © 2019. All rights reserved.