Interface FeatureProvider

All Known Implementing Classes:
EventProvider, InMemoryProvider, NoOpProvider

public interface FeatureProvider
The interface implemented by upstream flag providers to resolve flags for their service. If you want to support realtime events with your provider, you should extend EventProvider
  • Method Details

    • getMetadata

      Metadata getMetadata()
    • getProviderHooks

      default List<Hook> getProviderHooks()
    • getBooleanEvaluation

      ProviderEvaluation<Boolean> getBooleanEvaluation(String key, Boolean defaultValue, EvaluationContext ctx)
    • getStringEvaluation

      ProviderEvaluation<String> getStringEvaluation(String key, String defaultValue, EvaluationContext ctx)
    • getIntegerEvaluation

      ProviderEvaluation<Integer> getIntegerEvaluation(String key, Integer defaultValue, EvaluationContext ctx)
    • getDoubleEvaluation

      ProviderEvaluation<Double> getDoubleEvaluation(String key, Double defaultValue, EvaluationContext ctx)
    • getObjectEvaluation

      ProviderEvaluation<Value> getObjectEvaluation(String key, Value defaultValue, EvaluationContext ctx)
    • initialize

      default void initialize(EvaluationContext evaluationContext) throws Exception
      This method is called before a provider is used to evaluate flags. Providers can overwrite this method, if they have special initialization needed prior being called for flag evaluation.

      It is ok if the method is expensive as it is executed in the background. All runtime exceptions will be caught and logged.

      Throws:
      Exception
    • shutdown

      default void shutdown()
      This method is called when a new provider is about to be used to evaluate flags, or the SDK is shut down. Providers can overwrite this method, if they have special shutdown actions needed.

      It is ok if the method is expensive as it is executed in the background. All runtime exceptions will be caught and logged.

    • getState

      @Deprecated default ProviderState getState()
      Deprecated.
      The state is handled by the SDK internally. Query the state from the Client instead.
      Returns a representation of the current readiness of the provider. If the provider needs to be initialized, it should return ProviderState.NOT_READY. If the provider is in an error state, it should return ProviderState.ERROR. If the provider is functioning normally, it should return ProviderState.READY.

      Providers which do not implement this method are assumed to be ready immediately.

      Returns:
      ProviderState
    • track

      default void track(String eventName, EvaluationContext context, TrackingEventDetails details)
      Feature provider implementations can opt in for to support Tracking by implementing this method.
      Parameters:
      eventName - The name of the tracking event
      context - Evaluation context used in flag evaluation (Optional)
      details - Data pertinent to a particular tracking event (Optional)