public class AnalyticsClient
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_BACKLOG_LIMIT
The default limit for analytics events backlog, expressed as total number of bytes.
|
static int |
DEFAULT_BATCH_SIZE
The maximum number of events that will be processed in a batch when transmitting backlog.
|
static int |
DEFAULT_RETRY_LIMIT
The maximum number of attempts that will be made to send
AbstractAnalyticsEvent.NORMAL events. |
Modifier and Type | Method and Description |
---|---|
AnalyticsClient |
addHandler(IAnalyticsHandler handler)
Adds the specified handler to the set of handlers that will be notified when an analytics
event is received.
|
static void |
disableNetwork(int type)
Disables the specified network type for transmission of analytics events.
|
static void |
enableNetwork(int type)
Enables the specified network type for transmission of analytics events.
|
static long |
getBacklogLimit()
Gets the maximum size of the analytics events backlog, expressed as total number of
bytes.
|
static int |
getBatchSize()
Gets the maximum number of events that will be processed in a batch when transmitting backlog.
|
static AnalyticsClient |
getInstance(android.content.Context context)
Provides reference to the single instance of
AnalyticsClient . |
static android.util.SparseArray<java.lang.Boolean> |
getNetworkEntitlements()
Gets the network entitlements for transmission of analytics events.
|
static int |
getRetryLimit()
Gets the maximum number of attempts that will be made to send
AbstractAnalyticsEvent.NORMAL
events. |
static boolean |
isNetworkEnabled(int type)
Checks if the specified network type is currently enabled for transmission of analytics events.
|
AnalyticsClient |
publish(com.brightcove.player.analytics.AnalyticsEvent event,
IAnalyticsErrorListener errorHandler)
Publishes the specified event to the current set of registered analytics handlers.
|
AnalyticsClient |
removeAllHandlers()
Removes all handlers that are currently registered with client.
|
AnalyticsClient |
removeHandler(IAnalyticsHandler handler)
Removed the specified handler to the set of handlers that will be notified when an analytics
event is received.
|
static void |
setBacklogLimit(long backlogLimit)
Sets the maximum size of the analytics events backlog, expressed as total number of
bytes.
|
static void |
setBatchSize(int batchSize)
Sets the maximum number of events that will be processed in a batch when transmitting backlog.
|
static boolean |
setNetworkEnabled(int type,
boolean enabled)
Sets whether the specified network type is enabled for transmission of analytics events.
|
static void |
setRetryLimit(int retryLimit)
Sets the maximum number of attempts that will be made to send
AbstractAnalyticsEvent.NORMAL
events. |
public static long DEFAULT_BACKLOG_LIMIT
public static int DEFAULT_RETRY_LIMIT
AbstractAnalyticsEvent.NORMAL
events.public static int DEFAULT_BATCH_SIZE
public static AnalyticsClient getInstance(@NonNull android.content.Context context)
AnalyticsClient
.context
- context of the host activity or application.AnalyticsClient
.java.lang.NullPointerException
- if the context is null.public static boolean setNetworkEnabled(int type, boolean enabled)
type
- the type of the network.enabled
- true, if the network should be enabled for analytics transmission, otherwise false.public static void enableNetwork(int type)
type
- the type of the network.public static void disableNetwork(int type)
type
- the type of the network.public static boolean isNetworkEnabled(int type)
type
- the type of the network.public static android.util.SparseArray<java.lang.Boolean> getNetworkEntitlements()
SparseArray
of ConnectivityMonitor.NetworkType
and Boolean
values that indicate
whether a specific network type can be used for transmission of analytics events.public static long getBacklogLimit()
public static void setBacklogLimit(long backlogLimit)
backlogLimit
- the maximum size of the analytics events backlog, expressed as total
number of bytes.public static int getRetryLimit()
AbstractAnalyticsEvent.NORMAL
events.AbstractAnalyticsEvent.NORMAL
events.public static void setRetryLimit(int retryLimit)
AbstractAnalyticsEvent.NORMAL
events.retryLimit
- the maximum number of attempts that will be made to send AbstractAnalyticsEvent.NORMAL
events.public static int getBatchSize()
public static void setBatchSize(int batchSize)
batchSize
- the maximum number of events that will be processed in a batch when transmitting backlog.public AnalyticsClient addHandler(@NonNull IAnalyticsHandler handler)
handler
- the handler to be added.public AnalyticsClient removeHandler(@NonNull IAnalyticsHandler handler)
handler
- the handler to be removed.public AnalyticsClient removeAllHandlers()
public AnalyticsClient publish(@NonNull com.brightcove.player.analytics.AnalyticsEvent event, @NonNull IAnalyticsErrorListener errorHandler)
event
- the event to be published.errorHandler
- optional reference to an object that can handle errors in processing
the published analytics event.