public class NWebCallContextImpl extends Object implements NWebCallContext
| Constructor and Description |
|---|
NWebCallContextImpl(NWebContext webContext,
com.sun.net.httpserver.HttpExchange httpExchange) |
public NWebCallContextImpl(NWebContext webContext, com.sun.net.httpserver.HttpExchange httpExchange)
public void initializeConfig()
initializeConfig in interface NWebCallContextpublic NWebContext getWebContext()
getWebContext in interface NWebCallContextpublic NWebCallContext addResponseHeader(String name, String value)
addResponseHeader in interface NWebCallContextpublic NWebCallContext setResponseHeader(String name, String value)
setResponseHeader in interface NWebCallContextpublic net.thevpc.nuts.net.NHttpCode getResponseCode()
getResponseCode in interface NWebCallContextpublic NWebCallContext setResponseCode(net.thevpc.nuts.net.NHttpCode responseCode)
setResponseCode in interface NWebCallContextpublic Map<String,List<String>> getRequestHeaders()
getRequestHeaders in interface NWebCallContextpublic URI getRequestURI()
getRequestURI in interface NWebCallContextpublic com.sun.net.httpserver.HttpServer getServer()
public String getFirstPath()
getFirstPath in interface NWebCallContextpublic boolean isEmptyPath()
isEmptyPath in interface NWebCallContextpublic int getPathSize()
getPathSize in interface NWebCallContextpublic String[] getPathParts()
getPathParts in interface NWebCallContextpublic String getPathPart(int pos)
getPathPart in interface NWebCallContextpublic <T> T getRequestBodyAs(Class<T> cl)
getRequestBodyAs in interface NWebCallContextpublic <T> T getRequestBodyAs(Class<T> cl, net.thevpc.nuts.text.NContentType contentType)
getRequestBodyAs in interface NWebCallContextpublic String getRequestBodyAsString()
getRequestBodyAsString in interface NWebCallContextpublic String getPath()
getPath in interface NWebCallContextpublic NWebHttpException wrapException(Throwable ex)
wrapException in interface NWebCallContextprotected NWebHttpException customWrapException(Throwable ex)
public NWebCallContext setResponseContentType(String contentType)
setResponseContentType in interface NWebCallContextpublic NWebCallContext setErrorCode(net.thevpc.nuts.text.NMsgCode errorCode)
setErrorCode in interface NWebCallContextpublic NWebCallContext sendResponseHeaders()
sendResponseHeaders in interface NWebCallContextpublic NWebCallContext sendResponseContent(byte[] bytes)
public NWebCallContext sendResponseContent(InputStream stream)
public OutputStream getResponseBody()
getResponseBody in interface NWebCallContextpublic net.thevpc.nuts.net.NHttpMethod getMethod()
getMethod in interface NWebCallContextpublic NWebCallContext requireAuth()
requireAuth in interface NWebCallContextpublic NWebCallContext info(net.thevpc.nuts.text.NMsg msg)
info in interface NWebCallContextpublic NWebCallContext error(net.thevpc.nuts.text.NMsg msg)
error in interface NWebCallContextpublic NWebCallContext trace(NHttpLogMsg d)
trace in interface NWebCallContextpublic NWebCallContext requireMethod(net.thevpc.nuts.net.NHttpMethod... m)
requireMethod in interface NWebCallContextpublic NWebCallContext throwNoFound()
throwNoFound in interface NWebCallContextpublic NWebPrincipal getPrincipal()
getPrincipal in interface NWebCallContextpublic net.thevpc.nuts.util.NOptional<NWebUser> getUser()
getUser in interface NWebCallContextpublic NWebCallContext setUser(NWebUser user)
setUser in interface NWebCallContextpublic net.thevpc.nuts.util.NOptional<NWebToken> getToken()
getToken in interface NWebCallContextpublic NWebCallContext setToken(NWebToken token)
setToken in interface NWebCallContextpublic NWebCallContext runWithUnsafe(net.thevpc.nuts.concurrent.NUnsafeRunnable callable) throws Throwable
runWithUnsafe in interface NWebCallContextThrowablepublic Map<String,List<String>> getQueryParams()
getQueryParams in interface NWebCallContextpublic net.thevpc.nuts.util.NOptional<String> getQueryParam(String queryParam)
getQueryParam in interface NWebCallContextpublic boolean containsQueryParam(String queryParam)
containsQueryParam in interface NWebCallContextpublic List<String> getRequestHeaders(String header)
getRequestHeaders in interface NWebCallContextpublic net.thevpc.nuts.util.NOptional<String> getRequestHeader(String header)
getRequestHeader in interface NWebCallContextpublic net.thevpc.nuts.util.NOptional<String> getApiKeyRequestHeader()
getApiKeyRequestHeader in interface NWebCallContextpublic net.thevpc.nuts.util.NOptional<String> getRealmRequestHeader()
getRealmRequestHeader in interface NWebCallContextpublic Map<String,FormDataItem> getFormDataMap()
getFormDataMap in interface NWebCallContextpublic boolean isBoundaryLine(MixedInputStream.Line bline, String boundary)
public InputStream getRequestBody()
getRequestBody in interface NWebCallContextpublic net.thevpc.nuts.util.NOptional<FormDataItem> getFormData(String name)
getFormData in interface NWebCallContextpublic boolean isMultipartRequest()
isMultipartRequest in interface NWebCallContextpublic net.thevpc.nuts.util.NOptional<String> getMultipartRequestBoundary()
getMultipartRequestBoundary in interface NWebCallContextpublic NWebCallContext setTextResponse(String value)
setTextResponse in interface NWebCallContextpublic NWebCallContext setXmlResponse(String value)
setXmlResponse in interface NWebCallContextpublic NWebCallContext setErrorResponse(NWebHttpException ex)
setErrorResponse in interface NWebCallContextpublic NWebCallContext setErrorResponse(Throwable ex)
setErrorResponse in interface NWebCallContextpublic NWebCallContext setJsonResponse(Object value)
setJsonResponse in interface NWebCallContextpublic NWebCallContext setBytesResponse(byte[] value)
setBytesResponse in interface NWebCallContextpublic NWebCallContext setFileResponse(net.thevpc.nuts.io.NPath value)
setFileResponse in interface NWebCallContextpublic NWebCallContext setErrorResponse(net.thevpc.nuts.text.NMsgCode errorCode)
setErrorResponse in interface NWebCallContextpublic NWebCallContext sendResponse()
sendResponse in interface NWebCallContextpublic void close()
close in interface AutoCloseableclose in interface NWebCallContextpublic boolean isResponseSent()
isResponseSent in interface NWebCallContextpublic NLoginResult authenticateWithCredentials(NAuthenticationRequest authenticationRequest)
authenticateWithCredentials in interface NWebCallContextpublic NWebUser authenticateWithAccessToken(String accessToken)
authenticateWithAccessToken in interface NWebCallContextpublic NLoginResult authenticateWithRefreshToken(String refreshToken)
authenticateWithRefreshToken in interface NWebCallContextpublic Consumer<NHttpLogMsg> getTracer()
public NWebCallContextImpl setTracer(Consumer<NHttpLogMsg> tracer)
Copyright © 2026 vpc open source initiative. All rights reserved.