Class ServletJaxrsHttpRequestAdaptor
- java.lang.Object
-
- io.roastedroot.proxywasm.jaxrs.internal.JaxrsHttpRequestAdaptor
-
- io.roastedroot.proxywasm.jaxrs.servlet.ServletJaxrsHttpRequestAdaptor
-
- All Implemented Interfaces:
io.roastedroot.proxywasm.internal.HttpRequestAdaptor
public class ServletJaxrsHttpRequestAdaptor extends io.roastedroot.proxywasm.jaxrs.internal.JaxrsHttpRequestAdaptorAJaxrsHttpRequestAdaptorspecifically designed to work with the Jakarta Servlet API based JAX-RS implementations.This adaptor implementation extracts request details (like remote/local addresses and ports, protocol) directly from the underlying
HttpServletRequestobject.
-
-
Constructor Summary
Constructors Constructor Description ServletJaxrsHttpRequestAdaptor(jakarta.servlet.http.HttpServletRequest request)Constructs a new adaptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringlocalAddress()Retrieves the local IP address from the underlyingHttpServletRequest.intlocalPort()Retrieves the local port from the underlyingHttpServletRequest.Stringprotocol()Retrieves the protocol string (e.g., "HTTP/1.1") from the underlyingHttpServletRequest.StringremoteAddress()Retrieves the remote IP address from the underlyingHttpServletRequest.intremotePort()Retrieves the remote port from the underlyingHttpServletRequest.-
Methods inherited from class io.roastedroot.proxywasm.jaxrs.internal.JaxrsHttpRequestAdaptor
getGrpcReceiveInitialMetaData, getGrpcReceiveTrailerMetaData, getHttpRequestHeaders, getHttpRequestTrailers, getHttpResponseHeaders, getHttpResponseTrailers, getProperty, getRequestContext, getResponseContext, setProperty, setRequestContext, setResponseContext
-
-
-
-
Method Detail
-
remoteAddress
public String remoteAddress()
Retrieves the remote IP address from the underlyingHttpServletRequest.- Specified by:
remoteAddressin interfaceio.roastedroot.proxywasm.internal.HttpRequestAdaptor- Overrides:
remoteAddressin classio.roastedroot.proxywasm.jaxrs.internal.JaxrsHttpRequestAdaptor- Returns:
- The remote IP address, or an empty string if the request object is null.
-
remotePort
public int remotePort()
Retrieves the remote port from the underlyingHttpServletRequest.- Specified by:
remotePortin interfaceio.roastedroot.proxywasm.internal.HttpRequestAdaptor- Overrides:
remotePortin classio.roastedroot.proxywasm.jaxrs.internal.JaxrsHttpRequestAdaptor- Returns:
- The remote port number, or 0 if the request object is null.
-
localAddress
public String localAddress()
Retrieves the local IP address from the underlyingHttpServletRequest.- Specified by:
localAddressin interfaceio.roastedroot.proxywasm.internal.HttpRequestAdaptor- Overrides:
localAddressin classio.roastedroot.proxywasm.jaxrs.internal.JaxrsHttpRequestAdaptor- Returns:
- The local IP address, or an empty string if the request object is null.
-
localPort
public int localPort()
Retrieves the local port from the underlyingHttpServletRequest.- Specified by:
localPortin interfaceio.roastedroot.proxywasm.internal.HttpRequestAdaptor- Overrides:
localPortin classio.roastedroot.proxywasm.jaxrs.internal.JaxrsHttpRequestAdaptor- Returns:
- The local port number, or 0 if the request object is null.
-
protocol
public String protocol()
Retrieves the protocol string (e.g., "HTTP/1.1") from the underlyingHttpServletRequest.- Specified by:
protocolin interfaceio.roastedroot.proxywasm.internal.HttpRequestAdaptor- Overrides:
protocolin classio.roastedroot.proxywasm.jaxrs.internal.JaxrsHttpRequestAdaptor- Returns:
- The protocol string.
-
-