java.lang.Object
org.yamcs.http.HandlerContext
-
Constructor Summary
ConstructorsConstructorDescriptionHandlerContext(String contextPath, io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest req, User user) -
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.FullHttpRequestio.netty.handler.codec.http.HttpRequestgetParameter(String parameter) getQueryParameter(String parameter) Attempts to derive the externally used URL to Yamcs based on request informationgetUser()booleanbooleanisGET()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) voidsendAllow(io.netty.handler.codec.http.HttpMethod... methods) voidsendOK()voidsendOK(com.google.gson.JsonObject jsonObject) voidsendOK(com.google.protobuf.Message message) voidsendRedirect(String location) voidsendResource(String resource) Send a classpath resource.io.netty.channel.ChannelFuturesendResponse(io.netty.handler.codec.http.HttpResponse response)
-
Constructor Details
-
HandlerContext
-
-
Method Details
-
getUser
-
getRequestBaseURL
Attempts to derive the externally used URL to Yamcs based on request information- Returns:
- a url of the form [protocol]://[host]:[port][context]
-
getOriginalHostAddress
-
getOriginalHostName
-
getNettyChannelHandlerContext
public io.netty.channel.ChannelHandlerContext getNettyChannelHandlerContext() -
getNettyHttpRequest
public io.netty.handler.codec.http.HttpRequest getNettyHttpRequest() -
getNettyFullHttpRequest
public io.netty.handler.codec.http.FullHttpRequest getNettyFullHttpRequest()- Throws:
ClassCastException- if this context does not contain a "full" HTTP request.
-
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) -
sendAllow
public void sendAllow(io.netty.handler.codec.http.HttpMethod... methods) -
sendResource
Send a classpath resource. -
sendResponse
public io.netty.channel.ChannelFuture sendResponse(io.netty.handler.codec.http.HttpResponse response) -
sendRedirect
-