jpl.mipl.uplink.tour
Class VimsDb

java.lang.Object
  extended byjpl.mipl.uplink.tour.VimsDb

public class VimsDb
extends Object

The VimsDb class contains methods used to interact with the MIPL catalog/database. In particular, it enables VIMS objects to be written to the cassini database.

Author:
Justin Maki, Elias Sayfi, Tina Pavlicek, Vance Haemmerle Change History: 03-03-03 Michael Cayanan Added a method called get_db_connection_info which grabs parameters needed to connect to a MIPL database and stores it in the miplDb jqi object of the VimsDb class. This was created when a situation arised where an application was attempting to initialize multiple database classes.
See Also:
VimsParameterSet, VimsInterfaceFile, VimsIoiHeader

Constructor Summary
VimsDb()
           
 
Method Summary
 void addVimsParamHeaderTour(VimsIoiHeader header)
          Adds an VimsIoiHeader object to the database.
 void addVimsParamTour(VimsParameterSet param_set, VimsIoiHeader header)
          Add an VimsParameterSet object to the database.
 void addVimsPredTour(VimsPredict predict)
          This method adds an Vims Predict to the catalog.
 void clearDbErrors()
          Clears the dbError variables.
 void get_db_connection_info(jqi db)
          Get the database connection information from a jqi object to store into the mipDb jqi object of the VimsDb class.
 String getDatabase()
          Return the database string.
 boolean getDbError()
          Returns true if any database errors were thrown.
 int getDbErrorCount()
          Returns the number of dbErrors encountered.
 String getServerName()
          Return the serverName string.
 void getShutterPredicts(int triggerNumber)
           
 String getUserName()
          Return the UserName string.
 VimsIoiHeader getVimsParamHeaderTour(int trigger_number, String trigger_time)
          Returns a VimsIoiHeader object from the database.
 VimsParameterSetList getVimsParamTour(int trigger_number, String trigger_scet_time)
          Returns an VimsParameterTourList object from the database.
 VimsPredictList getVimsPredict(VimsTrigger trigger)
          Returns an VimsPredictList object from the database.
 void init()
          This constructor registers the JDBC driver and creates a database connection.
 void lineError(String msg)
          Print out the error message
 void nextLineError(String msg)
          Print out the error message
 void queryProps()
          The queryProps method is called if there are no user supplied arguments.
 void setProps(String[] args)
          Set the properties of the miplDb jqi object using a command line string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VimsDb

public VimsDb()
Method Detail

lineError

public void lineError(String msg)
Print out the error message


nextLineError

public void nextLineError(String msg)
Print out the error message


setProps

public void setProps(String[] args)
Set the properties of the miplDb jqi object using a command line string.

Parameters:
args - An argument string containing the jqi parameters of "-catalog", "-password", "-database", "-server", -"dbmstype" followed by the value of the parameter.

Example: -catalog cassini_d -user joe. Order doesn't matter.


queryProps

public void queryProps()
The queryProps method is called if there are no user supplied arguments. When this method is called the user is prompted for input on the command line.


get_db_connection_info

public void get_db_connection_info(jqi db)
Get the database connection information from a jqi object to store into the mipDb jqi object of the VimsDb class.


getDbError

public boolean getDbError()
Returns true if any database errors were thrown.


getDbErrorCount

public int getDbErrorCount()
Returns the number of dbErrors encountered.


clearDbErrors

public void clearDbErrors()
Clears the dbError variables. This is useful when the VimsDb object has been declared static and is being used for multiple input files.


init

public void init()
This constructor registers the JDBC driver and creates a database connection. It also declares the CallableStatements for the stored procedures.


getDatabase

public String getDatabase()
Return the database string.


getServerName

public String getServerName()
Return the serverName string.


getUserName

public String getUserName()
Return the UserName string.


addVimsParamTour

public void addVimsParamTour(VimsParameterSet param_set,
                             VimsIoiHeader header)
Add an VimsParameterSet object to the database. This method calls the addVimsParamTour stored procedure in the Sybase database and adds the VimsParameterSet object to the vimsParamTour table.

Parameters:
param_set - The VimsParameterSet object to be added.

getVimsParamTour

public VimsParameterSetList getVimsParamTour(int trigger_number,
                                             String trigger_scet_time)
Returns an VimsParameterTourList object from the database.

Parameters:
trigger_number - The trigger number of interest.

addVimsParamHeaderTour

public void addVimsParamHeaderTour(VimsIoiHeader header)
Adds an VimsIoiHeader object to the database. This method calls the addVimsParamHeaderTour stored procedure in the Sybase database and adds the VimsIoiHeader object to the vimsParamHeaderTour table.

Parameters:
header - The VimsIoiHeader object to be added.

getVimsParamHeaderTour

public VimsIoiHeader getVimsParamHeaderTour(int trigger_number,
                                            String trigger_time)
Returns a VimsIoiHeader object from the database. If for any reason there is more than one header for an IOI only the latest one is returned (This is an error case and should never happen).

Parameters:
trigger_number - The trigger number of interest.
trigger_time - The scet time of the trigger (from the pef).

getShutterPredicts

public void getShutterPredicts(int triggerNumber)

addVimsPredTour

public void addVimsPredTour(VimsPredict predict)
This method adds an Vims Predict to the catalog.

Parameters:
predict - A VimsPredict object.

getVimsPredict

public VimsPredictList getVimsPredict(VimsTrigger trigger)
Returns an VimsPredictList object from the database.

Parameters:
trigger - A Vims Trigger