public class VehicleData extends Object
You should not need to create an instance of this class manually.
Use the WVA class to manage all interactions with the WVA.
| Modifier and Type | Field and Description |
|---|---|
static String |
SUB_SUFFIX
Suffix used to create the default short names for subscriptions.
|
| Constructor and Description |
|---|
VehicleData(HttpClient client) |
public static final String SUB_SUFFIX
"EngineSpeed" becomes "EngineSpeed~sub".public VehicleData(HttpClient client)
public void fetchVehicleDataEndpoints(WvaCallback<Set<String>> onInitialized)
WVA.fetchVehicleDataEndpoints(WvaCallback).public Set<String> getCachedVehicleDataEndpoints()
WVA.getCachedVehicleDataEndpoints()public void notifyListeners(VehicleDataEvent e)
listener associated
with e's endpoint name (if there are any), and then
the "catch-all" listener (if any).e - the event to be used to trigger the aforementioned listenerspublic void removeAllListeners()
WVA.removeAllVehicleDataListeners()public void updateCachedVehicleData(VehicleDataEvent e)
notifyListeners(VehicleDataEvent) with e.
It is convenient for testing when no WVA and/or TCP connection is
available.e - a VehicleDataEvent objectpublic void updateCachedVehicleData(String uri, VehicleDataResponse response)
notifyListeners(VehicleDataEvent) with a new Event constructed
from uri and response.
It is convenient for testing when no WVA and/or TCP connection is
available.uri - the web service URI whose data is being updatedresponse - the data from the WVApublic void setVehicleDataListener(VehicleDataListener listener)
WVA.setVehicleDataListener(VehicleDataListener)public void removeVehicleDataListener()
WVA.removeVehicleDataListener()public void setVehicleDataListener(String endpoint, VehicleDataListener listener)
WVA.setVehicleDataListener(String, VehicleDataListener)public void removeVehicleDataListener(String endpoint)
WVA.removeVehicleDataListener(String)public VehicleDataResponse getCachedVehicleData(String endpoint)
WVA.getCachedVehicleData(String)public void fetchVehicleData(String endpoint, WvaCallback<VehicleDataResponse> cb)
WVA.fetchVehicleData(String, WvaCallback)public void subscribe(String endpoint, int seconds, WvaCallback<Void> cb) throws JSONException
WVA.subscribeToVehicleData(String, int, WvaCallback)JSONExceptionpublic void unsubscribe(String endpoint, WvaCallback<Void> cb)
WVA.unsubscribeFromVehicleData(String, WvaCallback)public void createAlarm(String endpoint, AlarmType type, double threshold, int seconds, WvaCallback<Void> cb) throws JSONException
WVA.createVehicleDataAlarm(String, AlarmType, float, int, WvaCallback)JSONExceptionpublic void deleteAlarm(String endpoint, AlarmType type, WvaCallback<Void> cb)
WVA.deleteVehicleDataAlarm(String, AlarmType, WvaCallback)