Class 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 Detail

      • ResponseHandlerHelper

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

      • 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
      • cleanUpConnectionBasedOnStatusCode

        public void cleanUpConnectionBasedOnStatusCode​(software.amazon.awssdk.crt.http.HttpStream stream)