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 1
1
package io .github .sideshowcoder .dropwizard_openfeature ;
2
2
3
+ import dev .openfeature .sdk .providers .memory .Flag ;
3
4
import io .dropwizard .core .ConfiguredBundle ;
4
5
import io .dropwizard .core .setup .Environment ;
5
6
7
+ import java .util .Map ;
8
+
6
9
/**
7
10
* TODO tests for OpenFeatureBundle integration into a Dropwizard Application
8
11
* TODO tests for configured flagd provider with flags serverd from offlineflagspath
14
17
* TODO get listed in openfeature.dev
15
18
*/
16
19
public 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
+
17
31
@ Override
18
32
public void run (OpenFeatureBundleConfiguration configuration , Environment environment ) {
33
+ configuration .getOpenFeatureBundleFactory ().setFlags (inMemoryFlags );
19
34
configuration .getOpenFeatureBundleFactory ().startOpenFeatureAPIManager (environment );
20
35
configuration .getOpenFeatureBundleFactory ().registerOpenFeatureHealthCheck (environment );
21
36
}
You can’t perform that action at this time.
0 commit comments