Search in sources :

Example 1 with Waiter

use of software.amazon.awssdk.core.waiters.Waiter in project aws-sdk-java-v2 by aws.

the class DefaultQueryWaiter method applyWaitersUserAgent.

private <T extends QueryRequest> T applyWaitersUserAgent(T request) {
    Consumer<AwsRequestOverrideConfiguration.Builder> userAgentApplier = b -> b.addApiName(ApiName.builder().version("waiter").name("hll").build());
    AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration().map(c -> c.toBuilder().applyMutation(userAgentApplier).build()).orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
    return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
Also used : SdkAutoCloseable(software.amazon.awssdk.utils.SdkAutoCloseable) ThreadSafe(software.amazon.awssdk.annotations.ThreadSafe) AttributeMap(software.amazon.awssdk.utils.AttributeMap) ArrayList(java.util.ArrayList) ApiName(software.amazon.awssdk.core.ApiName) BackoffStrategy(software.amazon.awssdk.core.retry.backoff.BackoffStrategy) Duration(java.time.Duration) QueryClient(software.amazon.awssdk.services.query.QueryClient) APostOperationResponse(software.amazon.awssdk.services.query.model.APostOperationResponse) WaiterResponse(software.amazon.awssdk.core.waiters.WaiterResponse) WaiterOverrideConfiguration(software.amazon.awssdk.core.waiters.WaiterOverrideConfiguration) WaiterAcceptor(software.amazon.awssdk.core.waiters.WaiterAcceptor) WaiterAttribute(software.amazon.awssdk.core.internal.waiters.WaiterAttribute) AwsServiceException(software.amazon.awssdk.awscore.exception.AwsServiceException) WaitersRuntime(software.amazon.awssdk.services.query.waiters.internal.WaitersRuntime) FixedDelayBackoffStrategy(software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy) QueryRequest(software.amazon.awssdk.services.query.model.QueryRequest) Objects(java.util.Objects) Consumer(java.util.function.Consumer) Waiter(software.amazon.awssdk.core.waiters.Waiter) List(java.util.List) WaiterState(software.amazon.awssdk.core.waiters.WaiterState) APostOperationRequest(software.amazon.awssdk.services.query.model.APostOperationRequest) Optional(java.util.Optional) SdkInternalApi(software.amazon.awssdk.annotations.SdkInternalApi) Generated(software.amazon.awssdk.annotations.Generated) AwsRequestOverrideConfiguration(software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration) AwsRequestOverrideConfiguration(software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration)

Aggregations

Duration (java.time.Duration)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1 Consumer (java.util.function.Consumer)1 Generated (software.amazon.awssdk.annotations.Generated)1 SdkInternalApi (software.amazon.awssdk.annotations.SdkInternalApi)1 ThreadSafe (software.amazon.awssdk.annotations.ThreadSafe)1 AwsRequestOverrideConfiguration (software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration)1 AwsServiceException (software.amazon.awssdk.awscore.exception.AwsServiceException)1 ApiName (software.amazon.awssdk.core.ApiName)1 WaiterAttribute (software.amazon.awssdk.core.internal.waiters.WaiterAttribute)1 BackoffStrategy (software.amazon.awssdk.core.retry.backoff.BackoffStrategy)1 FixedDelayBackoffStrategy (software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy)1 Waiter (software.amazon.awssdk.core.waiters.Waiter)1 WaiterAcceptor (software.amazon.awssdk.core.waiters.WaiterAcceptor)1 WaiterOverrideConfiguration (software.amazon.awssdk.core.waiters.WaiterOverrideConfiguration)1 WaiterResponse (software.amazon.awssdk.core.waiters.WaiterResponse)1 WaiterState (software.amazon.awssdk.core.waiters.WaiterState)1