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 a `TrackerDatasource` that makes the network calls to track the specified `TrackingEvent`s.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 each `TrackingEvent` and then notifies successful results in `SSAICallback.onSuccess(Object)`, in case there were errors `SSAICallback.onError(Throwable)` is called.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### create

          public static TrackerDatasource create(@NonNull
                                                 HttpService httpService)

      Instantiates a RemoteTrackerDatasource.
      Parameters:
        `httpService` - a NonNull instance of `HttpService`.
      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 each `TrackingEvent` and then notifies successful results in `SSAICallback.onSuccess(Object)`, in case there were errors `SSAICallback.onError(Throwable)` is called. Notice that both `SSAICallback.onSuccess(Object)` and `SSAICallback.onError(Throwable)` can be called in the same track(List, SSAICallback) call.
      Specified by:
        `track` in interface `TrackerDatasource`
      Parameters:
        `trackingEvents` - the list of tracking events to be tracked.
        `ssaiCallback` - a callback to receive status of the tracking events.