/** * Constructs a new STSSessionCredentialsProvider, which will use the specified long lived AWS * credentials to make a request to the AWS Security Token Service (STS) to request short lived * session credentials, which will then be returned by this class's {@link #getCredentials()} * method. * * @param longLivedCredentials The main AWS credentials for a user's account. */ public STSSessionCredentialsProvider(AWSCredentials longLivedCredentials) { this(longLivedCredentials, new ClientConfiguration()); }
/** * Factory method for default {@link ClientConfiguration} for all services unless otherwise * specified */ public static ClientConfiguration defaultConfig() { return new ClientConfiguration(); }
/** * Builds a {@link ClientConfiguration} instance with default configuration * values suitable for most use cases. * * @return constructed {@link ClientConfiguration} with standard configuration. */ protected ClientConfiguration getDefaultConfig() { return new ClientConfiguration(); }
/** * Constructs a new ArchiveTransferManager, using the specified Amazon * Glacier client and AWS credentials provider. * * @param glacier * The client for working with Amazon Glacier. * @param credentialsProvider * The AWS credentials provider used to authenticate requests. * @deprecated Use {@link ArchiveTransferManagerBuilder}. */ public ArchiveTransferManager(AmazonGlacierClient glacier, AWSCredentialsProvider credentialsProvider) { this(glacier, credentialsProvider, new ClientConfiguration()); }
public ClientConfiguration getClientConfiguration() { return new ClientConfiguration(clientConfiguration); }
/** * Constructs a new WebIdentityFederationSessionCredentialsProvider, which will use the * specified 3rd-party web identity provider to make a request to the AWS * Security Token Service (STS) to request short lived session credentials, * which will then be returned by this class's {@link #getCredentials()} * method. * * @param wifToken * The OAuth/OpenID token from the the Identity Provider * @param wifProvider * The name of the Identity Provider (null for OpenID providers) * @param roleArn * The ARN of the IAM Role that will be assumed */ public WebIdentityFederationSessionCredentialsProvider(String wifToken, String wifProvider, String roleArn) { this(wifToken, wifProvider, roleArn, new ClientConfiguration()); }
/** * Constructs a new STSAssumeRoleSessionCredentialsProvider, which will use the specified long * lived AWS credentials to make a request to the AWS Security Token Service (STS), uses the * provided {@link #roleArn} to assume a role and then request short lived session credentials, * which will then be returned by this class's {@link #getCredentials()} method. * * @param longLivedCredentials The main AWS credentials for a user's account. * @param roleArn The ARN of the Role to be assumed. * @param roleSessionName An identifier for the assumed role session. * @deprecated Use the {@link Builder} instead. */ @Deprecated public STSAssumeRoleSessionCredentialsProvider(AWSCredentials longLivedCredentials, String roleArn, String roleSessionName) { this(longLivedCredentials, roleArn, roleSessionName, new ClientConfiguration()); }
/** * Constructs a new ArchiveTransferManager, using the specified AWS * credentials to authenticate requests. * * @param credentials * The AWS credentials used to authenticate requests. * @deprecated Use {@link ArchiveTransferManagerBuilder}. */ public ArchiveTransferManager(AWSCredentials credentials) { this(new StaticCredentialsProvider(credentials), new ClientConfiguration()); }
/** * Builds a {@link ClientConfiguration} instance with configuration values * tailored towards clients operating in the same AWS region as the service * endpoint they call. Timeouts in in-region optimized configurations are * generally set much lower than the client standard configuration. * * @return constructed {@link ClientConfiguration} with in-region optimized configuration */ protected ClientConfiguration getInRegionOptimizedConfig() { return new ClientConfiguration().withConnectionTimeout(1000); }
/** * If not explicit client configuration is provided we consult the {@link * ClientConfigurationFactory} of the service. If an explicit configuration is provided we use * ClientConfiguration's copy constructor to avoid mutation. */ private ClientConfiguration resolveClientConfiguration() { return (clientConfig == null) ? clientConfigFactory.getConfig() : new ClientConfiguration(clientConfig); }
/** * Factory method for DynamoDB's default {@link ClientConfiguration} */ public static ClientConfiguration dynamoDefault() { return new ClientConfiguration().withRetryPolicy(PredefinedRetryPolicies.DYNAMODB_DEFAULT); }
/** * Constructs a new ArchiveTransferManager, using the specified Amazon * Glacier client and AWS credentials. * * @param glacier * The client for working with Amazon Glacier. * @param credentials * The AWS credentials used to authenticate requests. * @deprecated Use {@link ArchiveTransferManagerBuilder}. */ public ArchiveTransferManager(AmazonGlacierClient glacier, AWSCredentials credentials) { this(glacier, new StaticCredentialsProvider(credentials), new ClientConfiguration()); }
static ClientConfiguration s3ClientCfg() { ClientConfiguration cfg = new ClientConfiguration(); Properties prop = System.getProperties(); if( prop.containsKey(S3_SOCKET_TIMEOUT_PROP) ) cfg.setSocketTimeout(Integer.getInteger(S3_SOCKET_TIMEOUT_PROP)); if( prop.containsKey(S3_CONNECTION_TIMEOUT_PROP) ) cfg.setConnectionTimeout(Integer .getInteger(S3_CONNECTION_TIMEOUT_PROP)); if( prop.containsKey(S3_MAX_ERROR_RETRY_PROP) ) cfg.setMaxErrorRetry(Integer.getInteger(S3_MAX_ERROR_RETRY_PROP)); if( prop.containsKey(S3_MAX_HTTP_CONNECTIONS_PROP) ) cfg.setMaxConnections(Integer .getInteger(S3_MAX_HTTP_CONNECTIONS_PROP)); cfg.setProtocol(Protocol.HTTP); return cfg; }
/** * Factory method for Simple Workflow's default {@link ClientConfiguration} */ public static ClientConfiguration swfDefault() { return new ClientConfiguration().withMaxConnections(1000).withSocketTimeout(90000); }
private AmazonAutoScaling getAmazonAutoScalingClient() { String aWSAccessId = serverConfig.getAWSAccessId(); String aWSSecretKey = serverConfig.getAWSSecretKey(); ClientConfiguration clientConfiguration = new ClientConfiguration() .withConnectionTimeout(serverConfig.getASGQueryTimeoutMs()); if (null != aWSAccessId && !"".equals(aWSAccessId) && null != aWSSecretKey && !"".equals(aWSSecretKey)) { return new AmazonAutoScalingClient( new BasicAWSCredentials(aWSAccessId, aWSSecretKey), clientConfiguration); } else { return new AmazonAutoScalingClient( new InstanceProfileCredentialsProvider(), clientConfiguration); } }
private AmazonRoute53Client getAmazonRoute53Client(EurekaServerConfig serverConfig) { String aWSAccessId = serverConfig.getAWSAccessId(); String aWSSecretKey = serverConfig.getAWSSecretKey(); ClientConfiguration clientConfiguration = new ClientConfiguration() .withConnectionTimeout(serverConfig.getASGQueryTimeoutMs()); if (null != aWSAccessId && !"".equals(aWSAccessId) && null != aWSSecretKey && !"".equals(aWSSecretKey)) { return new AmazonRoute53Client( new BasicAWSCredentials(aWSAccessId, aWSSecretKey), clientConfiguration); } else { return new AmazonRoute53Client( new InstanceProfileCredentialsProvider(), clientConfiguration); } }
/** * Apply the user agent to the marshalled request (if not already present). Appends a custom marker to track usage of the * Netty based client. */ private void applyUserAgent(PutMediaRequest request, Request<PutMediaRequest> marshalled) { if (!marshalled.getHeaders().containsKey("User-Agent")) { marshalled.addHeader("User-Agent", RuntimeHttpUtils.getUserAgent(new ClientConfiguration(), request.getRequestClientOptions() .getClientMarker(RequestClientOptions.Marker.USER_AGENT))); } }
ClientConfiguration clientConfiguration = new ClientConfiguration() .withConnectionTimeout(serverConfig.getASGQueryTimeoutMs());
@Override public ClientConfiguration getAWSClientConfig() { ClientConfiguration awsClientConfig = new ClientConfiguration(); awsClientConfig.setProxyHost(proxyHost); awsClientConfig.setProxyPort(proxyPort); if ( proxyUsername != null ) { awsClientConfig.setProxyUsername(proxyUsername); } if ( proxyPassword != null ) { awsClientConfig.setProxyPassword(proxyPassword); } return awsClientConfig; }
private static AWSGlueAsync createAsyncGlueClient(GlueHiveMetastoreConfig config) { ClientConfiguration clientConfig = new ClientConfiguration().withMaxConnections(config.getMaxGlueConnections()); AWSGlueAsyncClientBuilder asyncGlueClientBuilder = AWSGlueAsyncClientBuilder.standard() .withClientConfiguration(clientConfig); if (config.getGlueRegion().isPresent()) { asyncGlueClientBuilder.setRegion(config.getGlueRegion().get()); } else if (config.getPinGlueClientToCurrentRegion()) { Region currentRegion = Regions.getCurrentRegion(); if (currentRegion != null) { asyncGlueClientBuilder.setRegion(currentRegion.getName()); } } return asyncGlueClientBuilder.build(); }