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 DefaultAnalyticsHandler
getInstance
(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.void
onAnalyticsEvent
(com.brightcove.player.analytics.AnalyticsEvent event, IAnalyticsErrorListener errorHandler) This method will be called by theAnalyticsClient
, when an analytics event is received from the application.void
This method will be invoked when the handler is added to a network client.void
onNetworkEntitlementChanged
(int type, boolean enabled) This method will be called when the entitlement for specific network has been changed.void
This 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:IHandler
This method will be invoked when the handler is added to a network client.- Specified by:
onAttached
in interfaceIHandler
-
onRemoved
public void onRemoved()Description copied from interface:IHandler
This 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:IAnalyticsHandler
This method will be called by theAnalyticsClient
, when an analytics event is received from the application.- Specified by:
onAnalyticsEvent
in 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:IAnalyticsHandler
This method will be called when the entitlement for specific network has been changed.- Specified by:
onNetworkEntitlementChanged
in interfaceIAnalyticsHandler
- Parameters:
type
- the network typeenabled
- true if the network is entitled for analytics transmission, otherwise false.
-