Record Class ProxyTransaction

java.lang.Object
java.lang.Record
com.shaft.capture.proxy.ProxyTransaction
Record Components:
method - HTTP method
url - reconstructed absolute request URL
requestHeaders - raw request headers, in wire order
requestBody - raw request body bytes (empty if none)
statusCode - response status code (0 if no response was received, e.g. a failed transaction)
responseHeaders - raw response headers, in wire order (empty if no response)
responseBody - raw response body bytes (empty if none)

public record ProxyTransaction(String method, String url, Map<String,String> requestHeaders, byte[] requestBody, int statusCode, Map<String,String> responseHeaders, byte[] responseBody) extends Record
One raw HTTP(S) transaction captured by ApiCaptureProxyServer, before any redaction, classification, or session-model wrapping. A higher-level controller is responsible for turning this into a first-class CaptureEvent.NetworkEvent the same way com.shaft.capture.network.CaptureNetworkRecorder's raw callbacks are wrapped by ManagedCaptureRecorder -- this module has no dependency on session/store types, only on shaft-capture's model, which it does not construct directly.
  • Constructor Details

    • ProxyTransaction

      public ProxyTransaction(String method, String url, Map<String,String> requestHeaders, byte[] requestBody, int statusCode, Map<String,String> responseHeaders, byte[] responseBody)
      Creates an instance of a ProxyTransaction record class.
      Parameters:
      method - the value for the method record component
      url - the value for the url record component
      requestHeaders - the value for the requestHeaders record component
      requestBody - the value for the requestBody record component
      statusCode - the value for the statusCode record component
      responseHeaders - the value for the responseHeaders record component
      responseBody - the value for the responseBody record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • method

      public String method()
      Returns the value of the method record component.
      Returns:
      the value of the method record component
    • url

      public String url()
      Returns the value of the url record component.
      Returns:
      the value of the url record component
    • requestHeaders

      public Map<String,String> requestHeaders()
      Returns the value of the requestHeaders record component.
      Returns:
      the value of the requestHeaders record component
    • requestBody

      public byte[] requestBody()
      Returns the value of the requestBody record component.
      Returns:
      the value of the requestBody record component
    • statusCode

      public int statusCode()
      Returns the value of the statusCode record component.
      Returns:
      the value of the statusCode record component
    • responseHeaders

      public Map<String,String> responseHeaders()
      Returns the value of the responseHeaders record component.
      Returns:
      the value of the responseHeaders record component
    • responseBody

      public byte[] responseBody()
      Returns the value of the responseBody record component.
      Returns:
      the value of the responseBody record component