|
26 | 26 |
|
27 | 27 | public class DynamoDBBucketManagerFactory implements BucketManagerFactory<DynamoDBBucketManager> { |
28 | 28 |
|
29 | | - private DynamoDbClient client; |
30 | | - |
31 | | - public DynamoDBBucketManagerFactory(DynamoDbClient client) { |
32 | | - this.client = client; |
33 | | - } |
| 29 | + private DynamoDbClient client; |
34 | 30 |
|
35 | | - @Override |
36 | | - public DynamoDBBucketManager getBucketManager(String bucketName) { |
37 | | - |
38 | | - return getBucketManager(bucketName, null, null); |
39 | | - } |
40 | | - |
41 | | - public DynamoDBBucketManager getBucketManager(String bucketName,Long readCapacityUnits , Long writeCapacityUnit) { |
42 | | - |
43 | | - DynamoTableUtils.manageTables(bucketName, client,readCapacityUnits,writeCapacityUnit); |
44 | | - return new DynamoDBBucketManager(client, bucketName); |
45 | | - } |
46 | | - |
47 | | - @Override |
48 | | - public <T> List<T> getList(String bucketName, Class<T> clazz) { |
49 | | - throw new UnsupportedOperationException("The DynamoDB does not support getMap method"); |
50 | | - } |
| 31 | + public DynamoDBBucketManagerFactory(DynamoDbClient client) { |
| 32 | + this.client = client; |
| 33 | + } |
51 | 34 |
|
52 | | - @Override |
53 | | - public <T> Set<T> getSet(String bucketName, Class<T> clazz) { |
54 | | - throw new UnsupportedOperationException("The DynamoDB does not support getMap method"); |
55 | | - } |
| 35 | + @Override |
| 36 | + public DynamoDBBucketManager getBucketManager(String bucketName) { |
56 | 37 |
|
57 | | - @Override |
58 | | - public <T> Queue<T> getQueue(String bucketName, Class<T> clazz) { |
59 | | - throw new UnsupportedOperationException("The DynamoDB does not support getMap method"); |
60 | | - } |
| 38 | + return getBucketManager(bucketName, null, null); |
| 39 | + } |
61 | 40 |
|
62 | | - @Override |
63 | | - public <K, V> Map<K, V> getMap(String bucketName, Class<K> keyValue, Class<V> valueValue) { |
64 | | - throw new UnsupportedOperationException("The DynamoDB does not support getMap method"); |
65 | | - } |
| 41 | + public DynamoDBBucketManager getBucketManager(String bucketName, Long readCapacityUnits, Long writeCapacityUnit) { |
66 | 42 |
|
67 | | - @Override |
68 | | - public void close() { |
69 | | - client.close(); |
70 | | - } |
| 43 | + DynamoTableUtils.manageTables(bucketName, client, readCapacityUnits, writeCapacityUnit); |
| 44 | + return new DynamoDBBucketManager(client, bucketName); |
| 45 | + } |
| 46 | + |
| 47 | + @Override |
| 48 | + public <T> List<T> getList(String bucketName, Class<T> clazz) { |
| 49 | + throw new UnsupportedOperationException("The DynamoDB does not support getMap method"); |
| 50 | + } |
| 51 | + |
| 52 | + @Override |
| 53 | + public <T> Set<T> getSet(String bucketName, Class<T> clazz) { |
| 54 | + throw new UnsupportedOperationException("The DynamoDB does not support getMap method"); |
| 55 | + } |
| 56 | + |
| 57 | + @Override |
| 58 | + public <T> Queue<T> getQueue(String bucketName, Class<T> clazz) { |
| 59 | + throw new UnsupportedOperationException("The DynamoDB does not support getMap method"); |
| 60 | + } |
| 61 | + |
| 62 | + @Override |
| 63 | + public <K, V> Map<K, V> getMap(String bucketName, Class<K> keyValue, Class<V> valueValue) { |
| 64 | + throw new UnsupportedOperationException("The DynamoDB does not support getMap method"); |
| 65 | + } |
| 66 | + |
| 67 | + @Override |
| 68 | + public void close() { |
| 69 | + client.close(); |
| 70 | + } |
71 | 71 | } |
0 commit comments