Interface IGBFeaturesRepository

All Known Implementing Classes:
GBFeaturesRepository, LocalGbFeatureRepository, NativeJavaGbFeatureRepository

public interface IGBFeaturesRepository
INTERNAL: Interface that is used internally for the GBFeaturesRepository
  • Method Details

    • initialize

      void initialize() throws FeatureFetchException
      Throws:
      FeatureFetchException
    • initialize

      void initialize(Boolean retryOnFailure) throws FeatureFetchException
      Throws:
      FeatureFetchException
    • getFeaturesJson

      String getFeaturesJson()
      Required implementation to get the featuresJson
      Returns:
      featuresJson String
    • onFeaturesRefresh

      @Deprecated void onFeaturesRefresh(FeatureRefreshCallback callback)
      Registers a legacy feature refresh callback.
      Parameters:
      callback - callback to register
    • addFeatureRefreshListener

      default void addFeatureRefreshListener(FeatureRefreshListener listener)
      Registers a listener notified after every refresh attempt.

      Threading: implementations dispatch repository-level listeners synchronously on the refresh thread (polling scheduler, SSE event thread, or the caller of a manual refresh), so a slow listener delays feature updates. Use GrowthBookClient.addFeatureRefreshListener(FeatureRefreshListener) instead when you need callbacks dispatched off the refresh thread.

      Parameters:
      listener - listener to register; null is ignored
    • removeFeatureRefreshListener

      default void removeFeatureRefreshListener(FeatureRefreshListener listener)
    • clearCallbacks

      @Deprecated void clearCallbacks()
      Deprecated.
      Use listener-specific unsubscription with removeFeatureRefreshListener(FeatureRefreshListener) where available.
      Clears legacy feature refresh callbacks.
    • getLastRefreshError

      @Nullable default Throwable getLastRefreshError()
      Returns the most recent feature refresh error, if any. Used for diagnostics only.
      Returns:
      the last refresh Throwable, or null when no refresh has failed
    • getLastRefreshErrorAtMillis

      default long getLastRefreshErrorAtMillis()
      Returns the epoch-millis timestamp of the most recent feature refresh error. Used for diagnostics only.
      Returns:
      the timestamp in milliseconds, or 0 when no refresh has failed
    • getRefreshSuccessCount

      default long getRefreshSuccessCount()
    • getRefreshFailureCount

      default long getRefreshFailureCount()
    • getRefreshConsecutiveFailureCount

      default long getRefreshConsecutiveFailureCount()
    • getLastRefreshFailureAtMillis

      default long getLastRefreshFailureAtMillis()
    • getLastRefreshLoadedFromCache

      @Nullable default Boolean getLastRefreshLoadedFromCache()