Package | Description |
---|---|
io.jooby | |
io.jooby.internal |
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 |
WebSocket.getContext()
Originating HTTP context.
|
static Context |
Context.readOnly(Context ctx)
Wrap a HTTP context and make read only.
|
Context |
ForwardingContext.removeResponseHeader(String name) |
Context |
Context.removeResponseHeader(String name)
Remove a response header.
|
Context |
ForwardingContext.removeResponseHeaders() |
Context |
Context.removeResponseHeaders()
Clear/reset all the headers, including cookies.
|
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) |
default Context |
DefaultContext.send(byte[]... data) |
Context |
Context.send(byte[]... data)
Send response data.
|
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(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.setResetHeadersOnError(boolean value) |
Context |
Context.setResetHeadersOnError(boolean value)
Set whenever reset/clear headers on application error.
|
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.
|
Context |
ForwardingContext.upgrade(WebSocket.Initializer handler) |
Context |
Context.upgrade(WebSocket.Initializer handler)
Perform a websocket handsake and upgrade a HTTP GET into a websocket protocol.
|
static Context |
Context.websocket(Context ctx,
WebSocket ws)
Wrap a HTTP context and make it WebSocket friendly.
|
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 |
SSLHandler.apply(Context ctx) |
void |
Route.After.apply(Context ctx,
Object result,
Throwable failure)
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 ValueNode |
Value.array(Context ctx,
String name,
List<String> values)
Creates a sequence/array of values.
|
static Multipart |
Multipart.create(Context ctx)
Creates a new multipart object.
|
static Formdata |
Formdata.create(Context ctx)
Creates a formdata object.
|
static WebSocketMessage |
WebSocketMessage.create(Context ctx,
byte[] bytes)
Creates a websocket message.
|
static FlashMap |
FlashMap.create(Context ctx,
Cookie template)
Creates a new flash-scope using the given cookie.
|
static WebSocketMessage |
WebSocketMessage.create(Context ctx,
String message)
Creates a websocket message.
|
static Session |
Session.create(Context ctx,
String id)
Creates a new session.
|
static QueryString |
QueryString.create(Context ctx,
String queryString)
Query string hash value.
|
static ValueNode |
Value.create(Context ctx,
String name,
List<String> values)
Creates a value that fits better with the given values.
|
static Session |
Session.create(Context ctx,
String id,
Map<String,String> data)
Creates a new session.
|
static ValueNode |
Value.create(Context ctx,
String name,
String value)
Creates a value that fits better with the given values.
|
<T> T |
MessageDecoder.decode(Context ctx,
Type type)
Parse HTTP body into the given type.
|
void |
SessionStore.deleteSession(Context ctx,
Session session)
Delete a session from store.
|
void |
SessionToken.deleteToken(Context ctx,
String token)
Delete session ID in the web context.
|
void |
SessionToken.CookieID.deleteToken(Context ctx,
String token) |
void |
SessionToken.HeaderID.deleteToken(Context ctx,
String token) |
void |
SessionToken.SignedCookie.deleteToken(Context ctx,
String token) |
static Body |
Body.empty(Context ctx)
Empty body.
|
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) |
Session |
SessionStore.findSession(Context ctx)
Find an existing session by ID.
|
String |
SessionToken.findToken(Context ctx)
Find session ID.
|
String |
SessionToken.CookieID.findToken(Context ctx) |
String |
SessionToken.HeaderID.findToken(Context ctx) |
String |
SessionToken.SignedCookie.findToken(Context ctx) |
static ValueNode |
Value.hash(Context ctx,
Map<String,Collection<String>> values)
Create a hash/object value using the map values.
|
void |
WebSocket.Initializer.init(Context ctx,
WebSocketConfigurer configurer)
Callback with a readonly context and websocket configurer.
|
Router.Match |
Router.match(Context ctx)
Find a matching route using the given context.
|
Router.Match |
Jooby.match(Context ctx) |
Session |
SessionStore.newSession(Context ctx)
Creates a new session.
|
static Body |
Body.of(Context ctx,
byte[] bytes)
Creates a HTTP body from byte array.
|
static Body |
Body.of(Context ctx,
InputStream stream,
long size)
Creates a HTTP body from input stream.
|
static Body |
Body.of(Context ctx,
Path file)
Creates a HTTP body from file.
|
void |
Sender.Callback.onComplete(Context ctx,
Throwable cause)
Callback after for
write operation. |
static Context |
Context.readOnly(Context ctx)
Wrap a HTTP context and make read only.
|
String |
TemplateEngine.render(Context ctx,
ModelAndView modelAndView)
Render a model and view instance as String.
|
void |
SessionStore.saveSession(Context ctx,
Session session)
Save a session.
|
void |
SessionToken.saveToken(Context ctx,
String token)
Save session ID in the web context.
|
void |
SessionToken.CookieID.saveToken(Context ctx,
String token) |
void |
SessionToken.HeaderID.saveToken(Context ctx,
String token) |
void |
SessionToken.SignedCookie.saveToken(Context ctx,
String token) |
void |
SessionStore.touchSession(Context ctx,
Session session)
Session attributes/state has changed.
|
static ValueNode |
Value.value(Context ctx,
String name,
String value)
Creates a single value.
|
static Context |
Context.websocket(Context ctx,
WebSocket ws)
Wrap a HTTP context and make it WebSocket friendly.
|
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.
|
Modifier and Type | Class and Description |
---|---|
class |
HeadContext |
class |
ReadOnlyContext |
class |
WebSocketSender |
Modifier and Type | Method and Description |
---|---|
Context |
ReadOnlyContext.removeResponseHeader(String name) |
Context |
HeadContext.render(Object value) |
Context |
ReadOnlyContext.render(Object value) |
Context |
WebSocketSender.render(Object value) |
Context |
ReadOnlyContext.responseStream(MediaType contentType,
SneakyThrows.Consumer<OutputStream> consumer) |
Context |
ReadOnlyContext.responseStream(SneakyThrows.Consumer<OutputStream> consumer) |
Context |
ReadOnlyContext.responseWriter(MediaType contentType,
Charset charset,
SneakyThrows.Consumer<PrintWriter> consumer) |
Context |
ReadOnlyContext.responseWriter(MediaType contentType,
SneakyThrows.Consumer<PrintWriter> consumer) |
Context |
ReadOnlyContext.responseWriter(SneakyThrows.Consumer<PrintWriter> consumer) |
Context |
HeadContext.send(AttachedFile file) |
Context |
ReadOnlyContext.send(AttachedFile file) |
Context |
HeadContext.send(byte[] data) |
Context |
ReadOnlyContext.send(byte[] data) |
Context |
WebSocketSender.send(byte[] data) |
Context |
HeadContext.send(ByteBuffer data) |
Context |
ReadOnlyContext.send(ByteBuffer data) |
Context |
HeadContext.send(FileChannel file) |
Context |
ReadOnlyContext.send(FileChannel file) |
Context |
HeadContext.send(InputStream input) |
Context |
ReadOnlyContext.send(InputStream input) |
Context |
HeadContext.send(Path file) |
Context |
ReadOnlyContext.send(Path file) |
Context |
HeadContext.send(ReadableByteChannel channel) |
Context |
ReadOnlyContext.send(ReadableByteChannel channel) |
Context |
HeadContext.send(StatusCode statusCode) |
Context |
ReadOnlyContext.send(StatusCode statusCode) |
Context |
HeadContext.send(String data) |
Context |
ReadOnlyContext.send(String data) |
Context |
HeadContext.send(String data,
Charset charset) |
Context |
ReadOnlyContext.send(String data,
Charset charset) |
Context |
WebSocketSender.send(String data,
Charset charset) |
Context |
ReadOnlyContext.sendError(Throwable cause) |
Context |
ReadOnlyContext.sendError(Throwable cause,
StatusCode statusCode) |
Context |
ReadOnlyContext.sendRedirect(StatusCode redirect,
String location) |
Context |
ReadOnlyContext.sendRedirect(String location) |
Context |
ReadOnlyContext.setDefaultResponseType(MediaType contentType) |
Context |
WebSocketSender.setDefaultResponseType(MediaType contentType) |
Context |
WebSocketSender.setResetHeadersOnError(boolean value) |
Context |
ReadOnlyContext.setResponseCode(int statusCode) |
Context |
WebSocketSender.setResponseCode(int statusCode) |
Context |
ReadOnlyContext.setResponseCode(StatusCode statusCode) |
Context |
WebSocketSender.setResponseCode(StatusCode statusCode) |
Context |
ReadOnlyContext.setResponseCookie(Cookie cookie) |
Context |
WebSocketSender.setResponseCookie(Cookie cookie) |
Context |
ReadOnlyContext.setResponseHeader(String name,
Date value) |
Context |
WebSocketSender.setResponseHeader(String name,
Date value) |
Context |
ReadOnlyContext.setResponseHeader(String name,
Instant value) |
Context |
WebSocketSender.setResponseHeader(String name,
Instant value) |
Context |
ReadOnlyContext.setResponseHeader(String name,
Object value) |
Context |
WebSocketSender.setResponseHeader(String name,
Object value) |
Context |
ReadOnlyContext.setResponseHeader(String name,
String value) |
Context |
WebSocketSender.setResponseHeader(String name,
String value) |
Context |
ReadOnlyContext.setResponseLength(long length) |
Context |
WebSocketSender.setResponseLength(long length) |
Context |
ReadOnlyContext.setResponseType(MediaType contentType) |
Context |
WebSocketSender.setResponseType(MediaType contentType) |
Context |
ReadOnlyContext.setResponseType(MediaType contentType,
Charset charset) |
Context |
WebSocketSender.setResponseType(MediaType contentType,
Charset charset) |
Context |
ReadOnlyContext.setResponseType(String contentType) |
Context |
WebSocketSender.setResponseType(String contentType) |
Modifier and Type | Method and Description |
---|---|
Object |
HeadResponseHandler.apply(Context ctx) |
ByteRange |
NoByteRange.apply(Context ctx) |
ByteRange |
NotSatisfiableByteRange.apply(Context ctx) |
ByteRange |
SingleByteRange.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 |
SignedSessionStore.deleteSession(Context ctx,
Session session) |
void |
MemorySessionStore.deleteSession(Context ctx,
Session session) |
void |
MultipleSessionToken.deleteToken(Context ctx,
String token) |
static Body |
ByteArrayBody.empty(Context ctx) |
byte[] |
HttpMessageEncoder.encode(Context ctx,
Object value) |
byte[] |
WebSocketEncoder.encode(Context ctx,
Object value) |
void |
RouterMatch.execute(Context context) |
Session |
SignedSessionStore.findSession(Context ctx) |
Session |
MemorySessionStore.findSession(Context ctx) |
String |
MultipleSessionToken.findToken(Context ctx) |
Router.Match |
RouterImpl.match(Context ctx) |
Session |
SignedSessionStore.newSession(Context ctx) |
Session |
MemorySessionStore.newSession(Context ctx) |
static QueryString |
UrlParser.queryString(Context ctx,
String queryString) |
void |
SignedSessionStore.saveSession(Context ctx,
Session session) |
void |
MemorySessionStore.saveSession(Context ctx,
Session session) |
void |
MultipleSessionToken.saveToken(Context ctx,
String token) |
void |
SignedSessionStore.touchSession(Context ctx,
Session session) |
void |
MemorySessionStore.touchSession(Context ctx,
Session session) |
Modifier and Type | Method and Description |
---|---|
Router |
RouterImpl.use(Predicate<Context> predicate,
Router router) |
Constructor and Description |
---|
ArrayValue(Context ctx,
String name) |
ByteArrayBody(Context ctx,
byte[] bytes) |
FileBody(Context ctx,
Path file) |
FlashMapImpl(Context ctx,
Cookie template) |
HashValue(Context ctx,
String name) |
HeadContext(Context context)
Creates a new forwarding context.
|
InputStreamBody(Context ctx,
InputStream stream,
long contentLength) |
MultipartNode(Context ctx,
String name) |
QueryStringValue(Context ctx,
String queryString) |
ReadOnlyContext(Context context) |
SessionImpl(Context ctx,
String id) |
SessionImpl(Context ctx,
String id,
Map<String,String> attributes) |
SingleValue(Context ctx,
String name,
String value) |
WebSocketMessageImpl(Context ctx,
byte[] bytes) |
WebSocketSender(Context context,
WebSocket ws) |
Copyright © 2019. All rights reserved.