-
- All Implemented Interfaces:
-
com.datadog.android.api.SdkCore
public interface FeatureSdkCore implements SdkCore
Extension of SdkCore containing the necessary methods for the features development.
SDK core is always guaranteed to implement this interface.
-
-
Method Summary
Modifier and Type Method Description abstract UnitregisterFeature(Feature feature)Registers a feature to this instance of the Datadog SDK. abstract FeatureScopegetFeature(String featureName)Retrieves a registered feature. abstract UnitupdateFeatureContext(String featureName, Boolean useContextThread, Function1<Map<String, Object>, Unit> updateCallback)Updates the context if exists with the new entries. abstract Map<String, Object>getFeatureContext(String featureName, Boolean useContextThread)Retrieves the context for the particular feature. abstract UnitsetEventReceiver(String featureName, FeatureEventReceiver receiver)Sets event receiver for the given feature. abstract UnitremoveEventReceiver(String featureName)Removes events receive for the given feature. abstract UnitsetContextUpdateReceiver(FeatureContextUpdateReceiver listener)Sets feature context update listener. abstract UnitremoveContextUpdateReceiver(FeatureContextUpdateReceiver listener)Removes feature context update listener. abstract ExecutorServicecreateSingleThreadExecutorService(String executorContext)Returns a new single thread ExecutorService, set up with backpressure and internal monitoring. abstract ScheduledExecutorServicecreateScheduledExecutorService(String executorContext)Returns a new ScheduledExecutorService, set up with internal monitoring. abstract UnitsetAnonymousId(UUID anonymousId)Allows the given feature to set the anonymous ID for the SDK. abstract InternalLoggergetInternalLogger()Logger for the internal SDK purposes. abstract StringgetName()Name of the current SDK instance. abstract TimeInfogetTime()The current time (both device and server). abstract StringgetService()Name of the service (given during the SDK initialization, otherwise package name is used). -
Methods inherited from class com.datadog.android.api.feature.FeatureSdkCore
addAccountExtraInfo, addUserProperties, clearAccountInfo, clearAllData, clearUserInfo, isCoreActive, setAccountInfo, setTrackingConsent, setUserInfo -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
registerFeature
abstract Unit registerFeature(Feature feature)
Registers a feature to this instance of the Datadog SDK.
- Parameters:
feature- the feature to be registered.
-
getFeature
abstract FeatureScope getFeature(String featureName)
Retrieves a registered feature.
- Parameters:
featureName- the name of the feature to retrieve
-
updateFeatureContext
abstract Unit updateFeatureContext(String featureName, Boolean useContextThread, Function1<Map<String, Object>, Unit> updateCallback)
Updates the context if exists with the new entries. If there is no context yet for the provided featureName, a new one will be created.
- Parameters:
featureName- Feature name.useContextThread- Whenever update of the context should happen on the context processing thread or not.updateCallback- Provides current feature context for the update.
-
getFeatureContext
abstract Map<String, Object> getFeatureContext(String featureName, Boolean useContextThread)
Retrieves the context for the particular feature.
- Parameters:
featureName- Feature name.useContextThread- Whenever context read should happen on the context processing thread or not.
-
setEventReceiver
abstract Unit setEventReceiver(String featureName, FeatureEventReceiver receiver)
Sets event receiver for the given feature.
- Parameters:
featureName- Feature name.receiver- Event receiver.
-
removeEventReceiver
abstract Unit removeEventReceiver(String featureName)
Removes events receive for the given feature.
- Parameters:
featureName- Feature name.
-
setContextUpdateReceiver
abstract Unit setContextUpdateReceiver(FeatureContextUpdateReceiver listener)
Sets feature context update listener. Once subscribed, current context will be emitted immdediately if it exists.
- Parameters:
listener- Listener to remove.
-
removeContextUpdateReceiver
abstract Unit removeContextUpdateReceiver(FeatureContextUpdateReceiver listener)
Removes feature context update listener.
- Parameters:
listener- Listener to remove.
-
createSingleThreadExecutorService
abstract ExecutorService createSingleThreadExecutorService(String executorContext)
Returns a new single thread ExecutorService, set up with backpressure and internal monitoring.
- Parameters:
executorContext- Context to be used for logging and naming threads running on this executor.
-
createScheduledExecutorService
abstract ScheduledExecutorService createScheduledExecutorService(String executorContext)
Returns a new ScheduledExecutorService, set up with internal monitoring. It will use a default of one thread and can spawn at most as many thread as there are CPU cores.
- Parameters:
executorContext- Context to be used for logging and naming threads running on this executor.
-
setAnonymousId
abstract Unit setAnonymousId(UUID anonymousId)
Allows the given feature to set the anonymous ID for the SDK.
- Parameters:
anonymousId- Anonymous ID to set.
-
getInternalLogger
abstract InternalLogger getInternalLogger()
Logger for the internal SDK purposes.
-
getService
abstract String getService()
Name of the service (given during the SDK initialization, otherwise package name is used).
-
-
-
-