cat.hist
Class ClientApplication

java.lang.Object
  extended bycat.hist.ClientApplication

public class ClientApplication
extends java.lang.Object

This class puts CAT sensor data into a standard SQL form and sends it to local server that stores it into a local database.


Constructor Summary
ClientApplication()
           
 
Method Summary
 void communicateByObject()
          Used internally for communicating with the database server.
 void communicateByStream()
          Used internally for communicating with the database server.
 void insert(java.lang.String id, java.lang.String type, java.lang.String endtime, java.lang.String value)
          This method is used only by HistoryManager to insert sensor data into the database.
static void main(java.lang.String[] argv)
          This is just for testing that it can connect to the database server.
 java.util.Vector[] query(java.lang.String id, java.lang.String type)
          Use this method to retrieve the sensor data for the given sensor for all times.
 java.lang.String query(java.lang.String id, java.lang.String type, java.lang.String endtime)
          Use this method to retrieve the sensor data for the given sensor that is closest to the given time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientApplication

public ClientApplication()
Method Detail

main

public static void main(java.lang.String[] argv)
This is just for testing that it can connect to the database server.


query

public java.lang.String query(java.lang.String id,
                              java.lang.String type,
                              java.lang.String endtime)
                       throws java.io.IOException
Use this method to retrieve the sensor data for the given sensor that is closest to the given time.

Parameters:
id - The sensor id of the desired data.
type - The type of the sensor data.
endtime - The nearest time of the data.
Returns:
String The sensor data object or null if doesn't exist.
Throws:
java.io.IOException

query

public java.util.Vector[] query(java.lang.String id,
                                java.lang.String type)
                         throws java.io.IOException
Use this method to retrieve the sensor data for the given sensor for all times.

Parameters:
id - The sensor id of the desired data.
type - The type of the sensor data.
Returns:
Vector[] The array contain two vectors of the desired sensor data (values and times).
Throws:
java.io.IOException

insert

public void insert(java.lang.String id,
                   java.lang.String type,
                   java.lang.String endtime,
                   java.lang.String value)
            throws java.io.IOException
This method is used only by HistoryManager to insert sensor data into the database.

Parameters:
id - The sensor id of the data.
type - The type of the sensor data.
endtime - The nearest time of the data.
value - The sensor data value.
Throws:
java.io.IOException

communicateByStream

public void communicateByStream()
                         throws java.io.IOException
Used internally for communicating with the database server.

Throws:
java.io.IOException

communicateByObject

public void communicateByObject()
                         throws java.io.IOException
Used internally for communicating with the database server.

Throws:
java.io.IOException