Package com.brightcove.ssai.tracking
Class RemoteTrackerDatasource
- java.lang.Object
-
- com.brightcove.ssai.tracking.RemoteTrackerDatasource
-
- All Implemented Interfaces:
TrackerDatasource
public class RemoteTrackerDatasource extends java.lang.Object implements TrackerDatasource
Implementation of aTrackerDatasource
that makes the network calls to track the specifiedTrackingEvent
s.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TrackerDatasource
create(HttpService httpService)
Instantiates a RemoteTrackerDatasource.void
track(java.util.List<TrackingEvent> trackingEvents, SSAICallback<java.util.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 Detail
-
create
public static TrackerDatasource create(@NonNull HttpService httpService)
Instantiates a RemoteTrackerDatasource.- Parameters:
httpService
- a NonNull instance ofHttpService
.- Returns:
- the new instance of the RemoteTrackerDatasource.
-
track
public void track(@NonNull java.util.List<TrackingEvent> trackingEvents, @NonNull SSAICallback<java.util.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.
-
-