Class DynamoDb<T extends DynamoDb>

java.lang.Object
io.inversion.Rule<T>
io.inversion.Db<T>
io.inversion.dynamodb.DynamoDb<T>
All Implemented Interfaces:
Comparable<T>

public class DynamoDb<T extends DynamoDb> extends io.inversion.Db<T>
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.inversion.Rule

    io.inversion.Rule.RuleMatcher
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
     
    protected String
     
    protected String
     
    protected String
     
    protected final int
     
    protected com.amazonaws.services.dynamodbv2.AmazonDynamoDB
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from class io.inversion.Db

    bootstrap, collections, dryRun, excludeColumns, includeColumns, includeTables, log, reservedParams, type

    Fields inherited from class io.inversion.Rule

    ALL_METHODS, configMap, description, excludeMatchers, excludeOn, includeMatchers, includeOn, name, order, params
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    DynamoDb(String name, String includeTables)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected io.inversion.Index
    addTableIndex(String type, String indexName, List<com.amazonaws.services.dynamodbv2.model.KeySchemaElement> keySchemaList, io.inversion.Collection collection, boolean unique, com.amazonaws.services.dynamodbv2.model.Projection projection, io.inversion.Index primaryIndex)
     
    protected io.inversion.Collection
    buildCollection(String tableName, String collectionName)
     
    static com.amazonaws.services.dynamodbv2.AmazonDynamoDB
    buildDynamoClient(String awsRegion, String awsAccessKey, String awsSecretKey, String awsEndpoint)
     
    protected com.amazonaws.services.dynamodbv2.document.spec.UpdateItemSpec
    buildUpdateItemSpec(io.inversion.Collection collection, Map<String,Object> row)
     
    void
     
    void
    deleteRow(io.inversion.Collection table, Map<String,Object> row)
     
    void
    doDelete(io.inversion.Collection table, List<Map<String,Object>> indexValues)
     
    io.inversion.Results
    doSelect(io.inversion.Collection table, List<io.inversion.rql.Term> columnMappedTerms)
     
    io.inversion.Results
    doSelect0(io.inversion.Collection table, List<io.inversion.rql.Term> columnMappedTerms)
     
    doUpsert(io.inversion.Collection collection, List<Map<String,Object>> rows)
     
    static io.inversion.Index
    findIndexByName(io.inversion.Collection coll, String name)
     
    com.amazonaws.services.dynamodbv2.AmazonDynamoDB
     
    com.amazonaws.services.dynamodbv2.document.Table
    getDynamoTable(io.inversion.Collection table)
     
    com.amazonaws.services.dynamodbv2.document.Table
     
    protected static String
     
    run(Callable statement)
    TODO: update all calls to DynamoDb to use this method to have consistent error handling.
     
    withAwsAccessKey(String awsAccessKey)
     
    withAwsEndpoint(String awsEndpoint)
     
    withAwsRegion(String awsRegion)
     
    withAwsSecretKey(String awsSecretKey)
     

    Methods inherited from class io.inversion.Db

    beautifyCollectionName, beautifyName, buildCollections, buildRelationships, castDbOutput, castJsonInput, castJsonInput, configApi, delete, doPatch, doShutdown, doShutdown, doStartup, excludeTable, filterOutJsonProperty, getCollection, getCollectionByTableName, getCollections, getProperty, getType, isBootstrap, isDryRun, isRunning, isType, makeRelationshipName, mapToColumnNames, mapToColumnNames, mapToJsonNames, patch, removeCollection, select, shutdown, shutdown, startup, upsert, withBootstrap, withCollection, withCollections, withDryRun, withExcludeColumns, withIncludeColumns, withIncludeTable, withIncludeTables, withType

    Methods inherited from class io.inversion.Rule

    afterWiringComplete, checkLazyConfig, compareTo, doLazyConfig, getAllExcludePaths, getAllIncludeMethods, getAllIncludePaths, getDefaultIncludeMatchers, getDescription, getExcludeMatchers, getIncludeMatchers, getName, getOrder, getParams, match, match, matches, matches, withDescription, withExcludeOn, withExcludeOn, withIncludeOn, withIncludeOn, withName, withOrder, withParam, withParams

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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
    • 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 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
      Overrides:
      doSelect in class io.inversion.Db<T extends DynamoDb>
      Throws:
      io.inversion.ApiException
    • doSelect0

      public io.inversion.Results doSelect0(io.inversion.Collection table, List<io.inversion.rql.Term> columnMappedTerms) throws io.inversion.ApiException
      Throws:
      io.inversion.ApiException
    • doUpsert

      public List<String> doUpsert(io.inversion.Collection collection, List<Map<String,Object>> rows) throws io.inversion.ApiException
      Overrides:
      doUpsert in class io.inversion.Db<T extends DynamoDb>
      Throws:
      io.inversion.ApiException
    • buildUpdateItemSpec

      protected com.amazonaws.services.dynamodbv2.document.spec.UpdateItemSpec buildUpdateItemSpec(io.inversion.Collection collection, Map<String,Object> row)
    • doDelete

      public void doDelete(io.inversion.Collection table, List<Map<String,Object>> indexValues) throws io.inversion.ApiException
      Overrides:
      doDelete in class io.inversion.Db<T extends DynamoDb>
      Throws:
      io.inversion.ApiException
    • run

      public Object run(Callable statement)
      TODO: update all calls to DynamoDb to use this method to have consistent error handling.
      Parameters:
      statement -
      Returns:
    • 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<T extends DynamoDb>
      Throws:
      io.inversion.ApiException
    • buildCollection

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

      protected io.inversion.Index addTableIndex(String type, String indexName, List<com.amazonaws.services.dynamodbv2.model.KeySchemaElement> keySchemaList, io.inversion.Collection collection, boolean unique, com.amazonaws.services.dynamodbv2.model.Projection projection, io.inversion.Index primaryIndex)
    • getDynamoTable

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

      public com.amazonaws.services.dynamodbv2.document.Table getDynamoTable(String tableName)
    • 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 io.inversion.Rule<T extends DynamoDb>
    • getDynamoClient

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