Example usage for com.amazonaws ClientConfiguration withRetryPolicy

List of usage examples for com.amazonaws ClientConfiguration withRetryPolicy

Introduction

In this page you can find the example usage for com.amazonaws ClientConfiguration withRetryPolicy.

Prototype

public ClientConfiguration withRetryPolicy(RetryPolicy retryPolicy) 

Source Link

Document

Sets the retry policy upon failed requests, and returns the updated ClientConfiguration object.

Usage

From source file:org.finra.herd.dao.helper.AwsHelper.java

License:Apache License

/**
 * Creates a client configuration object that contains client configuration options such as proxy settings and max retry attempts.
 *
 * @param awsParamsDto the AWS related parameters that contain optional proxy information
 *
 * @return the client configuration object
 *///from   w w w. ja v a 2 s .c o  m
public ClientConfiguration getClientConfiguration(AwsParamsDto awsParamsDto) {
    ClientConfiguration clientConfiguration = new ClientConfiguration();

    // Set a retry policy.
    clientConfiguration.withRetryPolicy(retryPolicyFactory.getRetryPolicy());

    // If the proxy hostname and port both are configured, set the HTTP proxy information.
    if (StringUtils.isNotBlank(awsParamsDto.getHttpProxyHost()) && awsParamsDto.getHttpProxyPort() != null) {
        clientConfiguration.withProxyHost(awsParamsDto.getHttpProxyHost())
                .withProxyPort(awsParamsDto.getHttpProxyPort());
    }

    return clientConfiguration;
}