use of com.amazonaws.auth.BasicAWSCredentials in project camel by apache.
the class DdbEndpoint method createDdbClient.
AmazonDynamoDB createDdbClient() {
AmazonDynamoDB client = null;
ClientConfiguration clientConfiguration = null;
boolean isClientConfigFound = false;
if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
clientConfiguration = new ClientConfiguration();
clientConfiguration.setProxyHost(configuration.getProxyHost());
clientConfiguration.setProxyPort(configuration.getProxyPort());
isClientConfigFound = true;
}
if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
if (isClientConfigFound) {
client = new AmazonDynamoDBClient(credentials, clientConfiguration);
} else {
client = new AmazonDynamoDBClient(credentials);
}
} else {
if (isClientConfigFound) {
client = new AmazonDynamoDBClient();
} else {
client = new AmazonDynamoDBClient(clientConfiguration);
}
}
return client;
}
use of com.amazonaws.auth.BasicAWSCredentials in project camel by apache.
the class CwEndpoint method createCloudWatchClient.
AmazonCloudWatch createCloudWatchClient() {
AmazonCloudWatch client = null;
ClientConfiguration clientConfiguration = null;
boolean isClientConfigFound = false;
if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
clientConfiguration = new ClientConfiguration();
clientConfiguration.setProxyHost(configuration.getProxyHost());
clientConfiguration.setProxyPort(configuration.getProxyPort());
isClientConfigFound = true;
}
if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
if (isClientConfigFound) {
client = new AmazonCloudWatchClient(credentials, clientConfiguration);
} else {
client = new AmazonCloudWatchClient(credentials);
}
} else {
if (isClientConfigFound) {
client = new AmazonCloudWatchClient();
} else {
client = new AmazonCloudWatchClient(clientConfiguration);
}
}
return client;
}
use of com.amazonaws.auth.BasicAWSCredentials in project camel by apache.
the class EC2Endpoint method createEc2Client.
AmazonEC2Client createEc2Client() {
AmazonEC2Client client = null;
ClientConfiguration clientConfiguration = null;
boolean isClientConfigFound = false;
if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
clientConfiguration = new ClientConfiguration();
clientConfiguration.setProxyHost(configuration.getProxyHost());
clientConfiguration.setProxyPort(configuration.getProxyPort());
isClientConfigFound = true;
}
if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
if (isClientConfigFound) {
client = new AmazonEC2Client(credentials, clientConfiguration);
} else {
client = new AmazonEC2Client(credentials);
}
} else {
if (isClientConfigFound) {
client = new AmazonEC2Client();
} else {
client = new AmazonEC2Client(clientConfiguration);
}
}
return client;
}
use of com.amazonaws.auth.BasicAWSCredentials in project camel by apache.
the class SqsEndpoint method createClient.
/**
* Provide the possibility to override this method for an mock implementation
* @return AmazonSQSClient
*/
AmazonSQS createClient() {
AmazonSQS client = null;
ClientConfiguration clientConfiguration = null;
boolean isClientConfigFound = false;
if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
clientConfiguration = new ClientConfiguration();
clientConfiguration.setProxyHost(configuration.getProxyHost());
clientConfiguration.setProxyPort(configuration.getProxyPort());
isClientConfigFound = true;
}
if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
if (isClientConfigFound) {
client = new AmazonSQSClient(credentials, clientConfiguration);
} else {
client = new AmazonSQSClient(credentials);
}
} else {
if (isClientConfigFound) {
client = new AmazonSQSClient();
} else {
client = new AmazonSQSClient(clientConfiguration);
}
}
return client;
}
use of com.amazonaws.auth.BasicAWSCredentials in project camel by apache.
the class SdbEndpoint method createSdbClient.
AmazonSimpleDB createSdbClient() {
AmazonSimpleDB client = null;
ClientConfiguration clientConfiguration = null;
boolean isClientConfigFound = false;
if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
clientConfiguration = new ClientConfiguration();
clientConfiguration.setProxyHost(configuration.getProxyHost());
clientConfiguration.setProxyPort(configuration.getProxyPort());
isClientConfigFound = true;
}
if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
if (isClientConfigFound) {
client = new AmazonSimpleDBClient(credentials, clientConfiguration);
} else {
client = new AmazonSimpleDBClient(credentials);
}
} else {
if (isClientConfigFound) {
client = new AmazonSimpleDBClient();
} else {
client = new AmazonSimpleDBClient(clientConfiguration);
}
}
return client;
}
Aggregations