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
TrackingEvent
s.-
Method Summary
Modifier and TypeMethodDescriptionstatic TrackerDatasource
create
(HttpService httpService) Instantiates a RemoteTrackerDatasource.void
track
(List<TrackingEvent> trackingEvents, SSAICallback<List<TrackingEvent>> ssaiCallback) Tries to contact the URI of eachTrackingEvent
and 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 eachTrackingEvent
and 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:
track
in interfaceTrackerDatasource
- Parameters:
trackingEvents
- the list of tracking events to be tracked.ssaiCallback
- a callback to receive status of the tracking events.
-