com.partnersoft.gps.postprocessing
Class GpsCorrectionDatabase

java.lang.Object
  extended by com.partnersoft.gps.postprocessing.GpsCorrectionDatabase

public class GpsCorrectionDatabase
extends java.lang.Object

Database storing GPS correction data.

Copyright 2009 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
GpsCorrectionDatabase()
          Creates a GpsCorrectionDatabase pointing at the MySQL database "partner" server on PartnerHub.
GpsCorrectionDatabase(SqlDatabase database)
          Creates a GpsCorrectionDatabase pointing at the given database.
GpsCorrectionDatabase(java.lang.String serverAddress)
          Creates a GpsCorrectionDatabase pointing at the MySQL database "partner" server on the given server.
 
Method Summary
 void close()
           
 void connect()
           
 GpsCorrectionFile correctionFileNamed(java.lang.String name)
          Returns the correction file for the given name, or null if there is none.
 GpsCorrection correctionForGuid(java.lang.String guid)
          Returns the correction for the given GUID, or null if there is none.
 void createTables()
           
 void dropTables()
           
 void storeCorrection(GpsCorrection correction)
          Stores the given correction so that it can be looked up later by guid.
 void storeCorrection(java.lang.String guid, java.lang.String fileName, double longitude, double latitude)
          Stores the given correction so that it can be looked up later by guid.
 void storeCorrectionFile(GpsCorrectionFile file)
          Stores the given correction file so that it can be looked up later by name.
 void storeCorrectionFile(java.lang.String name, java.lang.String path, long checksum, DateAndTime lastModified)
          Stores the given correction file so that it can be looked up later by name.
 boolean tablesExist()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GpsCorrectionDatabase

public GpsCorrectionDatabase()
Creates a GpsCorrectionDatabase pointing at the MySQL database "partner" server on PartnerHub.


GpsCorrectionDatabase

public GpsCorrectionDatabase(java.lang.String serverAddress)
Creates a GpsCorrectionDatabase pointing at the MySQL database "partner" server on the given server.


GpsCorrectionDatabase

public GpsCorrectionDatabase(SqlDatabase database)
Creates a GpsCorrectionDatabase pointing at the given database.

Method Detail

connect

public void connect()
             throws java.sql.SQLException
Throws:
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
Throws:
java.sql.SQLException

dropTables

public void dropTables()
                throws java.sql.SQLException
Throws:
java.sql.SQLException

tablesExist

public boolean tablesExist()
                    throws java.sql.SQLException
Throws:
java.sql.SQLException

createTables

public void createTables()
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

correctionForGuid

public GpsCorrection correctionForGuid(java.lang.String guid)
                                throws java.sql.SQLException
Returns the correction for the given GUID, or null if there is none.

Parameters:
guid -
Returns:
Throws:
java.sql.SQLException

storeCorrection

public void storeCorrection(GpsCorrection correction)
                     throws java.sql.SQLException
Stores the given correction so that it can be looked up later by guid.

Parameters:
correction -
Throws:
java.sql.SQLException

storeCorrection

public void storeCorrection(java.lang.String guid,
                            java.lang.String fileName,
                            double longitude,
                            double latitude)
                     throws java.sql.SQLException
Stores the given correction so that it can be looked up later by guid.

Throws:
java.sql.SQLException

correctionFileNamed

public GpsCorrectionFile correctionFileNamed(java.lang.String name)
                                      throws java.sql.SQLException
Returns the correction file for the given name, or null if there is none.

Throws:
java.sql.SQLException

storeCorrectionFile

public void storeCorrectionFile(GpsCorrectionFile file)
                         throws java.sql.SQLException
Stores the given correction file so that it can be looked up later by name.

Throws:
java.sql.SQLException

storeCorrectionFile

public void storeCorrectionFile(java.lang.String name,
                                java.lang.String path,
                                long checksum,
                                DateAndTime lastModified)
                         throws java.sql.SQLException
Stores the given correction file so that it can be looked up later by name.

Throws:
java.sql.SQLException