com.tractrac.clientmodule.data
Class DataController

java.lang.Object
  extended by com.tractrac.clientmodule.data.DataController
All Implemented Interfaces:
java.lang.Runnable

public class DataController
extends java.lang.Object
implements java.lang.Runnable

The main class for data subscription/retrieval.

Version:
2.0
Author:
jmr

Nested Class Summary
static interface DataController.Listener
           
static interface DataController.TimeListener
           
 
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.
 void getUtcTime(DataController.TimeListener timeListener)
           
 boolean hasLiveData()
           
 boolean hasStoredData()
           
 void remove(com.maptrack.client.io.TypeController typeController)
          Cancels a subscription from the TTCM.
 void run()
           
 void stop(boolean abortStored)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataController

public DataController(java.net.URI liveUri,
                      java.net.URI storedUri,
                      DataController.Listener listener)
               throws java.io.FileNotFoundException,
                      java.net.MalformedURLException
Creates a data controller to be used when subscribing data. Supported live data URI's: Supported stored data URI's:

Parameters:
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 -
Throws:
java.io.FileNotFoundException
java.net.MalformedURLException
Method Detail

hasLiveData

public boolean hasLiveData()

hasStoredData

public boolean hasStoredData()

add

public void add(com.maptrack.client.io.TypeController typeController)
Adds a subscription to the TTCM. May be called before or after executing the run method.

Parameters:
typeController -

remove

public void remove(com.maptrack.client.io.TypeController typeController)
Cancels a subscription from the TTCM. May be called before or after executing the run method.

Parameters:
typeController -

run

public void run()
Specified by:
run in interface java.lang.Runnable

getUtcTime

public void getUtcTime(DataController.TimeListener timeListener)

stop

public void stop(boolean abortStored)