Class OtvAnalyticsAgent
It handles event (activity) information provided by the application, validates the data, and converts this information to messages to pre-configured back-end endpoints - UAV and / or DWH.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
An interface for listeners to handle reports and errors -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addReportListener
(OtvAnalyticsAgent.OtvAaReportListener xReportListener) Add a listener to the list of report listeners handling errors and reportsappStart
(JSONObject xMetadata) Submit the appStart Activityvoid
close()
Close the analytics session.initialise
(JSONObject xAgentConfig, OtvAnalyticsAgent.OtvAaReportListener xReportListener) Initialise the OpenTv Analytics Agentboolean
Check if the agent is initialised The agent is considered initialised if the desitnation endpoints have been configured correctlu.void
onActivityReport
(String xActivityName, String xUrl, String xMetadata, int xHttpResponse, String xResponse) hiddenvoid
Remove all listeners handling errors and reportsvoid
removeReportListener
(OtvAnalyticsAgent.OtvAaReportListener xReportListener) Remove a specific listener from the list of report listeners handling errors and reportssubmitActivity
(OtvActivity xActivity, JSONObject xMetadata) Submit an activity appStart activity should not be submitted using this methodupdateConfig
(JSONObject xAgentConfig) Provide an updated configuration The configuration object should only contain the updated attributes.
-
Field Details
-
JSON_KEY_ACCOUNT_ID
- See Also:
-
JSON_KEY_ACTIVITY_DATE_TIME
- See Also:
-
JSON_KEY_AD_ID
- See Also:
-
JSON_KEY_AD_SUPPLIER
- See Also:
-
JSON_KEY_APP_NAME
- See Also:
-
JSON_KEY_APP_VERSION
- See Also:
-
JSON_KEY_APP_SESSION_ID
- See Also:
-
JSON_KEY_APP_REFERENCE
- See Also:
-
JSON_KEY_AVAILABLE_BITRATE
- See Also:
-
JSON_KEY_AVG_DOWNLOAD_BITRATE
- See Also:
-
JSON_KEY_BITRATE_SELECTED
- See Also:
-
JSON_KEY_BUFFER_DURATION
- See Also:
-
JSON_KEY_BYTES_DOWNLOADED
- See Also:
-
JSON_KEY_CONFIG
- See Also:
-
JSON_KEY_CONSENT_FOR_TARGETTED_AD
- See Also:
-
JSON_KEY_CONTENT_SOURCE
- See Also:
-
JSON_KEY_CONTENT_TYPE
- See Also:
-
JSON_KEY_CONTENT_URI
- See Also:
-
JSON_KEY_DEEP_LINK_ID
- See Also:
-
JSON_KEY_DEEP_LINK_PROVIDER_ID
- See Also:
-
JSON_KEY_DEPTH
- See Also:
-
JSON_KEY_DESTINATIONS
- See Also:
-
JSON_KEY_DEVICE_ID
- See Also:
-
JSON_KEY_DEVICE_TYPE
- See Also:
-
JSON_KEY_DROPPED_FRAMES
- See Also:
-
JSON_KEY_EDITORIAL_ID
- See Also:
-
JSON_KEY_ERROR_CODE
- See Also:
-
JSON_KEY_ERROR_MSG
- See Also:
-
JSON_KEY_HDEPTH
- See Also:
-
JSON_KEY_KEY
- See Also:
-
JSON_KEY_METADATA
- See Also:
-
JSON_KEY_NAME
- See Also:
-
JSON_KEY_PLAYBACK_PROGRESS
- See Also:
-
JSON_KEY_PLAYBACK_SESSION_ID
- See Also:
-
JSON_KEY_PLAYER_TYPE_VERSION
- See Also:
-
JSON_KEY_POLICY_CONSENT_GIVEN
- See Also:
-
JSON_KEY_POLICY_SHOWN
- See Also:
-
JSON_KEY_POSITION
- See Also:
-
JSON_KEY_POLICY_TYPE
- See Also:
-
JSON_KEY_PROGRAMME_ID
- See Also:
-
JSON_KEY_PROVIDER_RESOURCE_ID
- See Also:
-
JSON_KEY_RAIL_ID
- See Also:
-
JSON_KEY_SECTION_ID
- See Also:
-
JSON_KEY_SERIES_LINK
- See Also:
-
JSON_KEY_SERIES_ID
- See Also:
-
JSON_KEY_START_POSITION
- See Also:
-
JSON_KEY_SOURCE
- See Also:
-
JSON_KEY_STOP_POSITION
- See Also:
-
JSON_KEY_STREAM_BITRATE
- See Also:
-
JSON_KEY_TECHNICAL_ID
- See Also:
-
JSON_KEY_TEMPLATE_ID
- See Also:
-
JSON_KEY_TIMESTAMP
- See Also:
-
JSON_KEY_TOKEN
- See Also:
-
JSON_KEY_TOTAL_FRAMES
- See Also:
-
JSON_KEY_TRACKING_ASSET_ID
- See Also:
-
JSON_KEY_UAV
- See Also:
-
JSON_KEY_URL
- See Also:
-
JSON_KEY_USER_ID
- See Also:
-
JSON_KEY_VDEPTH
- See Also:
-
-
Constructor Details
-
OtvAnalyticsAgent
constructor for OtvAnalyticsAgent.- Parameters:
xContext
- the context of application
-
-
Method Details
-
initialise
public OtvAaError initialise(@NonNull JSONObject xAgentConfig, @NonNull OtvAnalyticsAgent.OtvAaReportListener xReportListener) Initialise the OpenTv Analytics AgentCall this method once, before calling any other
Do not call again unless close is called first
Typical configuration
{ "destinations" : [ { "name" : "uav", // Only 'uav' and 'dwh' are valid names "config" : { "url" : "https://path.to.uav/apis", "token" : "tokenINBase64JWT==" } }, { "name" : "dwh", "url" : "https://path.to.dwh/apis" } ] "appVersion" : "1.0.0" }
- Parameters:
xAgentConfig
- configuration data defining destination endpoints and a possible UAV token and optional appVersionxReportListener
- Reference for listener to handle reports and errors- Returns:
OtvAaError.OK
if successful, another error enumeration otherwise
-
close
public void close()Close the analytics session. After calling this method, do not call any other unlessinitialis()
is called again -
updateConfig
Provide an updated configuration The configuration object should only contain the updated attributes. Not all attributes may be updated - only token, userId and accountId attributes refresh are accepted. Other attributes are ignored.- Parameters:
xAgentConfig
- configuration- Returns:
OtvAaError.OK
if successful, another error enumeration otherwise
-
appStart
Submit the appStart ActivityMust be the first activity submitted (must be called before any other calls to
submitActivity(com.nagra.otvaa.sdk.OtvActivity, org.json.JSONObject)
)Should not be called again without first submitting an appEnd activity
Typical appStart metadata:
"appSessionId" : "<UUID>", "activityDateTime": "2020-03-20T10:53:19Z"
- Parameters:
xMetadata
- Containing key-value pairs of metadata for the appStart activity- Returns:
OtvAaError.OK
if successful, another error enumeration otherwise
-
submitActivity
Submit an activity appStart activity should not be submitted using this method- Parameters:
xActivity
- The activity being submittedxMetadata
- Containing key-value pairs of metadata for the submitted activity- Returns:
OtvAaError.OK
if successful, another error enumeration otherwise
-
isInitialised
public boolean isInitialised()Check if the agent is initialised The agent is considered initialised if the desitnation endpoints have been configured correctlu.- Returns:
- true if initialised, false otherwise
-
addReportListener
Add a listener to the list of report listeners handling errors and reports- Parameters:
xReportListener
- an instance / implementation ofOtvAnalyticsAgent.OtvAaReportListener
-
removeReportListener
Remove a specific listener from the list of report listeners handling errors and reports- Parameters:
xReportListener
- the listener instance to remove from list
-
removeAllReportListeners
public void removeAllReportListeners()Remove all listeners handling errors and reports -
onActivityReport
public void onActivityReport(@NonNull String xActivityName, @NonNull String xUrl, @NonNull String xMetadata, int xHttpResponse, @NonNull String xResponse) hidden
-