Package net.thevpc.nhttp.server.impl
Class NWebServerHttpContextImpl
java.lang.Object
net.thevpc.nhttp.server.impl.NWebServerHttpContextImpl
- All Implemented Interfaces:
NWebServerHttpContext
-
Constructor Summary
ConstructorsConstructorDescriptionNWebServerHttpContextImpl(com.sun.net.httpserver.HttpServer server, com.sun.net.httpserver.HttpExchange httpExchange, NWebUserResolver userResolver, net.thevpc.nuts.NSession session, NWebLogger logger) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsQueryParam(String queryParam) <T> Tnet.thevpc.nuts.web.NHttpMethodgetPath()getPathPart(int pos) String[]intgetQueryParam(String queryParam) com.sun.net.httpserver.HttpServernet.thevpc.nuts.NSessionnet.thevpc.nuts.util.NOptional<NWebToken>getToken()net.thevpc.nuts.util.NOptional<NWebUser>getUser()booleanrequireMethod(net.thevpc.nuts.web.NHttpMethod... m) runWithUnsafe(net.thevpc.nuts.util.NUnsafeRunnable callable) voidsendBytes(byte[] bytes, net.thevpc.nuts.web.NHttpCode code, NWebResponseHeaders headers) voidvoidvoidvoidsendJson(Object ex, NWebResponseHeaders headers) voidsendJson(Object ex, net.thevpc.nuts.web.NHttpCode code, NWebResponseHeaders headers) voidsendPlainText(String ex, net.thevpc.nuts.web.NHttpCode code, NWebResponseHeaders headers) voidvoidsendXml(String value, net.thevpc.nuts.web.NHttpCode code, NWebResponseHeaders headers) void
-
Constructor Details
-
NWebServerHttpContextImpl
public NWebServerHttpContextImpl(com.sun.net.httpserver.HttpServer server, com.sun.net.httpserver.HttpExchange httpExchange, NWebUserResolver userResolver, net.thevpc.nuts.NSession session, NWebLogger logger)
-
-
Method Details
-
getServer
public com.sun.net.httpserver.HttpServer getServer() -
getFirstPath
- Specified by:
getFirstPathin interfaceNWebServerHttpContext
-
isEmptyPath
public boolean isEmptyPath()- Specified by:
isEmptyPathin interfaceNWebServerHttpContext
-
getPathSize
public int getPathSize()- Specified by:
getPathSizein interfaceNWebServerHttpContext
-
getPathParts
- Specified by:
getPathPartsin interfaceNWebServerHttpContext
-
getPathPart
- Specified by:
getPathPartin interfaceNWebServerHttpContext
-
getSession
public net.thevpc.nuts.NSession getSession()- Specified by:
getSessionin interfaceNWebServerHttpContext
-
getBodyAs
- Specified by:
getBodyAsin interfaceNWebServerHttpContext
-
getBodyAsString
- Specified by:
getBodyAsStringin interfaceNWebServerHttpContext
-
sendPlainText
public void sendPlainText(String ex, net.thevpc.nuts.web.NHttpCode code, NWebResponseHeaders headers) - Specified by:
sendPlainTextin interfaceNWebServerHttpContext
-
sendXml
- Specified by:
sendXmlin interfaceNWebServerHttpContext
-
sendXml
- Specified by:
sendXmlin interfaceNWebServerHttpContext
-
sendJson
- Specified by:
sendJsonin interfaceNWebServerHttpContext
-
sendJson
- Specified by:
sendJsonin interfaceNWebServerHttpContext
-
sendJson
- Specified by:
sendJsonin interfaceNWebServerHttpContext
-
getPath
- Specified by:
getPathin interfaceNWebServerHttpContext
-
sendError
- Specified by:
sendErrorin interfaceNWebServerHttpContext
-
sendError
- Specified by:
sendErrorin interfaceNWebServerHttpContext
-
sendBytes
public void sendBytes(byte[] bytes, net.thevpc.nuts.web.NHttpCode code, NWebResponseHeaders headers) - Specified by:
sendBytesin interfaceNWebServerHttpContext
-
getMethod
public net.thevpc.nuts.web.NHttpMethod getMethod()- Specified by:
getMethodin interfaceNWebServerHttpContext
-
requireAuth
- Specified by:
requireAuthin interfaceNWebServerHttpContext
-
trace
- Specified by:
tracein interfaceNWebServerHttpContext
-
requireMethod
- Specified by:
requireMethodin interfaceNWebServerHttpContext
-
throwNoFound
- Specified by:
throwNoFoundin interfaceNWebServerHttpContext
-
getPrincipal
- Specified by:
getPrincipalin interfaceNWebServerHttpContext
-
getUser
- Specified by:
getUserin interfaceNWebServerHttpContext
-
setUser
- Specified by:
setUserin interfaceNWebServerHttpContext
-
getToken
- Specified by:
getTokenin interfaceNWebServerHttpContext
-
setToken
- Specified by:
setTokenin interfaceNWebServerHttpContext
-
runWithUnsafe
public NWebServerHttpContext runWithUnsafe(net.thevpc.nuts.util.NUnsafeRunnable callable) throws Throwable - Specified by:
runWithUnsafein interfaceNWebServerHttpContext- Throws:
Throwable
-
getQueryParams
- Specified by:
getQueryParamsin interfaceNWebServerHttpContext
-
getQueryParam
- Specified by:
getQueryParamin interfaceNWebServerHttpContext
-
containsQueryParam
- Specified by:
containsQueryParamin interfaceNWebServerHttpContext
-