Class CannedResponseHttpClient
java.lang.Object
software.amazon.awssdk.core.warmup.http.CannedResponseHttpClient
- All Implemented Interfaces:
AutoCloseable,SdkHttpClient,SdkAutoCloseable
@SdkProtectedApi
@Immutable
@ThreadSafe
public final class CannedResponseHttpClient
extends Object
implements SdkHttpClient
An
SdkHttpClient that returns caller-supplied response bytes without performing any network I/O.
Each ExecutableHttpRequest.call() returns the configured status code and a fresh stream over the response bytes.
-
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()prepareRequest(HttpExecuteRequest request) Create aExecutableHttpRequestthat can be used to execute the HTTP request.
-
Method Details
-
builder
-
prepareRequest
Description copied from interface:SdkHttpClientCreate aExecutableHttpRequestthat can be used to execute the HTTP request.- Specified by:
prepareRequestin interfaceSdkHttpClient- Parameters:
request- Representation of an HTTP request.- Returns:
- Task that can execute an HTTP request and can be aborted.
-
clientName
Description copied from interface:SdkHttpClientEach 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, ApacheSync, for requests using Apache's synchronous http client or NettyNioAsync for Netty's asynchronous http client.- Specified by:
clientNamein interfaceSdkHttpClient- 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
-