Package com.brightcove.player.analytics
Class DefaultAnalyticsHandler
- java.lang.Object
-
- com.brightcove.player.analytics.DefaultAnalyticsHandler
-
- All Implemented Interfaces:
IAnalyticsHandler
,IHandler
public class DefaultAnalyticsHandler extends java.lang.Object implements IAnalyticsHandler
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.brightcove.player.analytics.IAnalyticsHandler
IAnalyticsHandler.ProcessListener
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultAnalyticsHandler
getInstance(android.content.Context context)
Provides reference to the single instance ofDefaultAnalyticsHandler
.IAnalyticsHandler.ProcessListener
getProcessListener()
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
onAttached()
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
onRemoved()
This method will be invoked when the handler is removed from a network client.DefaultAnalyticsHandler
setProcessListener(IAnalyticsHandler.ProcessListener listener)
Sets the listener that can receive callback notifications from this instance before and after processing an event.
-
-
-
Method Detail
-
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
@Nullable public IAnalyticsHandler.ProcessListener 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
public static DefaultAnalyticsHandler getInstance(@NonNull android.content.Context context)
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:
java.lang.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.
-
-