java.lang.Object
org.yamcs.http.HandlerContext
-
Constructor Summary
ConstructorsConstructorDescriptionHandlerContext(String contextPath, io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest req) -
Method Summary
Modifier and TypeMethodDescriptionio.netty.buffer.ByteBufString[]getCredentials(String type) getFormParameter(String parameter) getHeader(CharSequence name) io.netty.channel.ChannelHandlerContextio.netty.handler.codec.http.FullHttpRequestgetParameter(String parameter) getQueryParameter(String parameter) Attempts to derive the externally used URL to Yamcs based on request informationbooleanbooleanisGET()booleanisPOST()voidrender(io.netty.handler.codec.http.HttpResponseStatus status, String templateResource, Map<String, Object> vars) voidrenderToString(String templateResource, Map<String, Object> vars) voidrequireFormParameter(String parameter) voidvoidrequireMethod(io.netty.handler.codec.http.HttpMethod... allowedMethods) requireParameter(String parameter) voidrequireQueryParameter(String parameter) voidsendOK()voidsendOK(com.google.gson.JsonObject jsonObject) voidsendOK(com.google.protobuf.Message message) voidsendRedirect(String location) io.netty.channel.ChannelFuturesendResponse(io.netty.handler.codec.http.HttpResponse response)
-
Constructor Details
-
HandlerContext
public HandlerContext(String contextPath, io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest req)
-
-
Method Details
-
getRequestBaseURL
Attempts to derive the externally used URL to Yamcs based on request information- Returns:
- a url of the form [protocol]://[host]:[port][context]
-
getNettyChannelHandlerContext
public io.netty.channel.ChannelHandlerContext getNettyChannelHandlerContext() -
getNettyFullHttpRequest
public io.netty.handler.codec.http.FullHttpRequest getNettyFullHttpRequest() -
getContextPath
-
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() -
requireFormParameter
-
requireQueryParameter
-
requireParameter
-
getHeader
-
isFormEncoded
public boolean isFormEncoded() -
getCredentials
-
getBasicCredentials
-
getFormParameter
-
getQueryParameter
-
getParameter
-
createByteBuf
public io.netty.buffer.ByteBuf createByteBuf() -
renderOK
-
render
-
renderToString
-
sendOK
public void sendOK() -
sendOK
public void sendOK(com.google.protobuf.Message message) -
sendOK
public void sendOK(com.google.gson.JsonObject jsonObject) -
sendResponse
public io.netty.channel.ChannelFuture sendResponse(io.netty.handler.codec.http.HttpResponse response) -
sendRedirect
-