Package software.amazon.awssdk.imds
Interface Ec2MetadataClient.Builder
-
- All Superinterfaces:
Buildable,Ec2MetadataClientBuilder<Ec2MetadataClient.Builder,Ec2MetadataClient>,SdkBuilder<Ec2MetadataClientBuilder<Ec2MetadataClient.Builder,Ec2MetadataClient>,Ec2MetadataClient>
- All Known Implementing Classes:
DefaultEc2MetadataClient.Ec2MetadataBuilder
- Enclosing interface:
- Ec2MetadataClient
public static interface Ec2MetadataClient.Builder extends Ec2MetadataClientBuilder<Ec2MetadataClient.Builder,Ec2MetadataClient>
The builder definition for aEc2MetadataClient.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Ec2MetadataClient.BuilderhttpClient(SdkHttpClient httpClient)Define the http client used by the Ec2 Metadata client.Ec2MetadataClient.BuilderhttpClient(SdkHttpClient.Builder<?> builder)A http client builder used to retrieve an instance of anSdkHttpClient.-
Methods inherited from interface software.amazon.awssdk.imds.Ec2MetadataClientBuilder
endpoint, endpointMode, retryPolicy, retryPolicy, tokenTtl
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
-
-
-
-
Method Detail
-
httpClient
Ec2MetadataClient.Builder httpClient(SdkHttpClient httpClient)
Define the http client used by the Ec2 Metadata client. If provided, the Ec2MetadataClient will NOT manage the lifetime if the httpClient and must therefore be closed explicitly by calling theSdkAutoCloseable.close()method on it.If not specified, the IMDS client will look for a SdkHttpClient class included in the classpath of the application and create 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.- Parameters:
httpClient- the http client- Returns:
- a reference to this builder
-
httpClient
Ec2MetadataClient.Builder httpClient(SdkHttpClient.Builder<?> builder)
A http client builder used to retrieve an instance of anSdkHttpClient. 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.- Parameters:
builder- the builder to used to retrieve an instance.- Returns:
- a reference to this builder
-
-