public static interface Ec2MetadataAsyncClient.Builder extends Ec2MetadataClientBuilder<Ec2MetadataAsyncClient.Builder,Ec2MetadataAsyncClient>
Ec2MetadataClient. All parameters are optional and have default values if not
specified. Therefore, an instance can be simply created with Ec2MetadataAsyncClient.builder().build() or
Ec2MetadataAsyncClient.create(), both having the same result.| Modifier and Type | Method and Description |
|---|---|
Ec2MetadataAsyncClient.Builder |
httpClient(SdkAsyncHttpClient.Builder<?> builder)
An http client builder used to retrieve an instance of an
SdkAsyncHttpClient. |
Ec2MetadataAsyncClient.Builder |
httpClient(SdkAsyncHttpClient httpClient)
Define the http client used by the Ec2 Metadata client.
|
Ec2MetadataAsyncClient.Builder |
scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
Define the
ScheduledExecutorService used to schedule asynchronous retry attempts. |
endpoint, endpointMode, retryPolicy, retryPolicy, tokenTtlapplyMutation, buildEc2MetadataAsyncClient.Builder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
ScheduledExecutorService used to schedule asynchronous retry attempts. If provided, the
Ec2MetadataClient will NOT manage the lifetime if the httpClient and must therefore be
closed explicitly by calling the SdkAutoCloseable.close() method on it.
If not specified, defaults to Executors.newScheduledThreadPool(int) with a default value of 3 thread in the
pool.
scheduledExecutorService - the ScheduledExecutorService to use for retry attempt.Ec2MetadataAsyncClient.Builder httpClient(SdkAsyncHttpClient httpClient)
SdkAutoCloseable.close()
method on it.
If not specified, the IMDS client will look for a SdkAsyncHttpClient class included in the classpath of the
application and creates a new instance of that class, managed by the IMDS Client, that will be closed when the IMDS
Client is closed. If no such class can be found, will throw a SdkClientException.
httpClient - the http clientEc2MetadataAsyncClient.Builder httpClient(SdkAsyncHttpClient.Builder<?> builder)
SdkAsyncHttpClient. If specified, the Ec2
Metadata Client will use the instance returned by the builder and manage its lifetime by closing the http client
once the Ec2 Client itself is closed.builder - the builder to used to retrieve an instance.Copyright © 2023. All rights reserved.