Class AmazonDynamoDbConnect


  • public class AmazonDynamoDbConnect
    extends java.lang.Object
    AmazonDynamoDB connect functionality.
    Author:
    Daniel Sagenschneider
    • 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
        Local Region.
        See Also:
        Constant Field Values
    • Method Detail

      • 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 up RegionMetadata.
      • 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.