Class SarImage

java.lang.Object
  |
  +--SarImage

public class SarImage
extends java.lang.Object

Parses metadata files, creates a database connection, and inserts the data into the database. If an error occurs during the insertion to the database, the data is rolled back.


Constructor Summary
SarImage(java.lang.String id, java.lang.String fLoc, java.lang.String pUrl)
          Constructor to create a SarImage object.
 
Method Summary
 AntData createANT()
          Opens the ant data file, parses the data, and stores in a AntData object
 CnfData createCNF()
          Opens the cnf data file, parses the data, and stores in a CnfData object
 IfmuData createIFMU()
          Opens the ifmu data file, parses the data, and stores in a IfmuData object
static ImuData createIMU()
          Opens the imu data file, parses the data, and stores in a ImuData object
static void insertANT(java.sql.Statement stmt)
          Inserts the data from a AntData object into the database.
static void insertCNF(java.sql.Statement stmt)
          Inserts the data from a CnfData object into the database.
 void insertDataValues()
          Creates a connection to the database and inserts the data from the data structures into the database.
static void insertIFMU(java.sql.Statement stmt)
          Inserts the data from a IfmuData object into the database.
static void insertIMAGE(java.sql.Statement stmt)
          Inserts the data about the SarImage object into the database.
static void insertIMU(java.sql.Statement stmt)
          Inserts the data from a ImuData object into the database.
static void rollbackData(java.sql.Statement stmt)
           
 void setDataValues()
          Parses the metadata from the files and stores it in the appropriate data structures.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SarImage

public SarImage(java.lang.String id,
                java.lang.String fLoc,
                java.lang.String pUrl)
Constructor to create a SarImage object. Initializes filenames for the cnf, ant, imu, and ifmu files.
Parameters:
id - the image ID
fLoc - the location of the files
pUrl - the url to the directory of the 'gif' image
Method Detail

setDataValues

public void setDataValues()
Parses the metadata from the files and stores it in the appropriate data structures.

insertDataValues

public void insertDataValues()
Creates a connection to the database and inserts the data from the data structures into the database.

createCNF

public CnfData createCNF()
                  throws ParsingException
Opens the cnf data file, parses the data, and stores in a CnfData object
Returns:
the CnfData object
Throws:
ParsingException - an error occured when opening or reading the file

insertCNF

public static void insertCNF(java.sql.Statement stmt)
                      throws ParsingException
Inserts the data from a CnfData object into the database.
Parameters:
stmt - the database connection statement
Throws:
ParsingException - an error occured when inserting the data

createANT

public AntData createANT()
                  throws ParsingException
Opens the ant data file, parses the data, and stores in a AntData object
Returns:
the AntData object
Throws:
ParsingException - an error occured when opening or reading the file

insertANT

public static void insertANT(java.sql.Statement stmt)
                      throws ParsingException
Inserts the data from a AntData object into the database.
Parameters:
stmt - the database connection statement
Throws:
ParsingException - an error occured when inserting the data

createIMU

public static ImuData createIMU()
                         throws ParsingException
Opens the imu data file, parses the data, and stores in a ImuData object
Returns:
the ImuData object
Throws:
ParsingException - an error occured when opening or reading the file

insertIMU

public static void insertIMU(java.sql.Statement stmt)
                      throws ParsingException
Inserts the data from a ImuData object into the database.
Parameters:
stmt - the database connection statement
Throws:
ParsingException - an error occured when inserting the data

createIFMU

public IfmuData createIFMU()
                    throws ParsingException
Opens the ifmu data file, parses the data, and stores in a IfmuData object
Returns:
the IfuData object
Throws:
ParsingException - an error occured when opening or reading the file

insertIFMU

public static void insertIFMU(java.sql.Statement stmt)
                       throws ParsingException
Inserts the data from a IfmuData object into the database.
Parameters:
stmt - the database connection statement
Throws:
ParsingException - an error occured when inserting the data

insertIMAGE

public static void insertIMAGE(java.sql.Statement stmt)
                        throws ParsingException
Inserts the data about the SarImage object into the database.
Parameters:
stmt - the database connection statement
Throws:
ParsingException - an error occured when inserting the data

rollbackData

public static void rollbackData(java.sql.Statement stmt)