Package io.inversion.dynamodb
Class DynamoDb<T extends DynamoDb>
- java.lang.Object
-
- io.inversion.Rule<T>
-
- io.inversion.Db<T>
-
- io.inversion.dynamodb.DynamoDb<T>
-
- All Implemented Interfaces:
java.lang.Comparable<T>
public class DynamoDb<T extends DynamoDb> extends io.inversion.Db<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringawsAccessKeyprotected java.lang.StringawsEndpointprotected java.lang.StringawsRegionprotected java.lang.StringawsSecretKeyprotected intbatchMaxprotected com.amazonaws.services.dynamodbv2.AmazonDynamoDBdynamoClientstatic java.lang.StringGLOBAL_SECONDARY_INDEX_TYPEstatic java.lang.StringLOCAL_SECONDARY_INDEX_TYPEstatic java.lang.StringPRIMARY_INDEX_NAMEstatic java.lang.StringPRIMARY_INDEX_TYPE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected io.inversion.IndexaddTableIndex(java.lang.String type, java.lang.String indexName, java.util.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.CollectionbuildCollection(java.lang.String tableName, java.lang.String collectionName)static com.amazonaws.services.dynamodbv2.AmazonDynamoDBbuildDynamoClient(java.lang.String awsRegion, java.lang.String awsAccessKey, java.lang.String awsSecretKey, java.lang.String awsEndpoint)protected com.amazonaws.services.dynamodbv2.document.spec.UpdateItemSpecbuildUpdateItemSpec(io.inversion.Collection collection, java.util.Map<java.lang.String,java.lang.Object> row)voidconfigDb()voiddeleteRow(io.inversion.Collection table, java.util.Map<java.lang.String,java.lang.Object> row)voiddoDelete(io.inversion.Collection table, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> indexValues)io.inversion.ResultsdoSelect(io.inversion.Collection table, java.util.List<io.inversion.rql.Term> columnMappedTerms)io.inversion.ResultsdoSelect0(io.inversion.Collection table, java.util.List<io.inversion.rql.Term> columnMappedTerms)java.util.List<java.lang.String>doUpsert(io.inversion.Collection collection, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> rows)static io.inversion.IndexfindIndexByName(io.inversion.Collection coll, java.lang.String name)com.amazonaws.services.dynamodbv2.AmazonDynamoDBgetDynamoClient()com.amazonaws.services.dynamodbv2.document.TablegetDynamoTable(io.inversion.Collection table)com.amazonaws.services.dynamodbv2.document.TablegetDynamoTable(java.lang.String tableName)protected static java.lang.StringgetTypeStringFromObject(java.lang.Object obj)java.lang.Objectrun(java.util.concurrent.Callable statement)TODO: update all calls to DynamoDb to use this method to have consistent error handling.java.lang.StringtoString()DynamoDbwithAwsAccessKey(java.lang.String awsAccessKey)DynamoDbwithAwsEndpoint(java.lang.String awsEndpoint)DynamoDbwithAwsRegion(java.lang.String awsRegion)DynamoDbwithAwsSecretKey(java.lang.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
-
-
-
-
Field Detail
-
PRIMARY_INDEX_NAME
public static final java.lang.String PRIMARY_INDEX_NAME
- See Also:
- Constant Field Values
-
PRIMARY_INDEX_TYPE
public static final java.lang.String PRIMARY_INDEX_TYPE
- See Also:
- Constant Field Values
-
LOCAL_SECONDARY_INDEX_TYPE
public static final java.lang.String LOCAL_SECONDARY_INDEX_TYPE
- See Also:
- Constant Field Values
-
GLOBAL_SECONDARY_INDEX_TYPE
public static final java.lang.String GLOBAL_SECONDARY_INDEX_TYPE
- See Also:
- Constant Field Values
-
batchMax
protected final int batchMax
- See Also:
- Constant Field Values
-
awsAccessKey
protected java.lang.String awsAccessKey
-
awsSecretKey
protected java.lang.String awsSecretKey
-
awsRegion
protected java.lang.String awsRegion
-
awsEndpoint
protected java.lang.String awsEndpoint
-
dynamoClient
protected transient com.amazonaws.services.dynamodbv2.AmazonDynamoDB dynamoClient
-
-
Method Detail
-
findIndexByName
public static io.inversion.Index findIndexByName(io.inversion.Collection coll, java.lang.String name)
-
getTypeStringFromObject
protected static java.lang.String getTypeStringFromObject(java.lang.Object obj)
-
buildDynamoClient
public static com.amazonaws.services.dynamodbv2.AmazonDynamoDB buildDynamoClient(java.lang.String awsRegion, java.lang.String awsAccessKey, java.lang.String awsSecretKey, java.lang.String awsEndpoint)
-
doSelect
public io.inversion.Results doSelect(io.inversion.Collection table, java.util.List<io.inversion.rql.Term> columnMappedTerms) throws io.inversion.ApiException
-
doSelect0
public io.inversion.Results doSelect0(io.inversion.Collection table, java.util.List<io.inversion.rql.Term> columnMappedTerms) throws io.inversion.ApiException- Throws:
io.inversion.ApiException
-
doUpsert
public java.util.List<java.lang.String> doUpsert(io.inversion.Collection collection, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> rows) throws io.inversion.ApiException
-
buildUpdateItemSpec
protected com.amazonaws.services.dynamodbv2.document.spec.UpdateItemSpec buildUpdateItemSpec(io.inversion.Collection collection, java.util.Map<java.lang.String,java.lang.Object> row)
-
doDelete
public void doDelete(io.inversion.Collection table, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> indexValues) throws io.inversion.ApiException
-
run
public java.lang.Object run(java.util.concurrent.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, java.util.Map<java.lang.String,java.lang.Object> row) throws io.inversion.ApiException- Throws:
io.inversion.ApiException
-
configDb
public void configDb() throws io.inversion.ApiException
-
buildCollection
protected io.inversion.Collection buildCollection(java.lang.String tableName, java.lang.String collectionName)
-
addTableIndex
protected io.inversion.Index addTableIndex(java.lang.String type, java.lang.String indexName, java.util.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(java.lang.String tableName)
-
withAwsRegion
public DynamoDb withAwsRegion(java.lang.String awsRegion)
-
withAwsAccessKey
public DynamoDb withAwsAccessKey(java.lang.String awsAccessKey)
-
withAwsSecretKey
public DynamoDb withAwsSecretKey(java.lang.String awsSecretKey)
-
withAwsEndpoint
public DynamoDb withAwsEndpoint(java.lang.String awsEndpoint)
-
toString
public java.lang.String toString()
-
getDynamoClient
public com.amazonaws.services.dynamodbv2.AmazonDynamoDB getDynamoClient()
-
-