Class CannedResponseAsyncHttpClient
java.lang.Object
software.amazon.awssdk.core.warmup.http.CannedResponseAsyncHttpClient
- All Implemented Interfaces:
AutoCloseable,SdkAsyncHttpClient,SdkAutoCloseable
@SdkProtectedApi
@Immutable
@ThreadSafe
public final class CannedResponseAsyncHttpClient
extends Object
implements SdkAsyncHttpClient
An
SdkAsyncHttpClient that completes every request with caller-supplied response bytes without performing any
network I/O. It is the async counterpart of CannedResponseHttpClient, used to warm the async request pipeline for a
CRaC checkpoint.
Each execute(AsyncExecuteRequest) signals the configured status code, publishes the response bytes through a
SimplePublisher, and returns an already-completed future.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Each HTTP client implementation should return a well-formed client name that allows requests to be identifiable back to the client that made the request.voidclose()execute(AsyncExecuteRequest request) Execute the request.
-
Method Details
-
builder
-
execute
Description copied from interface:SdkAsyncHttpClientExecute the request.- Specified by:
executein interfaceSdkAsyncHttpClient- Parameters:
request- The request object.- Returns:
- The future holding the result of the request execution. Upon success execution of the request, the future is
completed with
null, otherwise it is completed exceptionally.
-
clientName
Description copied from interface:SdkAsyncHttpClientEach HTTP client implementation should return a well-formed client name that allows requests to be identifiable back to the client that made the request. The client name should include the backing implementation as well as the Sync or Async to identify the transmission type of the request. Client names should only include alphanumeric characters. Examples of well formed client names include, Apache, for requests using Apache's http client or NettyNio for Netty's http client.- Specified by:
clientNamein interfaceSdkAsyncHttpClient- Returns:
- String containing the name of the client
-
close
public void close()Description copied from interface:SdkAutoCloseable- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSdkAutoCloseable
-