Class DefaultWebRequestContext
java.lang.Object
io.fluxzero.sdk.web.DefaultWebRequestContext
- All Implemented Interfaces:
WebRequestContext
Default implementation of
WebRequestContext for Fluxzero web request messages.
This context exposes the request path, origin, and parameter sources needed by web handler resolution without depending on an external HTTP router implementation.
-
Method Summary
Modifier and TypeMethodDescriptionReturns request cookie values indexed by cookie name.static DefaultWebRequestContextReturns the currentDefaultWebRequestContextfrom the activeDeserializingMessage, ornullif no such message is available.Returns parsed form parameter values grouped by name, parsing the body on demand.Map<String, List<WebFormPart>> Returns parsed multipart form parts grouped by name, parsing the body on demand.com.fasterxml.jackson.databind.JsonNodeReturns the JSON representation of the request body, parsing it on demand.io.fluxzero.common.api.MetadataReturns the request message metadata.getParameter(String name, WebParameterSource... sources) Retrieves the value of a specified parameter from the given sources in a web request.Returns the route parameter map, equivalent topathMap().Returns parsed query parameter values grouped by name.getUri()Returns the parsed request URI.static DefaultWebRequestContextgetWebRequestContext(DeserializingMessage message) Creates or retrieves aDefaultWebRequestContextfrom the givenDeserializingMessage.booleanReturns whether the request path matches the supplied route pattern.booleanmatchesAny(Collection<String> urlPatterns) Returns whether the request path matches any supplied route pattern.pathMap()Returns the route parameter values currently bound to this request.setPathMap(Map<String, String> pathMap) Replaces route parameter bindings with a copy of the supplied map and returns this context.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface WebRequestContext
getBodyParameter, getCookieParameter, getFormParameter, getHeaderParameter, getParameter, getPathParameter, getQueryParameter
-
Method Details
-
getCurrentWebRequestContext
Returns the currentDefaultWebRequestContextfrom the activeDeserializingMessage, ornullif no such message is available. -
getWebRequestContext
Creates or retrieves aDefaultWebRequestContextfrom the givenDeserializingMessage. -
pathMap
-
getMetadata
public io.fluxzero.common.api.Metadata getMetadata()Returns the request message metadata. -
getUri
Returns the parsed request URI. -
getPathMap
-
getQueryParameters
-
getCookieMap
-
getFormParameters
-
getFormParts
Returns parsed multipart form parts grouped by name, parsing the body on demand. -
getJsonBody
public com.fasterxml.jackson.databind.JsonNode getJsonBody()Returns the JSON representation of the request body, parsing it on demand. -
setPathMap
Replaces route parameter bindings with a copy of the supplied map and returns this context. -
getParameter
Description copied from interface:WebRequestContextRetrieves the value of a specified parameter from the given sources in a web request.- Specified by:
getParameterin interfaceWebRequestContext- Parameters:
name- the name of the parameter to retrieve. Must not be null.sources- the sources to look for the parameter, such as PATH, QUERY, HEADER, COOKIE, or FORM. If no sources are provided, the method may default to a predefined set of sources.- Returns:
- the
ParameterValueassociated with the specified parameter name and sources, or an emptyParameterValueif the parameter is not found.
-
matches
Returns whether the request path matches the supplied route pattern. -
matchesAny
Returns whether the request path matches any supplied route pattern.
-