Package net.officefloor.nosql.dynamodb
Class AmazonDynamoDbConnect
- java.lang.Object
-
- net.officefloor.nosql.dynamodb.AmazonDynamoDbConnect
-
public class AmazonDynamoDbConnect extends java.lang.Object
AmazonDynamoDB
connect functionality.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AWS_SAM_LOCAL
Environment variable to determine if running AWS SAM locally.static java.lang.String
DYNAMODB_SAM_LOCAL_HOST_NAME
DynamoDB name for local SAM network.static java.lang.String
LOCAL_REGION
LocalRegion
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.amazonaws.services.dynamodbv2.AmazonDynamoDB
connect(SourceContext context)
Connects toAmazonDynamoDB
.static void
setAmazonDynamoDbFactory(AmazonDynamoDbFactory amazonDynamoDbFactory)
Sets using theAmazonDynamoDbFactory
.static java.lang.Runnable
setupLocalDynamoMetaData(int port)
Sets up the localRegionMetadata
for testing with DynamoDB.
-
-
-
Field Detail
-
AWS_SAM_LOCAL
public static final java.lang.String AWS_SAM_LOCAL
Environment variable to determine if running AWS SAM locally.- See Also:
- Constant Field Values
-
DYNAMODB_SAM_LOCAL_HOST_NAME
public static final java.lang.String DYNAMODB_SAM_LOCAL_HOST_NAME
DynamoDB name for local SAM network.- See Also:
- Constant Field Values
-
LOCAL_REGION
public static final java.lang.String LOCAL_REGION
LocalRegion
.- See Also:
- Constant Field Values
-
-
Method Detail
-
setAmazonDynamoDbFactory
public static void setAmazonDynamoDbFactory(AmazonDynamoDbFactory amazonDynamoDbFactory)
Sets using the
AmazonDynamoDbFactory
.This is typically used for testing to allow overriding the
AmazonDynamoDbFactory
being used.- Parameters:
amazonDynamoDbFactory
-AmazonDynamoDbFactory
. May benull
to not override.
-
setupLocalDynamoMetaData
public static java.lang.Runnable setupLocalDynamoMetaData(int port)
Sets up the local
RegionMetadata
for testing with DynamoDB.This is used by testing infrastructure. It should not be called directly.
- Parameters:
port
- Port that DynamoDB is running on.- Returns:
Runnable
to clean upRegionMetadata
.
-
connect
public static com.amazonaws.services.dynamodbv2.AmazonDynamoDB connect(SourceContext context) throws java.lang.Exception
Connects to
AmazonDynamoDB
.Note that the
AmazonDynamoDB
instance is not managed. It will need to be manually shutdown once use is complete.- Parameters:
context
-SourceContext
.- Returns:
AmazonDynamoDB
.- Throws:
java.lang.Exception
- If fails to connect.
-
-