Class ResponseHandlerHelper

java.lang.Object
software.amazon.awssdk.http.crt.internal.response.ResponseHandlerHelper

public class ResponseHandlerHelper extends Object
This is the helper class that contains common logic shared between CrtResponseAdapter and InputStreamAdaptingHttpStreamResponseHandler. CRT connection will only be closed, i.e., not reused, in one of the following conditions: 1. 5xx server error OR 2. It fails to read the response OR 3. the response stream is closed/aborted by the caller.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ResponseHandlerHelper(SdkHttpResponse.Builder responseBuilder, software.amazon.awssdk.crt.http.HttpClientConnection connection)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    closeConnection(software.amazon.awssdk.crt.http.HttpStream stream)
    Close the connection completely
    void
    incrementWindow(software.amazon.awssdk.crt.http.HttpStream stream, int windowSize)
     
    void
    onResponseHeaders(int responseStatusCode, int headerType, software.amazon.awssdk.crt.http.HttpHeader[] nextHeaders)
     
    void
    releaseConnection(software.amazon.awssdk.crt.http.HttpStream stream)
    Release the connection back to the pool so that it can be reused.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ResponseHandlerHelper

      public ResponseHandlerHelper(SdkHttpResponse.Builder responseBuilder, software.amazon.awssdk.crt.http.HttpClientConnection connection)
  • Method Details

    • onResponseHeaders

      public void onResponseHeaders(int responseStatusCode, int headerType, software.amazon.awssdk.crt.http.HttpHeader[] nextHeaders)
    • releaseConnection

      public void releaseConnection(software.amazon.awssdk.crt.http.HttpStream stream)
      Release the connection back to the pool so that it can be reused.
    • incrementWindow

      public void incrementWindow(software.amazon.awssdk.crt.http.HttpStream stream, int windowSize)
    • closeConnection

      public void closeConnection(software.amazon.awssdk.crt.http.HttpStream stream)
      Close the connection completely