Example usage for com.amazonaws.services.devicefarm AWSDeviceFarmClient AWSDeviceFarmClient

List of usage examples for com.amazonaws.services.devicefarm AWSDeviceFarmClient AWSDeviceFarmClient

Introduction

In this page you can find the example usage for com.amazonaws.services.devicefarm AWSDeviceFarmClient AWSDeviceFarmClient.

Prototype

AWSDeviceFarmClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) 

Source Link

Document

Constructs a new client to invoke service methods on AWS Device Farm using the specified parameters.

Usage

From source file:org.jenkinsci.plugins.awsdevicefarm.AWSDeviceFarm.java

License:Open Source License

/**
 * Private AWSDeviceFarm constructor. Uses the roleArn to generate STS creds if the roleArn isn't null; otherwise
 * just uses the AWSCredentials creds.//from  www.ja va 2 s  .com
 *
 * @param creds   AWSCredentials creds to use for authentication.
 * @param roleArn Role ARN to use for authentication.
 */
private AWSDeviceFarm(AWSCredentials creds, String roleArn) {
    if (roleArn != null) {
        STSAssumeRoleSessionCredentialsProvider sts = new STSAssumeRoleSessionCredentialsProvider.Builder(
                roleArn, RandomStringUtils.randomAlphanumeric(8)).build();
        creds = sts.getCredentials();
    }

    ClientConfiguration clientConfiguration = new ClientConfiguration()
            .withUserAgent("AWS Device Farm - Jenkins v1.0");
    api = new AWSDeviceFarmClient(creds, clientConfiguration);
    api.setServiceNameIntern("devicefarm");
}