Package org.yamcs.http
Class HandlerContext
- java.lang.Object
-
- org.yamcs.http.HandlerContext
-
public class HandlerContext extends Object
-
-
Constructor Summary
Constructors Constructor Description HandlerContext(String contextPath, io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest req)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.buffer.ByteBufcreateByteBuf()String[]getBasicCredentials()StringgetContextPath()StringgetCredentials(String type)StringgetFormParameter(String parameter)StringgetHeader(CharSequence name)io.netty.channel.ChannelHandlerContextgetNettyChannelHandlerContext()io.netty.handler.codec.http.FullHttpRequestgetNettyFullHttpRequest()StringgetParameter(String parameter)StringgetPathWithoutContext()StringgetQueryParameter(String parameter)booleanisFormEncoded()booleanisGET()booleanisPOST()voidrender(io.netty.handler.codec.http.HttpResponseStatus status, String templateResource, Map<String,Object> vars)voidrenderOK(String templateResource, Map<String,Object> vars)StringrenderToString(String templateResource, Map<String,Object> vars)voidrequireFormEncoding()StringrequireFormParameter(String parameter)voidrequireGET()voidrequireMethod(io.netty.handler.codec.http.HttpMethod... allowedMethods)StringrequireParameter(String parameter)voidrequirePOST()StringrequireQueryParameter(String parameter)voidsendOK()voidsendOK(com.google.protobuf.Message message)voidsendRedirect(String location)io.netty.channel.ChannelFuturesendResponse(io.netty.handler.codec.http.HttpResponse response)
-
-
-
Constructor Detail
-
HandlerContext
public HandlerContext(String contextPath, io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest req)
-
-
Method Detail
-
getNettyChannelHandlerContext
public io.netty.channel.ChannelHandlerContext getNettyChannelHandlerContext()
-
getNettyFullHttpRequest
public io.netty.handler.codec.http.FullHttpRequest getNettyFullHttpRequest()
-
getContextPath
public String getContextPath()
-
getPathWithoutContext
public String getPathWithoutContext()
-
isGET
public boolean isGET()
-
isPOST
public boolean isPOST()
-
requireGET
public void requireGET()
-
requirePOST
public void requirePOST()
-
requireMethod
public void requireMethod(io.netty.handler.codec.http.HttpMethod... allowedMethods)
-
requireFormEncoding
public void requireFormEncoding()
-
getHeader
public String getHeader(CharSequence name)
-
isFormEncoded
public boolean isFormEncoded()
-
getBasicCredentials
public String[] getBasicCredentials()
-
createByteBuf
public io.netty.buffer.ByteBuf createByteBuf()
-
render
public void render(io.netty.handler.codec.http.HttpResponseStatus status, String templateResource, Map<String,Object> vars)
-
sendOK
public void sendOK()
-
sendOK
public void sendOK(com.google.protobuf.Message message)
-
sendResponse
public io.netty.channel.ChannelFuture sendResponse(io.netty.handler.codec.http.HttpResponse response)
-
sendRedirect
public void sendRedirect(String location)
-
-