use of com.amazonaws.services.simpledb.AmazonSimpleDBClient in project GNS by MobilityFirst.
the class AWSStatusCheck method init.
private static void init() throws Exception {
AWSCredentials credentials = new PropertiesCredentials(new File(CREDENTIALSFILE));
ec2 = new AmazonEC2Client(credentials);
s3 = new AmazonS3Client(credentials);
sdb = new AmazonSimpleDBClient(credentials);
}
use of com.amazonaws.services.simpledb.AmazonSimpleDBClient 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;
}
use of com.amazonaws.services.simpledb.AmazonSimpleDBClient in project siena by mandubian.
the class SdbPersistenceManager method init.
public void init(Properties p) {
String awsAccessKeyId = p.getProperty("awsAccessKeyId");
String awsSecretAccessKey = p.getProperty("awsSecretAccessKey");
if (awsAccessKeyId == null || awsSecretAccessKey == null)
throw new SienaException("Both awsAccessKeyId and awsSecretAccessKey properties must be set");
prefix = p.getProperty("prefix");
if (prefix == null)
prefix = "";
sdb = new AmazonSimpleDBClient(new BasicAWSCredentials(awsAccessKeyId, awsSecretAccessKey));
}
use of com.amazonaws.services.simpledb.AmazonSimpleDBClient in project SimianArmy by Netflix.
the class AWSClient method sdbClient.
/**
* Amazon SimpleDB client.
*
* @return the Amazon SimpleDB client
*/
public AmazonSimpleDB sdbClient() {
AmazonSimpleDB client;
ClientConfiguration cc = awsClientConfig;
if (cc == null) {
cc = new ClientConfiguration();
cc.setMaxErrorRetry(SIMPLE_DB_MAX_RETRY);
}
if (awsCredentialsProvider == null) {
client = new AmazonSimpleDBClient(cc);
} else {
client = new AmazonSimpleDBClient(awsCredentialsProvider, cc);
}
// http://docs.amazonwebservices.com/general/latest/gr/rande.html#sdb_region
if (region == null || region.equals("us-east-1")) {
client.setEndpoint("sdb.amazonaws.com");
} else {
client.setEndpoint("sdb." + region + ".amazonaws.com");
}
return client;
}
use of com.amazonaws.services.simpledb.AmazonSimpleDBClient in project wildfly-camel by wildfly-extras.
the class SDBUtils method createDBClient.
/* Attach a policy like this: MySDBFullAccess
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1494415798000",
"Effect": "Allow",
"Action": [
"sdb:*"
],
"Resource": [
"arn:aws:sdb:*"
]
}
]
}
*/
public static AmazonSimpleDBClient createDBClient() {
BasicCredentialsProvider credentials = BasicCredentialsProvider.standard();
AmazonSimpleDBClient client = !credentials.isValid() ? null : (AmazonSimpleDBClient) AmazonSimpleDBClientBuilder.standard().withCredentials(credentials).withRegion("eu-west-1").build();
return client;
}
Aggregations