public class NettyContext extends Object implements DefaultContext, io.netty.channel.ChannelFutureListener
ACCEPT, GMT, RFC1123, RFC1123_PATTERN
Constructor and Description |
---|
NettyContext(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
Router router,
String path,
int bufferSize) |
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, getHost, getRequestLength, getRequestType, getRequestType, headerMap, headerMultimap, multipart, multipart, multipartMap, multipartMultimap, path, path, path, query, query, queryMap, queryMultimap, queryString, render, require, require, require, responseStream, responseStream, responseStream, responseWriter, responseWriter, responseWriter, responseWriter, responseWriter, send, send, sendError, sendError, sendRedirect, sendRedirect, session, session, sessionOrNull, setResponseCode, setResponseHeader, setResponseHeader, setResponseHeader, setResponseType
getContextPath, readOnly, websocket
@Nonnull public Map<String,Object> getAttributes()
getAttributes
in interface Context
@Nonnull public final String pathString()
pathString
in interface Context
@Nonnull public Context setPathMap(@Nonnull Map<String,String> pathMap)
setPathMap
in interface Context
public final boolean isInIoThread()
isInIoThread
in interface Context
@Nonnull public Context detach(@Nonnull Route.Handler next) throws Exception
@Nonnull public QueryString query()
@Nonnull public Value header(@Nonnull String name)
header
in interface Context
header
in interface DefaultContext
@Nonnull public String getRemoteAddress()
getRemoteAddress
in interface Context
@Nonnull public String getProtocol()
getProtocol
in interface Context
@Nonnull public Context upgrade(WebSocket.Initializer handler)
@Nonnull public StatusCode getResponseCode()
getResponseCode
in interface Context
@Nonnull public Context setResponseCode(int statusCode)
setResponseCode
in interface Context
@Nonnull public Context setResponseHeader(@Nonnull String name, @Nonnull String value)
setResponseHeader
in interface Context
@Nonnull public Context removeResponseHeader(@Nonnull String name)
removeResponseHeader
in interface Context
@Nonnull public Context removeResponseHeaders()
removeResponseHeaders
in interface Context
@Nonnull public MediaType getResponseType()
getResponseType
in interface Context
@Nonnull public Context setDefaultResponseType(@Nonnull MediaType contentType)
setDefaultResponseType
in interface Context
public final Context setResponseType(MediaType contentType, Charset charset)
setResponseType
in interface Context
@Nonnull public Context setResponseType(@Nonnull String contentType)
setResponseType
in interface Context
@Nonnull public Context setResponseLength(long length)
setResponseLength
in interface Context
public long getResponseLength()
getResponseLength
in interface Context
@Nonnull public Context setResponseCookie(@Nonnull Cookie cookie)
setResponseCookie
in interface Context
@Nonnull public PrintWriter responseWriter(MediaType type, Charset charset)
responseWriter
in interface Context
@Nonnull public Sender responseSender()
responseSender
in interface Context
@Nonnull public OutputStream responseStream()
responseStream
in interface Context
@Nonnull public Context send(@Nonnull String data)
send
in interface Context
send
in interface DefaultContext
@Nonnull public Context send(@Nonnull byte[]... data)
send
in interface Context
send
in interface DefaultContext
@Nonnull public Context send(@Nonnull ByteBuffer[] data)
public final Context send(ByteBuffer data)
public void flush()
@Nonnull public Context send(@Nonnull ReadableByteChannel channel)
@Nonnull public Context send(@Nonnull FileChannel file)
public boolean isResponseStarted()
isResponseStarted
in interface Context
public boolean getResetHeadersOnError()
getResetHeadersOnError
in interface Context
public Context setResetHeadersOnError(boolean value)
setResetHeadersOnError
in interface Context
@Nonnull public Context send(StatusCode statusCode)
public void operationComplete(io.netty.channel.ChannelFuture future)
operationComplete
in interface io.netty.util.concurrent.GenericFutureListener<io.netty.channel.ChannelFuture>
Copyright © 2019. All rights reserved.