-
public interface FeatureProvider
-
-
Method Summary
Modifier and Type Method Description abstract Unitinitialize(EvaluationContext initialContext)Called by OpenFeatureAPI whenever the new Provider is registered This function should block until ready and throw exceptions if it fails to initialize abstract Unitshutdown()Called when the lifecycle of the OpenFeatureClient is over to release resources/threads abstract UnitonContextSet(EvaluationContext oldContext, EvaluationContext newContext)Called by OpenFeatureAPI whenever a new EvaluationContext is set by the application Perform blocking work here until the provider is ready again or throws an exception abstract ProviderEvaluation<Boolean>getBooleanEvaluation(String key, Boolean defaultValue, EvaluationContext context)abstract ProviderEvaluation<String>getStringEvaluation(String key, String defaultValue, EvaluationContext context)abstract ProviderEvaluation<Integer>getIntegerEvaluation(String key, Integer defaultValue, EvaluationContext context)abstract ProviderEvaluation<Double>getDoubleEvaluation(String key, Double defaultValue, EvaluationContext context)abstract ProviderEvaluation<Value>getObjectEvaluation(String key, Value defaultValue, EvaluationContext context)Unittrack(String trackingEventName, EvaluationContext context, TrackingEventDetails details)Feature provider implementations can opt in for to support Tracking by implementing this method. Flow<OpenFeatureProviderEvents>observe()Used by providers to expose internal events to the SDK or the application. abstract List<Hook<?>>getHooks()abstract ProviderMetadatagetMetadata()-
-
Method Detail
-
initialize
abstract Unit initialize(EvaluationContext initialContext)
Called by OpenFeatureAPI whenever the new Provider is registered This function should block until ready and throw exceptions if it fails to initialize
- Parameters:
initialContext- any initial context to be set before the provider is ready
-
shutdown
abstract Unit shutdown()
Called when the lifecycle of the OpenFeatureClient is over to release resources/threads
-
onContextSet
abstract Unit onContextSet(EvaluationContext oldContext, EvaluationContext newContext)
Called by OpenFeatureAPI whenever a new EvaluationContext is set by the application Perform blocking work here until the provider is ready again or throws an exception
- Parameters:
oldContext- The old EvaluationContextnewContext- The new EvaluationContext
-
getBooleanEvaluation
abstract ProviderEvaluation<Boolean> getBooleanEvaluation(String key, Boolean defaultValue, EvaluationContext context)
-
getStringEvaluation
abstract ProviderEvaluation<String> getStringEvaluation(String key, String defaultValue, EvaluationContext context)
-
getIntegerEvaluation
abstract ProviderEvaluation<Integer> getIntegerEvaluation(String key, Integer defaultValue, EvaluationContext context)
-
getDoubleEvaluation
abstract ProviderEvaluation<Double> getDoubleEvaluation(String key, Double defaultValue, EvaluationContext context)
-
getObjectEvaluation
abstract ProviderEvaluation<Value> getObjectEvaluation(String key, Value defaultValue, EvaluationContext context)
-
track
Unit track(String trackingEventName, EvaluationContext context, TrackingEventDetails details)
Feature provider implementations can opt in for to support Tracking by implementing this method.
Performs tracking of a particular action or application state.
- Parameters:
trackingEventName- Event name to trackcontext- Evaluation context used in flag evaluation (Optional)details- Data pertinent to a particular tracking event (Optional)
-
observe
Flow<OpenFeatureProviderEvents> observe()
Used by providers to expose internal events to the SDK or the application. This can be optionally implemented by the provider to expose a flow of internal events.
-
getMetadata
abstract ProviderMetadata getMetadata()
-
-
-
-