edu.ucsb.nceas.metacat.harvesterClient
Class Harvester

java.lang.Object
  extended byedu.ucsb.nceas.metacat.harvesterClient.Harvester

public class Harvester
extends java.lang.Object

Harvester is the main class for the Harvester application. The main method creates a single Harvester object which drives the application.

Author:
costa

Field Summary
static java.lang.String filler
           
static java.lang.String marker
           
static edu.ucsb.nceas.utilities.Options options
           
 
Constructor Summary
Harvester()
          Constructor.
 
Method Summary
 void closeConnection()
           
 java.lang.String dequoteText(java.lang.String text)
          Normalizes text prior to insertion into the HARVEST_LOG or HARVEST_DETAIL_LOG tables.
 java.sql.Connection getConnection()
          Returns a connection to the database.
 int getDetailLogID()
          Gets the current value of the detailLogID for storage as a primary key in the DETAIL_LOG_ID field of the HARVEST_DETAIL_LOG table.
 int getHarvestLogID()
          Gets the current value of the harvestLogID for storage as a primary key in the HARVEST_LOG_ID field of the HARVEST_LOG table.
 void initLogIDs()
          Initializes the detailLogID and harvestLogID values to their current maximums + 1.
static void loadOptions(boolean test)
          Loads Harvester options from a configuration file.
static void main(java.lang.String[] args)
          Harvester main method.
 void setHarvestStartTime(java.util.Date date)
          Sets the harvest start time for this harvest run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filler

public static final java.lang.String filler
See Also:
Constant Field Values

marker

public static final java.lang.String marker
See Also:
Constant Field Values

options

public static edu.ucsb.nceas.utilities.Options options
Constructor Detail

Harvester

public Harvester()
Constructor. Creates a new instance of Harvester.

Method Detail

loadOptions

public static void loadOptions(boolean test)
Loads Harvester options from a configuration file.


main

public static void main(java.lang.String[] args)
Harvester main method.

Parameters:
args - the command line arguments
Throws:
SAXException
java.io.IOException
ParserConfigurationException

closeConnection

public void closeConnection()

dequoteText

public java.lang.String dequoteText(java.lang.String text)
Normalizes text prior to insertion into the HARVEST_LOG or HARVEST_DETAIL_LOG tables. In particular, replaces the single quote character with the double quote character. This prevents SQL errors involving words that contain single quotes. Also removes \n and \r characters from the text.

Parameters:
text - the original string
Returns:
a string containing the normalized text

getConnection

public java.sql.Connection getConnection()
Returns a connection to the database. Opens the connection if a connection has not already been made previously.

Returns:
conn the database Connection object

getDetailLogID

public int getDetailLogID()
Gets the current value of the detailLogID for storage as a primary key in the DETAIL_LOG_ID field of the HARVEST_DETAIL_LOG table.

Returns:
the current value of the detailLogID

getHarvestLogID

public int getHarvestLogID()
Gets the current value of the harvestLogID for storage as a primary key in the HARVEST_LOG_ID field of the HARVEST_LOG table.

Returns:
the current value of the detailLogID

initLogIDs

public void initLogIDs()
Initializes the detailLogID and harvestLogID values to their current maximums + 1.


setHarvestStartTime

public void setHarvestStartTime(java.util.Date date)
Sets the harvest start time for this harvest run.

Parameters:
date -


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.