List of usage examples for com.amazonaws.services.devicefarm AWSDeviceFarmClient AWSDeviceFarmClient
AWSDeviceFarmClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled)
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"); }