FleetEngine.AuthTokenFactory

public static interface FleetEngine.AuthTokenFactory

Instances of this interface will be asked to provide an authorization token when various operations are performed.

Public Method Summary

abstract String
getTerminalPointServiceToken()
Not yet used, implementations may return null.
abstract String
getTripServiceToken()
Not yet used, implementations may return null.
abstract String
getVehicleServiceToken()
This method will be called by the Fleet Engine when a location update is about to be sent to the Fleet Engine backend.

Public Methods

public abstract String getTerminalPointServiceToken ()

Not yet used, implementations may return null.

public abstract String getTripServiceToken ()

Not yet used, implementations may return null.

public abstract String getVehicleServiceToken ()

This method will be called by the Fleet Engine when a location update is about to be sent to the Fleet Engine backend.

The implementation should try to respond as quickly as possible; blocking calls will cause location update delays. Ideally, an implementation will utilize a background thread and caching to ensure that a valid token is available on-demand.

Any exception thrown by this method will be raised to the FleetEngine.ErrorListener provided to the Fleet Engine. The exception will be a LocationUpdateException with the ErrorType field set to AUTH_FACTORY_EXCEPTION. The Fleet Engine will try again a few times before giving up for good.

If the value returned is null, the Fleet Engine will not attach any authorization token when communicating with the Fleet Engine. This may result in authorization errors and lost updates.