Record Class ApiTransaction

java.lang.Object
java.lang.Record
com.shaft.capture.generate.api.ApiTransaction
Record Components:
transactionId - stable transaction identifier from the recording
method - HTTP method
url - request URL
origin - scheme://host[:port] of the request URL, used to group transactions by origin during rendering
requestHeaders - sanitized request headers
requestBody - resolved request body text (empty if none/binary/oversized/unavailable)
statusCode - response status code (0 if there was no response, e.g. a failed transaction)
responseHeaders - sanitized response headers
responseBody - resolved response body text (empty if none/binary/oversized/unavailable)
responseLeaves - classified leaves of the response body (see ResponseNormalizer)
correlatedUiSequence - sequence number of the UI capture event this transaction is correlated with, or null when the transaction was not recorded as part of a hybrid UI+API session

public record ApiTransaction(String transactionId, String method, String url, String origin, Map<String,String> requestHeaders, String requestBody, int statusCode, Map<String,String> responseHeaders, String responseBody, List<ResponseLeaf> responseLeaves, Long correlatedUiSequence) extends Record
One recorded API transaction with resolved (not just referenced) request/response body text, ready for classification, correlation, and rendering.
  • Constructor Details

    • ApiTransaction

      public ApiTransaction(String transactionId, String method, String url, String origin, Map<String,String> requestHeaders, String requestBody, int statusCode, Map<String,String> responseHeaders, String responseBody, List<ResponseLeaf> responseLeaves, Long correlatedUiSequence)
      Creates an instance of a ApiTransaction record class.
      Parameters:
      transactionId - the value for the transactionId record component
      method - the value for the method record component
      url - the value for the url record component
      origin - the value for the origin 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
      responseLeaves - the value for the responseLeaves record component
      correlatedUiSequence - the value for the correlatedUiSequence record component
    • ApiTransaction

      public ApiTransaction(String transactionId, String method, String url, String origin, Map<String,String> requestHeaders, String requestBody, int statusCode, Map<String,String> responseHeaders, String responseBody, List<ResponseLeaf> responseLeaves)
      Compatibility constructor for callers compiled before hybrid UI correlation was added.
      Parameters:
      transactionId - stable transaction identifier from the recording
      method - HTTP method
      url - request URL
      origin - scheme://host[:port] of the request URL
      requestHeaders - sanitized request headers
      requestBody - resolved request body text
      statusCode - response status code
      responseHeaders - sanitized response headers
      responseBody - resolved response body text
      responseLeaves - classified leaves of the response body
  • 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.
    • transactionId

      public String transactionId()
      Returns the value of the transactionId record component.
      Returns:
      the value of the transactionId record component
    • 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
    • origin

      public String origin()
      Returns the value of the origin record component.
      Returns:
      the value of the origin 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 String 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 String responseBody()
      Returns the value of the responseBody record component.
      Returns:
      the value of the responseBody record component
    • responseLeaves

      public List<ResponseLeaf> responseLeaves()
      Returns the value of the responseLeaves record component.
      Returns:
      the value of the responseLeaves record component
    • correlatedUiSequence

      public Long correlatedUiSequence()
      Returns the value of the correlatedUiSequence record component.
      Returns:
      the value of the correlatedUiSequence record component