Class TLfnEventSourceRequest

java.lang.Object
com.luciad.fusion.platform.event.object.request.TLfnEventSourceRequest

public final class TLfnEventSourceRequest extends Object
Class representing an HTTP request which triggered an event.

This class captures and retains some request information beyond the lifetime of the request. This in contrast to HttpServletRequest and TLcdHttpServletRequestKVPRequestWrapper where this information could no longer be available when the HTTP request has been handled. This is useful, for example, when working with events that are handled asynchronously. In an asynchronous event handler there is no guarantee that the HTTP request is still in progress.

Since:
2022.1
  • Method Details

    • getHttpMethod

      public String getHttpMethod()
      Returns the HTTP method (GET, POST, PUT, DELETE, and so on) used to perform the request
      Returns:
      a String containing the HTTP method used to perform the request
    • getRequestUri

      public URI getRequestUri()
      Returns the URI the client used to make the request. The returned URI contains a scheme, host, port number (if different from the standard HTTP(S) port), context path and query string.
      Returns:
      the URI the client used to make the request.
    • getContentType

      public Optional<String> getContentType()
      Returns the MIME type of the body of the request, or Optional.empty() if the type is not known.
      Returns:
      a String containing the name of the MIME type of the request, or Optional.empty() if the type is not known.
    • getBody

      public Optional<String> getBody()
      Returns the JSON or XML body of this request. Returns Optional.empty() if the request does not contain a JSON or XML body. Note that the body returned by this method will be limited to the first few kilobytes of the actual content of the request.
      Returns:
      the request's body
    • getHeaders

      public Map<String,String> getHeaders()
      Returns a map containing the Http headers of the request.
      Returns:
      a map containing the Http headers of the request.
    • getRemoteAddress

      public String getRemoteAddress()
      Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
      Returns:
      the IP address of the client or last proxy that sent the request.
      Since:
      2024.1
    • toString

      public String toString()
      Overrides:
      toString in class Object