@@ -0,0 +1,2275 @@
+package de.butterworks.awscommons.dynamo;%0A%0Aimport com.amazonaws.auth.BasicAWSCredentials;%0Aimport com.amazonaws.regions.Regions;%0Aimport com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;%0Aimport com.amazonaws.services.dynamodbv2.model.DescribeTableRequest;%0Aimport com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException;%0Aimport com.amazonaws.services.dynamodbv2.model.TableDescription;%0Aimport com.amazonaws.services.dynamodbv2.model.TableStatus;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Apublic class DynamoCommons %7B%0A%0A    private static final Logger logger = LoggerFactory.getLogger(DynamoCommons.class);%0A%0A    private final AmazonDynamoDBClient client;%0A%0A    private static DynamoCommons instance = null;%0A%0A    private final com.amazonaws.services.dynamodbv2.document.DynamoDB db;%0A%0A    private final static String awsAccessKey = System.getenv(%22accessKey%22);%0A    private final static String awsSecretKey = System.getenv(%22secretKey%22);%0A    private final static Regions region = Regions.fromName(System.getenv(%22region%22).toUpperCase());%0A%0A    private DynamoCommons() %7B%0A        logger.info(%22Using Region %22 + region.name());%0A        logger.info(%22Using Access Key %22 + awsAccessKey);%0A%0A        client = new AmazonDynamoDBClient(new BasicAWSCredentials(awsAccessKey, awsSecretKey))%0A                .withRegion(region);%0A%0A        db = new com.amazonaws.services.dynamodbv2.document.DynamoDB(new AmazonDynamoDBClient(%0A                new BasicAWSCredentials(awsAccessKey, awsSecretKey))%0A                .withRegion(region));%0A    %7D%0A%0A    public com.amazonaws.services.dynamodbv2.document.DynamoDB getDb() %7B%0A        return db;%0A    %7D%0A%0A    public AmazonDynamoDBClient getClient() %7B%0A        return client;%0A    %7D%0A%0A    public static synchronized DynamoCommons getInstance() %7B%0A        if (instance == null) instance = new DynamoCommons();%0A        return instance;%0A%0A    %7D%0A%0A    public boolean tableExists(final String tableName) %7B%0A        try %7B%0A            final TableDescription table = client.describeTable(new DescribeTableRequest(tableName))%0A                    .getTable();%0A            return TableStatus.ACTIVE.toString().equals(table.getTableStatus().toUpperCase());%0A        %7D catch (final ResourceNotFoundException rnfe) %7B%0A            return false;%0A        %7D%0A    %7D%0A%7D%0A

Rename DynamoCommons