Package com.brightcove.ssai.tracking
Class RemoteTrackerDatasource
java.lang.Object
com.brightcove.ssai.tracking.RemoteTrackerDatasource
- All Implemented Interfaces:
TrackerDatasource
Implementation of a
TrackerDatasource that makes the network calls to track the specified
TrackingEvents.-
Method Summary
Modifier and TypeMethodDescriptionstatic TrackerDatasourcecreate(HttpService httpService) Instantiates a RemoteTrackerDatasource.voidtrack(List<TrackingEvent> trackingEvents, SSAICallback<List<TrackingEvent>> ssaiCallback) Tries to contact the URI of eachTrackingEventand then notifies successful results inSSAICallback.onSuccess(Object), in case there were errorsSSAICallback.onError(Throwable)is called.
-
Method Details
-
create
Instantiates a RemoteTrackerDatasource.- Parameters:
httpService- a NonNull instance ofHttpService.- Returns:
- the new instance of the RemoteTrackerDatasource.
-
track
public void track(@NonNull List<TrackingEvent> trackingEvents, @NonNull SSAICallback<List<TrackingEvent>> ssaiCallback) Tries to contact the URI of eachTrackingEventand then notifies successful results inSSAICallback.onSuccess(Object), in case there were errorsSSAICallback.onError(Throwable)is called. Notice that bothSSAICallback.onSuccess(Object)andSSAICallback.onError(Throwable)can be called in the same track(List, SSAICallback) call.- Specified by:
trackin interfaceTrackerDatasource- Parameters:
trackingEvents- the list of tracking events to be tracked.ssaiCallback- a callback to receive status of the tracking events.
-