icecube.daq.domcal
Class CalibratorDB

java.lang.Object
  extended by icecube.daq.db.domprodtest.DOMProdTestDB
      extended by icecube.daq.domcal.CalibratorDB

public class CalibratorDB
extends icecube.daq.db.domprodtest.DOMProdTestDB

Database interface for Calibrator.


Constructor Summary
CalibratorDB()
          Constructor.
CalibratorDB(java.util.Properties props)
          Constructor.
 
Method Summary
static void clearStatic()
          Clear all cached entries.
 void load(Calibrator cal, java.lang.String mbSerial, java.util.Date date, double temp)
          Load calibration data.
 Calibrator load(java.lang.String mbSerial, java.util.Date date, double temp)
          Load calibration data.
 void loadMain(java.sql.Statement stmt, Calibrator cal, java.lang.String mbSerial, java.util.Date date, double temp)
          Load main calibration data.
 int save(Calibrator cal)
          Save calibration data.
static void save(java.lang.String fileName, org.apache.log4j.Logger logger)
          Save specified file to the database.
static void save(java.lang.String fileName, org.apache.log4j.Logger logger, CalibratorDB calDB, boolean verbose)
          Save specified file to the database.
 void setLaboratory(icecube.daq.db.domprodtest.Laboratory lab)
          Set the laboratory used to generate unique IDs.
 
Methods inherited from class icecube.daq.db.domprodtest.DOMProdTestDB
close, findProperties, findPropertiesFile, getConnection, getStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalibratorDB

public CalibratorDB()
             throws icecube.daq.db.domprodtest.DOMProdTestException,
                    java.io.IOException,
                    java.sql.SQLException
Constructor.

Throws:
icecube.daq.db.domprodtest.DOMProdTestException - if there is a problem creating the object
java.io.IOException - if there is a problem reading the properties.
java.sql.SQLException - if there is a problem initializing the database.

CalibratorDB

public CalibratorDB(java.util.Properties props)
             throws icecube.daq.db.domprodtest.DOMProdTestException,
                    java.io.IOException,
                    java.sql.SQLException
Constructor.

Parameters:
props - properties used to initialize the database connection
Throws:
icecube.daq.db.domprodtest.DOMProdTestException - if there is a problem creating the object
java.io.IOException - if there is a problem reading the properties.
java.sql.SQLException - if there is a problem initializing the database.
Method Detail

clearStatic

public static void clearStatic()
Clear all cached entries.


load

public Calibrator load(java.lang.String mbSerial,
                       java.util.Date date,
                       double temp)
                throws DOMCalibrationException,
                       java.sql.SQLException
Load calibration data.

Parameters:
mbSerial - mainboard serial number of DOM being loaded
date - date of data being loaded
temp - temperature of data being loaded
Returns:
loaded data
Throws:
DOMCalibrationException - if an argument is invalid
java.sql.SQLException - if there is a database problem

load

public void load(Calibrator cal,
                 java.lang.String mbSerial,
                 java.util.Date date,
                 double temp)
          throws DOMCalibrationException,
                 java.sql.SQLException
Load calibration data.

Parameters:
cal - calibration object to be filled
mbSerial - mainboard serial number of DOM being loaded
date - date of data being loaded
temp - temperature of data being loaded
Throws:
DOMCalibrationException - if an argument is invalid
java.sql.SQLException - if there is a database problem

loadMain

public void loadMain(java.sql.Statement stmt,
                     Calibrator cal,
                     java.lang.String mbSerial,
                     java.util.Date date,
                     double temp)
              throws DOMCalibrationException,
                     java.sql.SQLException
Load main calibration data.

Parameters:
stmt - SQL statement
cal - calibration object to be filled
mbSerial - mainboard serial number of DOM being loaded
date - date of data being loaded
temp - temperature of data being loaded
Throws:
DOMCalibrationException - if there is a problem with the data
java.sql.SQLException - if there is a database problem

save

public static final void save(java.lang.String fileName,
                              org.apache.log4j.Logger logger)
                       throws DOMCalibrationException,
                              java.io.IOException,
                              java.sql.SQLException
Save specified file to the database.

Parameters:
fileName - file name
logger - error logger
Throws:
icecube.daq.db.domprodtest.DOMProdTestException - if there is a problem creating the object
java.io.IOException - if there is a problem reading the properties.
java.sql.SQLException - if there is a problem initializing the database.
DOMCalibrationException

save

public static final void save(java.lang.String fileName,
                              org.apache.log4j.Logger logger,
                              CalibratorDB calDB,
                              boolean verbose)
                       throws DOMCalibrationException,
                              java.io.IOException,
                              java.sql.SQLException
Save specified file to the database.

Parameters:
fileName - file name
logger - error logger
calDB - database interface (one will be created if this is not null
verbose - true for verbose comparison
Throws:
icecube.daq.db.domprodtest.DOMProdTestException - if there is a problem creating the object
java.io.IOException - if there is a problem reading the properties.
java.sql.SQLException - if there is a problem initializing the database.
DOMCalibrationException

save

public int save(Calibrator cal)
         throws DOMCalibrationException,
                java.sql.SQLException
Save calibration data.

Parameters:
cal - calibration data
Returns:
ID of inserted data
Throws:
DOMCalibrationException - if there is a problem with the data
java.sql.SQLException - if there is a database problem

setLaboratory

public void setLaboratory(icecube.daq.db.domprodtest.Laboratory lab)
Set the laboratory used to generate unique IDs.

Parameters:
lab - laboratory


Copyright © 2006 IceCube Collaboration. All Rights Reserved.