Class DynamoDb

java.lang.Object
io.inversion.Db<DynamoDb>
io.inversion.dynamodb.DynamoDb

public class DynamoDb extends io.inversion.Db<DynamoDb>
  • Field Details

    • PRIMARY_INDEX_NAME

      public static final String PRIMARY_INDEX_NAME
      See Also:
    • PRIMARY_INDEX_TYPE

      public static final String PRIMARY_INDEX_TYPE
      See Also:
    • LOCAL_SECONDARY_INDEX_TYPE

      public static final String LOCAL_SECONDARY_INDEX_TYPE
      See Also:
    • GLOBAL_SECONDARY_INDEX_TYPE

      public static final String GLOBAL_SECONDARY_INDEX_TYPE
      See Also:
    • batchMax

      protected final int batchMax
      See Also:
    • awsAccessKey

      protected String awsAccessKey
    • awsSecretKey

      protected String awsSecretKey
    • awsRegion

      protected String awsRegion
    • awsEndpoint

      protected String awsEndpoint
    • blueprintRow

      protected String blueprintRow
      Use to config which row is used to build the column/attribute model (otherwise first row of scan will be used)

      FORMAT: collection name | primaryKey | sortKey (optional)

    • dynamoClient

      protected transient com.amazonaws.services.dynamodbv2.AmazonDynamoDB dynamoClient
  • Constructor Details

    • DynamoDb

      public DynamoDb()
    • DynamoDb

      public DynamoDb(String name, String includeTables)
  • Method Details

    • findIndexByName

      public static io.inversion.Index findIndexByName(io.inversion.Collection coll, String name)
    • getTypeStringFromObject

      protected static String getTypeStringFromObject(Object obj)
    • buildDynamoClient

      public static com.amazonaws.services.dynamodbv2.AmazonDynamoDB buildDynamoClient(String prefix)
    • buildDynamoClient

      public static com.amazonaws.services.dynamodbv2.AmazonDynamoDB buildDynamoClient(String awsRegion, String awsAccessKey, String awsSecretKey, String awsEndpoint)
    • doSelect

      public io.inversion.Results doSelect(io.inversion.Collection table, List<io.inversion.rql.Term> columnMappedTerms) throws io.inversion.ApiException
      Specified by:
      doSelect in class io.inversion.Db<DynamoDb>
      Throws:
      io.inversion.ApiException
    • doUpsert

      public List<String> doUpsert(io.inversion.Collection table, List<Map<String,Object>> rows) throws io.inversion.ApiException
      Specified by:
      doUpsert in class io.inversion.Db<DynamoDb>
      Throws:
      io.inversion.ApiException
    • delete

      public void delete(io.inversion.Collection table, List<Map<String,Object>> indexValues) throws io.inversion.ApiException
      Specified by:
      delete in class io.inversion.Db<DynamoDb>
      Throws:
      io.inversion.ApiException
    • deleteRow

      public void deleteRow(io.inversion.Collection table, Map<String,Object> row) throws io.inversion.ApiException
      Throws:
      io.inversion.ApiException
    • configDb

      public void configDb() throws io.inversion.ApiException
      Overrides:
      configDb in class io.inversion.Db<DynamoDb>
      Throws:
      io.inversion.ApiException
    • buildCollection

      protected io.inversion.Collection buildCollection(String tableName)
    • addTableIndex

      protected void addTableIndex(String type, String indexName, List<com.amazonaws.services.dynamodbv2.model.KeySchemaElement> keySchemaList, io.inversion.Collection table, boolean unique)
    • getDynamoTable

      public com.amazonaws.services.dynamodbv2.document.Table getDynamoTable(io.inversion.Collection table)
    • getDynamoTable

      public com.amazonaws.services.dynamodbv2.document.Table getDynamoTable(String tableName)
    • withBlueprintRow

      public DynamoDb withBlueprintRow(String blueprintRow)
    • withAwsRegion

      public DynamoDb withAwsRegion(String awsRegion)
    • withAwsAccessKey

      public DynamoDb withAwsAccessKey(String awsAccessKey)
    • withAwsSecretKey

      public DynamoDb withAwsSecretKey(String awsSecretKey)
    • withAwsEndpoint

      public DynamoDb withAwsEndpoint(String awsEndpoint)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDynamoClient

      public com.amazonaws.services.dynamodbv2.AmazonDynamoDB getDynamoClient()