Class Entity2DynamoDBTableSynchronizer<T,​ID>

  • All Implemented Interfaces:
    java.util.EventListener, org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>, org.springframework.data.repository.core.support.RepositoryProxyPostProcessor

    public class Entity2DynamoDBTableSynchronizer<T,​ID>
    extends EntityInformationProxyPostProcessor<T,​ID>
    implements org.springframework.data.repository.core.support.RepositoryProxyPostProcessor, org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
    This is the base class for all classes performing the validation or auto-creation of tables based on the entity classes. //TODO: It would be nice if the checks would run in parallel via a TaskScheduler (if available)
    See Also:
    Entity2DDL
    • Constructor Summary

      Constructors 
      Constructor Description
      Entity2DynamoDBTableSynchronizer​(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper mapper, java.lang.String mode, java.lang.String gsiProjectionType, long readCapacity, long writeCapacity)  
      Entity2DynamoDBTableSynchronizer​(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper mapper, Entity2DDL mode)  
    • Constructor Detail

      • Entity2DynamoDBTableSynchronizer

        public Entity2DynamoDBTableSynchronizer​(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB,
                                                com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper mapper,
                                                Entity2DDL mode)
      • Entity2DynamoDBTableSynchronizer

        @Autowired
        public Entity2DynamoDBTableSynchronizer​(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB,
                                                com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper mapper,
                                                @Value("${spring.data.dynamodb.entity2ddl.auto:none}")
                                                java.lang.String mode,
                                                @Value("${spring.data.dynamodb.entity2ddl.gsiProjectionType:ALL}")
                                                java.lang.String gsiProjectionType,
                                                @Value("${spring.data.dynamodb.entity2ddl.readCapacity:10}")
                                                long readCapacity,
                                                @Value("${spring.data.dynamodb.entity2ddl.writeCapacity:1}")
                                                long writeCapacity)
    • Method Detail

      • onApplicationEvent

        public void onApplicationEvent​(org.springframework.context.event.ApplicationContextEvent event)
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener<T>
      • synchronize

        protected void synchronize​(DynamoDBEntityInformation<T,​ID> entityInformation,
                                   org.springframework.context.event.ApplicationContextEvent event)
                            throws com.amazonaws.services.dynamodbv2.util.TableUtils.TableNeverTransitionedToStateException,
                                   java.lang.InterruptedException
        Throws:
        com.amazonaws.services.dynamodbv2.util.TableUtils.TableNeverTransitionedToStateException
        java.lang.InterruptedException