All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.launchdarkly.client.FeatureStoreClientWrapper Maven / Gradle / Ivy

There is a newer version: 4.61
Show newest version
package com.launchdarkly.client;

import java.io.IOException;
import java.util.Map;

/**
 * Provides additional behavior that the client requires before or after feature store operations.
 * Currently this just means sorting the data set for init(). In the future we may also use this
 * to provide an update listener capability.
 * 
 * @since 4.6.1
 */
class FeatureStoreClientWrapper implements FeatureStore {
  private final FeatureStore store;
  
  public FeatureStoreClientWrapper(FeatureStore store) {
    this.store = store;
  }
  
  @Override
  public void init(Map, Map> allData) {
    store.init(FeatureStoreDataSetSorter.sortAllCollections(allData));
  }

  @Override
  public  T get(VersionedDataKind kind, String key) {
    return store.get(kind, key);
  }

  @Override
  public  Map all(VersionedDataKind kind) {
    return store.all(kind);
  }

  @Override
  public  void delete(VersionedDataKind kind, String key, int version) {
    store.delete(kind, key, version);
  }

  @Override
  public  void upsert(VersionedDataKind kind, T item) {
    store.upsert(kind, item);
  }

  @Override
  public boolean initialized() {
    return store.initialized();
  }

  @Override
  public void close() throws IOException {
    store.close();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy