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 DefaultAnalyticsHandlergetInstance(android.content.Context context)Provides reference to the single instance ofDefaultAnalyticsHandler.IAnalyticsHandler.ProcessListenergetProcessListener()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.voidonAttached()This 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.voidonRemoved()This method will be invoked when the handler is removed from a network client.DefaultAnalyticsHandlersetProcessListener(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: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.
-
-