Package com.brightcove.player.analytics
Class DefaultAnalyticsHandler
java.lang.Object
com.brightcove.player.analytics.DefaultAnalyticsHandler
- All Implemented Interfaces:
IAnalyticsHandler,IHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.brightcove.player.analytics.IAnalyticsHandler
IAnalyticsHandler.ProcessListener -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultAnalyticsHandlergetInstance(android.content.Context context) Provides reference to the single instance ofDefaultAnalyticsHandler.Sets the listener that can receive callback notifications from this instance before and after processing an event.voidonAnalyticsEvent(com.brightcove.player.analytics.AnalyticsEvent event, IAnalyticsErrorListener errorHandler) This method will be called by theAnalyticsClient, when an analytics event is received from the application.voidThis method will be invoked when the handler is added to a network client.voidonNetworkEntitlementChanged(int type, boolean enabled) This method will be called when the entitlement for specific network has been changed.voidThis method will be invoked when the handler is removed from a network client.Sets the listener that can receive callback notifications from this instance before and after processing an event.
-
Method Details
-
setProcessListener
public DefaultAnalyticsHandler setProcessListener(@Nullable IAnalyticsHandler.ProcessListener listener) Sets the listener that can receive callback notifications from this instance before and after processing an event.- Parameters:
listener- null or reference to a listener.- Returns:
- reference to this instance.
-
getProcessListener
Sets the listener that can receive callback notifications from this instance before and after processing an event.- Returns:
- null or reference to the current listener.
-
getInstance
Provides reference to the single instance ofDefaultAnalyticsHandler.- Parameters:
context- context of the host activity or application.- Returns:
- reference to the single instance of
DefaultAnalyticsHandler. - Throws:
NullPointerException- if the context is null.
-
onAttached
public void onAttached()Description copied from interface:IHandlerThis method will be invoked when the handler is added to a network client.- Specified by:
onAttachedin interfaceIHandler
-
onRemoved
public void onRemoved()Description copied from interface:IHandlerThis method will be invoked when the handler is removed from a network client. -
onAnalyticsEvent
public void onAnalyticsEvent(@NonNull com.brightcove.player.analytics.AnalyticsEvent event, @Nullable IAnalyticsErrorListener errorHandler) Description copied from interface:IAnalyticsHandlerThis method will be called by theAnalyticsClient, when an analytics event is received from the application.- Specified by:
onAnalyticsEventin interfaceIAnalyticsHandler- Parameters:
event- the analytics client.errorHandler- reference to analytics error listener, if any.
-
onNetworkEntitlementChanged
public void onNetworkEntitlementChanged(int type, boolean enabled) Description copied from interface:IAnalyticsHandlerThis method will be called when the entitlement for specific network has been changed.- Specified by:
onNetworkEntitlementChangedin interfaceIAnalyticsHandler- Parameters:
type- the network typeenabled- true if the network is entitled for analytics transmission, otherwise false.
-