Skip to content

Commit b027d52

Browse files
committed
fix: getState mandatory on EventProvider
Signed-off-by: Todd Baert <[email protected]>
1 parent 4972291 commit b027d52

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/main/java/dev/openfeature/sdk/EventProvider.java

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
*/
1717
public abstract class EventProvider implements FeatureProvider {
1818

19+
/**
20+
* {@inheritDoc}
21+
*/
22+
@Override
23+
public abstract ProviderState getState();
24+
1925
private TriConsumer<EventProvider, ProviderEvent, ProviderEventDetails> onEmit = null;
2026

2127
/**

src/main/java/dev/openfeature/sdk/FeatureProvider.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ default List<Hook> getProviderHooks() {
3131
* if they have special initialization needed prior being called for flag
3232
* evaluation.
3333
* <p>
34-
* It is ok, if the method is expensive as it is executed in the background. All
34+
* It is ok if the method is expensive as it is executed in the background. All
3535
* runtime exceptions will be
3636
* caught and logged.
3737
* </p>
@@ -46,7 +46,7 @@ default void initialize(EvaluationContext evaluationContext) throws Exception {
4646
* Providers can overwrite this method, if they have special shutdown actions
4747
* needed.
4848
* <p>
49-
* It is ok, if the method is expensive as it is executed in the background. All
49+
* It is ok if the method is expensive as it is executed in the background. All
5050
* runtime exceptions will be
5151
* caught and logged.
5252
* </p>
@@ -57,7 +57,11 @@ default void shutdown() {
5757

5858
/**
5959
* Returns a representation of the current readiness of the provider.
60-
* Providers which do not implement this method are assumed to be ready immediately.
60+
* If the provider needs to be initialized, it should return {@link ProviderState#NOT_READY}.
61+
* If the provider is in an error state, it should return {@link ProviderState#ERROR}.
62+
* If the provider is functioning normally, it should return {@link ProviderState#READY}.
63+
*
64+
* <p><i>Providers which do not implement this method are assumed to be ready immediately.</i></p>
6165
*
6266
* @return ProviderState
6367
*/

0 commit comments

Comments
 (0)