@Override public TableFactory getTableFactory(DynamoDBMapperConfig config) { final ConversionSchema schema = config.getConversionSchema(); if (!cache.containsKey(schema)) { RuleFactory<Object> rules = rulesOf(config, s3Links, this); rules = new ConversionSchemas.ItemConverterRuleFactory<Object>(config, s3Links, rules); cache.putIfAbsent(schema, new StandardTableFactory(rules)); } return cache.get(schema); } }
/** * Constructs a new configuration object with the consistent read behavior * given. * @see ConsistentReads#config */ @Deprecated public DynamoDBMapperConfig(ConsistentReads consistentReads) { this(null, consistentReads, null, null, null, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the object table name resolver strategy given. * @see DynamoDBMapperConfig#builder() */ @Deprecated public DynamoDBMapperConfig(ObjectTableNameResolver objectTableNameResolver) { this(null, null, null, null, objectTableNameResolver, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the pagination loading * strategy given. * @see PaginationLoadingStrategy#config */ @Deprecated public DynamoDBMapperConfig( PaginationLoadingStrategy paginationLoadingStrategy) { this(null, null, null, null, null, paginationLoadingStrategy, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the save behavior given. * @see SaveBehavior#config */ @Deprecated public DynamoDBMapperConfig(SaveBehavior saveBehavior) { this(saveBehavior, null, null, null, null, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the table name override given. * @see TableNameOverride#config */ @Deprecated public DynamoDBMapperConfig(TableNameOverride tableNameOverride) { this(null, null, tableNameOverride, null, null, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the table name resolver strategy given. * @see DynamoDBMapperConfig#builder() */ @Deprecated public DynamoDBMapperConfig(TableNameResolver tableNameResolver) { this(null, null, null, tableNameResolver, null, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the table name resolver strategies given. * @see DynamoDBMapperConfig#builder() */ @Deprecated public DynamoDBMapperConfig(TableNameResolver tableNameResolver, ObjectTableNameResolver objectTableNameResolver) { this(null, null, null, tableNameResolver, objectTableNameResolver, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
paginationLoadingStrategy, requestMetricCollector, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy());
private ItemConverterRule(final ConvertibleType<V> type) { this.type = type; } @Override
/** * Creates a new builder, optionally initialized with the defaults. */ private Builder(final boolean defaults) { if (defaults == true) { saveBehavior = DEFAULT.getSaveBehavior(); consistentReads = DEFAULT.getConsistentReads(); paginationLoadingStrategy = DEFAULT.getPaginationLoadingStrategy(); conversionSchema = DEFAULT.getConversionSchema(); batchWriteRetryStrategy = DEFAULT.getBatchWriteRetryStrategy(); batchLoadRetryStrategy = DEFAULT.getBatchLoadRetryStrategy(); } }
/** * Creates a new set of conversion rules based on the configuration. */ private static final <T> RuleFactory<T> rulesOf(DynamoDBMapperConfig config, S3Link.Factory s3Links, DynamoDBMapperModelFactory models) { final boolean ver1 = (config.getConversionSchema() == ConversionSchemas.V1); final boolean ver2 = (config.getConversionSchema() == ConversionSchemas.V2); final boolean v2Compatible = (config.getConversionSchema() == ConversionSchemas.V2_COMPATIBLE); final DynamoDBTypeConverterFactory.Builder scalars = config.getTypeConverterFactory().override(); scalars.with(String.class, S3Link.class, s3Links); final Rules<T> factory = new Rules<T>(scalars.build()); factory.add(factory.new NativeType(!ver1)); factory.add(factory.new V2CompatibleBool(v2Compatible)); factory.add(factory.new NativeBool(ver2)); factory.add(factory.new StringScalar(true)); factory.add(factory.new DateToEpochRule(true)); factory.add(factory.new NumberScalar(true)); factory.add(factory.new BinaryScalar(true)); factory.add(factory.new NativeBoolSet(ver2)); factory.add(factory.new StringScalarSet(true)); factory.add(factory.new NumberScalarSet(true)); factory.add(factory.new BinaryScalarSet(true)); factory.add(factory.new ObjectSet(ver2)); factory.add(factory.new ObjectStringSet(!ver2)); factory.add(factory.new ObjectList(!ver1)); factory.add(factory.new ObjectMap(!ver1)); factory.add(factory.new ObjectDocumentMap(!ver1, models, config)); return factory; }
@Override public TableFactory getTableFactory(DynamoDBMapperConfig config) { final ConversionSchema schema = config.getConversionSchema(); if (!cache.containsKey(schema)) { RuleFactory<Object> rules = rulesOf(config, s3Links, this); rules = new ConversionSchemas.ItemConverterRuleFactory<Object>(config, s3Links, rules); cache.putIfAbsent(schema, new StandardTableFactory(rules)); } return cache.get(schema); } }
/** * Constructs a new configuration object with the consistent read behavior * given. * @see ConsistentReads#config */ @Deprecated public DynamoDBMapperConfig(ConsistentReads consistentReads) { this(null, consistentReads, null, null, null, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the object table name resolver strategy given. * @see DynamoDBMapperConfig#builder() */ @Deprecated public DynamoDBMapperConfig(ObjectTableNameResolver objectTableNameResolver) { this(null, null, null, null, objectTableNameResolver, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the save behavior given. * @see SaveBehavior#config */ @Deprecated public DynamoDBMapperConfig(SaveBehavior saveBehavior) { this(saveBehavior, null, null, null, null, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the table name resolver strategy given. * @see DynamoDBMapperConfig#builder() */ @Deprecated public DynamoDBMapperConfig(TableNameResolver tableNameResolver) { this(null, null, null, tableNameResolver, null, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the table name resolver strategies given. * @see DynamoDBMapperConfig#builder() */ @Deprecated public DynamoDBMapperConfig(TableNameResolver tableNameResolver, ObjectTableNameResolver objectTableNameResolver) { this(null, null, null, tableNameResolver, objectTableNameResolver, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the table name override given. * @see TableNameOverride#config */ @Deprecated public DynamoDBMapperConfig(TableNameOverride tableNameOverride) { this(null, null, tableNameOverride, null, null, null, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }
/** * Constructs a new configuration object with the pagination loading * strategy given. * @see PaginationLoadingStrategy#config */ @Deprecated public DynamoDBMapperConfig( PaginationLoadingStrategy paginationLoadingStrategy) { this(null, null, null, null, null, paginationLoadingStrategy, null, DEFAULT.getConversionSchema(), DEFAULT.getBatchWriteRetryStrategy(), DEFAULT.getBatchLoadRetryStrategy()); }