Class WebClientProtocolResponse

java.lang.Object
io.helidon.webclient.api.WebClientProtocolResponse

public final class WebClientProtocolResponse extends Object
Protocol-neutral context for a response received by a WebClient transport.
  • Method Details

    • create

      public static WebClientProtocolResponse create(ResolvedClientTarget target, boolean explicitConnection, String protocolId, Status status, ClientResponseHeaders headers, Instant receivedAt)
      Create response context for a request sent to its direct route.
      Parameters:
      target - resolved physical and logical target
      explicitConnection - whether the request used a caller-supplied or otherwise out-of-band connection
      protocolId - actual response protocol identifier
      status - response status
      headers - response headers
      receivedAt - time the response headers were received
      Returns:
      response context
    • createAlternative

      public static WebClientProtocolResponse createAlternative(ResolvedClientTarget target, boolean explicitConnection, String protocolId, Status status, ClientResponseHeaders headers, Instant receivedAt, UriAuthority alternativeAuthority)
      Create response context for a request sent to an alternative service.
      Parameters:
      target - resolved physical and logical target
      explicitConnection - whether the request used a caller-supplied or otherwise out-of-band connection
      protocolId - actual response protocol identifier
      status - response status
      headers - response headers
      receivedAt - time the response headers were received
      alternativeAuthority - alternative authority used for the request
      Returns:
      response context
    • target

      public ResolvedClientTarget target()
      Exact resolved target used for this response.
      Returns:
      resolved target
    • explicitConnection

      public boolean explicitConnection()
      Whether the request used a caller-supplied or otherwise out-of-band connection.
      Returns:
      whether the request used an explicit connection
    • protocolId

      public String protocolId()
      Actual protocol selected for this response.
      Returns:
      protocol identifier
    • status

      public Status status()
      Response status.
      Returns:
      response status
    • headers

      public ClientResponseHeaders headers()
      Full immutable snapshot of response headers.
      Returns:
      response headers
    • secure

      public boolean secure()
      Whether this response used TLS for an HTTPS target.
      Returns:
      whether the response is secure
    • receivedAt

      public Instant receivedAt()
      Time the response headers were received.
      Returns:
      receipt time
    • alternativeAuthority

      public Optional<UriAuthority> alternativeAuthority()
      Alternative authority used for this request, if any.
      Returns:
      alternative authority