Search in sources :

Example 1 with AmazonSimpleDBClient

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);
}
Also used : AmazonEC2Client(com.amazonaws.services.ec2.AmazonEC2Client) AmazonS3Client(com.amazonaws.services.s3.AmazonS3Client) AmazonSimpleDBClient(com.amazonaws.services.simpledb.AmazonSimpleDBClient) PropertiesCredentials(com.amazonaws.auth.PropertiesCredentials) AWSCredentials(com.amazonaws.auth.AWSCredentials) File(java.io.File)

Example 2 with AmazonSimpleDBClient

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;
}
Also used : AmazonSimpleDBClient(com.amazonaws.services.simpledb.AmazonSimpleDBClient) AmazonSimpleDB(com.amazonaws.services.simpledb.AmazonSimpleDB) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) AWSCredentials(com.amazonaws.auth.AWSCredentials) ClientConfiguration(com.amazonaws.ClientConfiguration) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials)

Example 3 with AmazonSimpleDBClient

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));
}
Also used : AmazonSimpleDBClient(com.amazonaws.services.simpledb.AmazonSimpleDBClient) SienaException(siena.SienaException) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials)

Example 4 with AmazonSimpleDBClient

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;
}
Also used : AmazonSimpleDBClient(com.amazonaws.services.simpledb.AmazonSimpleDBClient) AmazonSimpleDB(com.amazonaws.services.simpledb.AmazonSimpleDB) ClientConfiguration(com.amazonaws.ClientConfiguration)

Example 5 with AmazonSimpleDBClient

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;
}
Also used : AmazonSimpleDBClient(com.amazonaws.services.simpledb.AmazonSimpleDBClient)

Aggregations

AmazonSimpleDBClient (com.amazonaws.services.simpledb.AmazonSimpleDBClient)7 AWSCredentials (com.amazonaws.auth.AWSCredentials)3 BasicAWSCredentials (com.amazonaws.auth.BasicAWSCredentials)3 ClientConfiguration (com.amazonaws.ClientConfiguration)2 PropertiesCredentials (com.amazonaws.auth.PropertiesCredentials)2 AmazonS3Client (com.amazonaws.services.s3.AmazonS3Client)2 AmazonSimpleDB (com.amazonaws.services.simpledb.AmazonSimpleDB)2 AmazonEC2Client (com.amazonaws.services.ec2.AmazonEC2Client)1 Attribute (com.amazonaws.services.simpledb.model.Attribute)1 DeleteDomainRequest (com.amazonaws.services.simpledb.model.DeleteDomainRequest)1 ReplaceableAttribute (com.amazonaws.services.simpledb.model.ReplaceableAttribute)1 File (java.io.File)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 List (java.util.List)1 PersistenceException (javax.persistence.PersistenceException)1 Exchange (org.apache.camel.Exchange)1 Processor (org.apache.camel.Processor)1 ProducerTemplate (org.apache.camel.ProducerTemplate)1 RouteBuilder (org.apache.camel.builder.RouteBuilder)1