|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tractrac.clientmodule.data.DataController
public class DataController
The main class for data subscription/retrieval.
| Nested Class Summary | |
|---|---|
static interface |
DataController.Listener
Provides information on the status of live and stored data. |
static interface |
DataController.TimeListener
A callback that will be called when the UTC time of the live data server is received. |
| Constructor Summary | |
|---|---|
DataController(java.net.URI liveUri,
java.net.URI storedUri,
DataController.Listener listener)
Creates a data controller to be used when subscribing data. |
|
| Method Summary | |
|---|---|
void |
add(com.maptrack.client.io.TypeController typeController)
Adds a subscription to the TTCM May be called before or after executing the run method. |
void |
getUtcTime(DataController.TimeListener timeListener)
Requests the UTC time of the data server. |
boolean |
hasLiveData()
Returns whether this controller is set up to receive live data |
boolean |
hasStoredData()
Returns whether this controller is set up to receive stored data |
void |
remove(com.maptrack.client.io.TypeController typeController)
Cancels a subscription from the TTCM. |
void |
run()
|
void |
stop(boolean abortStored)
Stop receiving live and stored data |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataController(java.net.URI liveUri,
java.net.URI storedUri,
DataController.Listener listener)
throws java.io.FileNotFoundException,
java.net.MalformedURLException
tcp://example.com:1234tcp://example.com:1234http://example.com/stored.mtbfile:/c:/tests/stored.mtb
liveUri - the URI for live data. null is allowed, in which case
no live data will be received.storedUri - the URI for stored data. null is allowed, in which case
no stored data will be received.listener -
java.io.FileNotFoundException
java.net.MalformedURLException| Method Detail |
|---|
public boolean hasLiveData()
public boolean hasStoredData()
public void add(com.maptrack.client.io.TypeController typeController)
May be called before or after executing the run method.
typeController - public void remove(com.maptrack.client.io.TypeController typeController)
run method.
typeController - public void run()
run in interface java.lang.Runnablepublic void getUtcTime(DataController.TimeListener timeListener)
The answer will arrive asynchronously through the provided callback.
Note that the answer will only arrive once the connection to the live server has been
established (e.g., after the DataControllerAsio.Listener.liveDataConnected() call)
timeListenerInQueue - public void stop(boolean abortStored)
abortStored - true if processes currently fetching stored data should be
stopped; otherwise, these processes will be allowed to finish
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||