Package growthbook.sdk.java.repository
Class LocalGbFeatureRepository
java.lang.Object
growthbook.sdk.java.repository.LocalGbFeatureRepository
- All Implemented Interfaces:
IGBFeaturesRepository
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters a listener notified after every refresh attempt.voidDeprecated.Method for getting the featuresJson in format of String from user json filevoidMethod for initializingLocalGbFeatureRepositoryby fetching features from user's json filevoidinitialize(Boolean retryOnFailure) Can be ignored for this implementationvoidonFeaturesRefresh(FeatureRefreshCallback callback) Deprecated.voidMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface growthbook.sdk.java.repository.IGBFeaturesRepository
getLastRefreshError, getLastRefreshErrorAtMillis, getLastRefreshFailureAtMillis, getLastRefreshLoadedFromCache, getRefreshConsecutiveFailureCount, getRefreshFailureCount, getRefreshSuccessCount
-
Constructor Details
-
LocalGbFeatureRepository
-
-
Method Details
-
initialize
Method for initializingLocalGbFeatureRepositoryby fetching features from user's json file- Specified by:
initializein interfaceIGBFeaturesRepository- Throws:
FeatureFetchException- exception when FileNotFoundException occur
-
initialize
Can be ignored for this implementation- Specified by:
initializein interfaceIGBFeaturesRepository
-
getFeaturesJson
Method for getting the featuresJson in format of String from user json file- Specified by:
getFeaturesJsonin interfaceIGBFeaturesRepository- Returns:
- featuresJson
-
getParsedFeatures
-
onFeaturesRefresh
Deprecated.Can be ignored for this implementation- Specified by:
onFeaturesRefreshin interfaceIGBFeaturesRepository- Parameters:
callback- callback to register
-
addFeatureRefreshListener
Description copied from interface:IGBFeaturesRepositoryRegisters 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.- Specified by:
addFeatureRefreshListenerin interfaceIGBFeaturesRepository- Parameters:
listener- listener to register;nullis ignored
-
removeFeatureRefreshListener
- Specified by:
removeFeatureRefreshListenerin interfaceIGBFeaturesRepository
-
clearCallbacks
Deprecated.Use listener-specific unsubscription withremoveFeatureRefreshListener(FeatureRefreshListener)where available.Can be ignored for this implementation- Specified by:
clearCallbacksin interfaceIGBFeaturesRepository
-
removeFeatureRefreshListener(FeatureRefreshListener)where available.