Class IdempotencyResponse

java.lang.Object
io.github.ravocode.avoonce.core.domain.IdempotencyResponse

public class IdempotencyResponse extends Object
Immutable value object encapsulating the cached HTTP response for a successfully processed idempotent request.

When an idempotency record transitions to IdempotencyStatus.COMPLETED, the response is stored in this object so that subsequent retries with the same key receive an exact replay of the original response — including status code, headers, and raw body bytes.

  • Constructor Details

    • IdempotencyResponse

      public IdempotencyResponse(int statusCode, Map<String, List<String>> headers, byte[] body)
      Constructs an IdempotencyResponse capturing the full HTTP response.
      Parameters:
      statusCode - the HTTP status code.
      headers - the response headers as a multi-valued map.
      body - the raw response body bytes.
  • Method Details

    • getStatusCode

      public int getStatusCode()
      Returns the HTTP status code of the cached response.
      Returns:
      the HTTP status code (e.g. 200, 201, 204).
    • getHeaders

      public Map<String, List<String>> getHeaders()
      Returns the captured HTTP response headers.
      Returns:
      a multi-valued map of header names to header value lists.
    • getBody

      public byte[] getBody()
      Returns the raw serialized response body bytes.
      Returns:
      the response body byte array; may be null or empty for bodyless responses.