Skip to content

Commit b06cfa9

Browse files
committed
API updates
1 parent af51f64 commit b06cfa9

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This assumes that you have already installed the LaunchDarkly Java SDK.
4444
5. When configuring your SDK client, add the DynamoDB feature store:
4545

4646
DynamoDbFeatureStoreBuilder store = DynamoDbComponents.dynamoDbFeatureStore("my-table-name")
47-
.caching(FeatureStoreCaching.enabled().ttlSeconds(30));
47+
.caching(FeatureStoreCacheConfig.enabled().ttlSeconds(30));
4848
4949
LDConfig config = new LDConfig.Builder()
5050
.featureStoreFactory(store)
@@ -63,7 +63,7 @@ Caching behavior
6363
To reduce traffic to DynamoDB, there is an optional in-memory cache that retains the last known data for a configurable amount of time. This is on by default; to turn it off (and guarantee that the latest feature flag data will always be retrieved from DynamoDB for every flag evaluation), configure the store as follows:
6464

6565
DynamoDbFeatureStoreBuilder store = DynamoDbComponents.dynamoDbFeatureStore("my-table-name")
66-
.caching(FeatureStoreCaching.disabled());
66+
.caching(FeatureStoreCacheConfig.disabled());
6767

6868
For other ways to control the behavior of the cache, see `DynamoDbFeatureStoreBuilder.caching()`.
6969

src/main/java/com/launchdarkly/client/dynamodb/DynamoDbFeatureStoreBuilder.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
99
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder;
1010
import com.launchdarkly.client.FeatureStore;
11-
import com.launchdarkly.client.FeatureStoreCaching;
11+
import com.launchdarkly.client.FeatureStoreCacheConfig;
1212
import com.launchdarkly.client.FeatureStoreFactory;
1313
import com.launchdarkly.client.LDConfig;
1414
import com.launchdarkly.client.utils.CachingStoreWrapper;
@@ -34,7 +34,7 @@ public class DynamoDbFeatureStoreBuilder implements FeatureStoreFactory {
3434
private AmazonDynamoDB existingClient;
3535
private AmazonDynamoDBClientBuilder clientBuilder;
3636

37-
private FeatureStoreCaching caching = FeatureStoreCaching.DEFAULT;
37+
private FeatureStoreCacheConfig caching = FeatureStoreCacheConfig.DEFAULT;
3838

3939
DynamoDbFeatureStoreBuilder(String tableName) {
4040
this.tableName = tableName;
@@ -45,7 +45,7 @@ public class DynamoDbFeatureStoreBuilder implements FeatureStoreFactory {
4545
public FeatureStore createFeatureStore() {
4646
AmazonDynamoDB client = (existingClient != null) ? existingClient : clientBuilder.build();
4747
DynamoDbFeatureStoreCore core = new DynamoDbFeatureStoreCore(client, tableName, prefix);
48-
CachingStoreWrapper wrapper = new CachingStoreWrapper.Builder(core).caching(caching).build();
48+
CachingStoreWrapper wrapper = CachingStoreWrapper.builder(core).caching(caching).build();
4949
return wrapper;
5050
}
5151

@@ -138,13 +138,13 @@ public DynamoDbFeatureStoreBuilder existingClient(AmazonDynamoDB existingClient)
138138

139139
/**
140140
* Specifies whether local caching should be enabled and if so, sets the cache properties. Local
141-
* caching is enabled by default; see {@link FeatureStoreCaching#DEFAULT}. To disable it, pass
141+
* caching is enabled by default; see {@link FeatureStoreCacheConfig#DEFAULT}. To disable it, pass
142142
* {@link FeatureStoreCaching#disabled()} to this method.
143143
*
144-
* @param caching a {@link FeatureStoreCaching} object specifying caching parameters
144+
* @param caching a {@link FeatureStoreCacheConfig} object specifying caching parameters
145145
* @return the builder
146146
*/
147-
public DynamoDbFeatureStoreBuilder caching(FeatureStoreCaching caching) {
147+
public DynamoDbFeatureStoreBuilder caching(FeatureStoreCacheConfig caching) {
148148
this.caching = caching;
149149
return this;
150150
}

src/test/java/com/launchdarkly/client/dynamodb/DynamoDbFeatureStoreTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.amazonaws.services.dynamodbv2.model.WriteRequest;
2323
import com.google.common.collect.ImmutableList;
2424
import com.launchdarkly.client.FeatureStore;
25-
import com.launchdarkly.client.FeatureStoreCaching;
25+
import com.launchdarkly.client.FeatureStoreCacheConfig;
2626
import com.launchdarkly.client.FeatureStoreDatabaseTestBase;
2727
import com.launchdarkly.client.utils.CachingStoreWrapper;
2828

@@ -128,7 +128,7 @@ private void createTableIfNecessary() {
128128
private DynamoDbFeatureStoreBuilder baseBuilder() {
129129
return DynamoDbComponents.dynamoDbFeatureStore(TABLE_NAME)
130130
.endpointAndRegion(DYNAMODB_ENDPOINT, Regions.US_EAST_1.name())
131-
.caching(cached ? FeatureStoreCaching.enabled().ttlSeconds(30) : FeatureStoreCaching.disabled())
131+
.caching(cached ? FeatureStoreCacheConfig.enabled().ttlSeconds(30) : FeatureStoreCacheConfig.disabled())
132132
.credentials(getTestCredentials());
133133
}
134134

0 commit comments

Comments
 (0)