File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/main/java/io/github/sideshowcoder/dropwizard_openfeature Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 11package io .github .sideshowcoder .dropwizard_openfeature ;
22
3+ import dev .openfeature .sdk .providers .memory .Flag ;
34import io .dropwizard .core .ConfiguredBundle ;
45import io .dropwizard .core .setup .Environment ;
56
7+ import java .util .Map ;
8+
69/**
710 * TODO tests for OpenFeatureBundle integration into a Dropwizard Application
811 * TODO tests for configured flagd provider with flags serverd from offlineflagspath
1417 * TODO get listed in openfeature.dev
1518 */
1619public class OpenFeatureBundle implements ConfiguredBundle <OpenFeatureBundleConfiguration > {
20+
21+ private final Map <String , Flag <?>> inMemoryFlags ;
22+
23+ public OpenFeatureBundle () {
24+ this (Map .of ());
25+ }
26+
27+ public OpenFeatureBundle (Map <String , Flag <?>> inMemoryFlags ) {
28+ this .inMemoryFlags = inMemoryFlags ;
29+ }
30+
1731 @ Override
1832 public void run (OpenFeatureBundleConfiguration configuration , Environment environment ) {
33+ configuration .getOpenFeatureBundleFactory ().setFlags (inMemoryFlags );
1934 configuration .getOpenFeatureBundleFactory ().startOpenFeatureAPIManager (environment );
2035 configuration .getOpenFeatureBundleFactory ().registerOpenFeatureHealthCheck (environment );
2136 }
You can’t perform that action at this time.
0 commit comments