public class WebSocketSender extends ForwardingContext implements DefaultContext
ACCEPT, GMT, PORT, RFC1123, RFC1123_PATTERN, SECURE_PORT
Constructor and Description |
---|
WebSocketSender(Context context,
WebSocket ws) |
Modifier and Type | Method and Description |
---|---|
Context |
render(Object value)
Render a value and send the response to client.
|
Context |
send(byte[] data)
Send response data.
|
Context |
send(String data,
Charset charset)
Send response data.
|
Context |
setDefaultResponseType(MediaType contentType)
Set the default response content type header.
|
Context |
setResetHeadersOnError(boolean value)
Set whenever reset/clear headers on application error.
|
Context |
setResponseCode(int statusCode)
Set response status code.
|
Context |
setResponseCode(StatusCode statusCode)
Set response status code.
|
Context |
setResponseCookie(Cookie cookie)
Set/add a cookie to response.
|
Context |
setResponseHeader(String name,
Date value)
Set response header.
|
Context |
setResponseHeader(String name,
Instant value)
Set response header.
|
Context |
setResponseHeader(String name,
Object value)
Set response header.
|
Context |
setResponseHeader(String name,
String value)
Set response header.
|
Context |
setResponseLength(long length)
Set response content length header.
|
Context |
setResponseType(MediaType contentType)
Set response content type header.
|
Context |
setResponseType(MediaType contentType,
Charset charset)
Set response content type header.
|
Context |
setResponseType(String contentType)
Set response content type header.
|
accept, accept, attribute, attribute, body, body, body, convert, cookie, cookieMap, decode, decoder, detach, dispatch, dispatch, file, files, files, flash, flash, form, form, form, formMap, formMultimap, forward, getAttributes, getHost, getHostAndPort, getMethod, getPort, getProtocol, getRemoteAddress, getRequestLength, getRequestPath, getRequestType, getRequestType, getRequestURL, getRequestURL, getResetHeadersOnError, getResponseCode, getResponseHeader, getResponseLength, getResponseType, getRoute, getRouter, getScheme, getServerHost, getServerPort, getUser, header, header, headerMap, headerMultimap, isInIoThread, isResponseStarted, isSecure, matches, multipart, multipart, multipart, multipartMap, multipartMultimap, onComplete, path, path, path, pathMap, query, query, query, queryMap, queryMultimap, queryString, removeResponseHeader, removeResponseHeaders, require, require, require, responseSender, responseStream, responseStream, responseStream, responseStream, responseWriter, responseWriter, responseWriter, responseWriter, responseWriter, responseWriter, send, send, send, send, send, send, send, send, send, send, sendError, sendError, sendRedirect, sendRedirect, session, session, sessionOrNull, setHost, setMethod, setPathMap, setPort, setRemoteAddress, setRequestPath, setRoute, setScheme, setUser, toString, upgrade, upgrade
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
accept, accept, attribute, attribute, body, body, convert, cookie, decode, decoder, file, files, files, flash, flash, form, form, formMap, formMultimap, forward, getHost, getHostAndPort, getPort, getRequestLength, getRequestType, getRequestType, getRequestURL, getRequestURL, getServerHost, getServerPort, getUser, header, headerMap, headerMultimap, isSecure, matches, multipart, multipart, multipartMap, multipartMultimap, path, path, path, query, query, queryMap, queryMultimap, queryString, require, require, require, responseStream, responseStream, responseStream, responseWriter, responseWriter, responseWriter, responseWriter, responseWriter, send, send, send, send, sendError, sendError, sendRedirect, sendRedirect, session, session, sessionOrNull, setUser
body, cookieMap, detach, dispatch, dispatch, form, getAttributes, getContextPath, getMethod, getProtocol, getRemoteAddress, getRequestPath, getResetHeadersOnError, getResponseCode, getResponseHeader, getResponseLength, getResponseType, getRoute, getRouter, getScheme, header, isInIoThread, isResponseStarted, multipart, onComplete, pathMap, query, readOnly, removeResponseHeader, removeResponseHeaders, responseSender, responseStream, responseWriter, send, send, send, send, send, send, setHost, setMethod, setPathMap, setPort, setRemoteAddress, setRequestPath, setRoute, setScheme, upgrade, upgrade, websocket
@Nonnull public Context send(@Nonnull String data, @Nonnull Charset charset)
Context
send
in interface Context
send
in class ForwardingContext
data
- Response.charset
- Charset.@Nonnull public Context send(@Nonnull byte[] data)
Context
send
in interface Context
send
in class ForwardingContext
data
- Response.@Nonnull public Context render(@Nonnull Object value)
Context
render
in interface Context
render
in interface DefaultContext
render
in class ForwardingContext
value
- Object value.public Context setResetHeadersOnError(boolean value)
Context
setResetHeadersOnError
in interface Context
setResetHeadersOnError
in class ForwardingContext
value
- True for reset/clear headers.@Nonnull public Context setDefaultResponseType(@Nonnull MediaType contentType)
Context
setDefaultResponseType
in interface Context
setDefaultResponseType
in class ForwardingContext
contentType
- Content type.@Nonnull public Context setResponseCode(int statusCode)
Context
setResponseCode
in interface Context
setResponseCode
in class ForwardingContext
statusCode
- Status code.@Nonnull public Context setResponseCode(@Nonnull StatusCode statusCode)
Context
setResponseCode
in interface Context
setResponseCode
in interface DefaultContext
setResponseCode
in class ForwardingContext
statusCode
- Status code.@Nonnull public Context setResponseCookie(@Nonnull Cookie cookie)
Context
setResponseCookie
in interface Context
setResponseCookie
in class ForwardingContext
cookie
- Cookie to add.@Nonnull public Context setResponseHeader(@Nonnull String name, @Nonnull String value)
Context
setResponseHeader
in interface Context
setResponseHeader
in class ForwardingContext
name
- Header name.value
- Header value.@Nonnull public Context setResponseHeader(@Nonnull String name, @Nonnull Date value)
Context
setResponseHeader
in interface Context
setResponseHeader
in interface DefaultContext
setResponseHeader
in class ForwardingContext
name
- Header name.value
- Header value.@Nonnull public Context setResponseHeader(@Nonnull String name, @Nonnull Object value)
Context
setResponseHeader
in interface Context
setResponseHeader
in interface DefaultContext
setResponseHeader
in class ForwardingContext
name
- Header name.value
- Header value.@Nonnull public Context setResponseHeader(@Nonnull String name, @Nonnull Instant value)
Context
setResponseHeader
in interface Context
setResponseHeader
in interface DefaultContext
setResponseHeader
in class ForwardingContext
name
- Header name.value
- Header value.@Nonnull public Context setResponseLength(long length)
Context
setResponseLength
in interface Context
setResponseLength
in class ForwardingContext
length
- Response length.@Nonnull public Context setResponseType(@Nonnull String contentType)
Context
setResponseType
in interface Context
setResponseType
in class ForwardingContext
contentType
- Content type.@Nonnull public Context setResponseType(@Nonnull MediaType contentType, @Nullable Charset charset)
Context
setResponseType
in interface Context
setResponseType
in class ForwardingContext
contentType
- Content type.charset
- Charset.@Nonnull public Context setResponseType(@Nonnull MediaType contentType)
Context
setResponseType
in interface Context
setResponseType
in interface DefaultContext
setResponseType
in class ForwardingContext
contentType
- Content type.Copyright © 2020. All rights reserved.