edu.ucsb.nceas.metacat.replication
Class ReplicationHandler

java.lang.Object
  extended by java.util.TimerTask
      extended by edu.ucsb.nceas.metacat.replication.ReplicationHandler
All Implemented Interfaces:
java.lang.Runnable

public class ReplicationHandler
extends java.util.TimerTask

This class handles deltaT replication checking. Whenever this TimerTask is fired it checks each server in xml_replication for updates and updates the local db as needed.


Constructor Summary
ReplicationHandler()
           
ReplicationHandler(int serverCheckCode)
           
 
Method Summary
static java.util.Date combinateCurrentDateAndGivenTime(java.lang.String givenTime)
          This method will combine given time string(in short format) to current date.
static org.xml.sax.XMLReader initParser(org.xml.sax.helpers.DefaultHandler dh)
          Method to initialize the message parser
 void run()
          Method that implements TimerTask.run().
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationHandler

public ReplicationHandler()

ReplicationHandler

public ReplicationHandler(int serverCheckCode)
Method Detail

run

public void run()
Method that implements TimerTask.run(). It runs whenever the timer is fired.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask

initParser

public static org.xml.sax.XMLReader initParser(org.xml.sax.helpers.DefaultHandler dh)
                                        throws HandlerException
Method to initialize the message parser

Throws:
HandlerException

combinateCurrentDateAndGivenTime

public static java.util.Date combinateCurrentDateAndGivenTime(java.lang.String givenTime)
                                                       throws HandlerException
This method will combine given time string(in short format) to current date. If the given time (e.g 10:00 AM) passed the current time (e.g 2:00 PM Aug 21, 2005), then the time will set to second day, 10:00 AM Aug 22, 2005. If the given time (e.g 10:00 AM) haven't passed the current time (e.g 8:00 AM Aug 21, 2005) The time will set to be 10:00 AM Aug 21, 2005.

Parameters:
givenTime - the format should be "10:00 AM " or "2:00 PM"
Returns:
Throws:
java.lang.Exception
HandlerException


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