Class ServletJaxrsHttpRequestAdaptor

  • All Implemented Interfaces:
    io.roastedroot.proxywasm.internal.HttpRequestAdaptor

    public class ServletJaxrsHttpRequestAdaptor
    extends io.roastedroot.proxywasm.jaxrs.internal.JaxrsHttpRequestAdaptor
    A JaxrsHttpRequestAdaptor specifically 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 HttpServletRequest object.

    • 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
      String localAddress()
      Retrieves the local IP address from the underlying HttpServletRequest.
      int localPort()
      Retrieves the local port from the underlying HttpServletRequest.
      String protocol()
      Retrieves the protocol string (e.g., "HTTP/1.1") from the underlying HttpServletRequest.
      String remoteAddress()
      Retrieves the remote IP address from the underlying HttpServletRequest.
      int remotePort()
      Retrieves the remote port from the underlying HttpServletRequest.
      • Methods inherited from class io.roastedroot.proxywasm.jaxrs.internal.JaxrsHttpRequestAdaptor

        getGrpcReceiveInitialMetaData, getGrpcReceiveTrailerMetaData, getHttpRequestHeaders, getHttpRequestTrailers, getHttpResponseHeaders, getHttpResponseTrailers, getProperty, getRequestContext, getResponseContext, setProperty, setRequestContext, setResponseContext
    • Constructor Detail

      • ServletJaxrsHttpRequestAdaptor

        public ServletJaxrsHttpRequestAdaptor​(jakarta.servlet.http.HttpServletRequest request)
        Constructs a new adaptor.
        Parameters:
        request - The HttpServletRequest associated with the current request.
    • Method Detail

      • remoteAddress

        public String remoteAddress()
        Retrieves the remote IP address from the underlying HttpServletRequest.
        Specified by:
        remoteAddress in interface io.roastedroot.proxywasm.internal.HttpRequestAdaptor
        Overrides:
        remoteAddress in class io.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 underlying HttpServletRequest.
        Specified by:
        remotePort in interface io.roastedroot.proxywasm.internal.HttpRequestAdaptor
        Overrides:
        remotePort in class io.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 underlying HttpServletRequest.
        Specified by:
        localAddress in interface io.roastedroot.proxywasm.internal.HttpRequestAdaptor
        Overrides:
        localAddress in class io.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 underlying HttpServletRequest.
        Specified by:
        localPort in interface io.roastedroot.proxywasm.internal.HttpRequestAdaptor
        Overrides:
        localPort in class io.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 underlying HttpServletRequest.
        Specified by:
        protocol in interface io.roastedroot.proxywasm.internal.HttpRequestAdaptor
        Overrides:
        protocol in class io.roastedroot.proxywasm.jaxrs.internal.JaxrsHttpRequestAdaptor
        Returns:
        The protocol string.