ca.cbc.sportwire.dochandler
Class XMLDBMSDocHandler

java.lang.Object
  |
  +--ca.cbc.sportwire.dochandler.XMLDBMSDocHandler
All Implemented Interfaces:
DocHandler, WireFeederProperties

public class XMLDBMSDocHandler
extends java.lang.Object
implements DocHandler, WireFeederProperties

XMLDBMSDocHandler is used by the DocQueue to process items on the backlog queue. This handler translates XML into DOMs, then uses the appropriate XMLDBMS Map schema to stuff the document's data into the database.

Created: Wed Nov 14 15:04:36 2001

Version:
$Id: XMLDBMSDocHandler.java,v 1.21 2002/04/23 04:55:51 garym Exp $
Author:
Gary Lawrence Murphy

Field Summary
(package private) static org.apache.log4j.Category cat
          Set up a reporting category in Log4J
private  org.apache.commons.collections.ExtendedProperties config
           
(package private) static org.apache.log4j.Category dump
           
 
Fields inherited from interface ca.cbc.sportwire.WireFeederProperties
CONFIGFILE_DEFAULT, CONFIGFILE_PROPERTY, DEFAULT_FILENAME_XPATH, DEFAULT_SAX_DRIVER_CLASS, DEFAULT_XML_PATH, DEFAULT_XMLRPC_PORT, DOCHANDLER_DEFAULT, DOCHANDLER_PROPERTY, DOCWORKERS_DEFAULT, DOCWORKERS_PROPERTY, DTD_PATH_PROPERTY, FEED_REGEX_PROPERTY, FEEDCLASS_DEFAULT, FEEDCLASS_PROPERTY, FEEDFILTER_DEFAULT, FEEDFILTER_PROPERTY, FILENAME_XPATH_PROPERTY, IGNOREFILE_PROPERTY, LOGFILE_DEFAULT, LOGFILE_PROPERTY, MAP_PATH_PROPERTY, SAX_CLASS_PROPERTY, WATCHDOG_IDLE_DEFAULT, WATCHDOG_IDLE_PROPERTY, XML_PATH_PROPERTY, XMLRPC_PORT_PROPERTY, XSL_PATH_PROPERTY
 
Constructor Summary
XMLDBMSDocHandler(org.apache.commons.collections.ExtendedProperties config)
          XMLDBMSDocHandler constructor stores the config so we can get at connection details later
 
Method Summary
 org.apache.commons.collections.ExtendedProperties getConfig()
          Get the value of config.
private  java.lang.String getSaxClass()
           
 java.lang.Object processDocument(java.lang.Object d)
          processDocument: handler for the DocQueue, this method parses the doc.toString() through Xerces to create a DOM, then selected the Map appropriate to the DocType and stuffs the DOM in the database using that O:R Map.
 void setConfig(org.apache.commons.collections.ExtendedProperties v)
          Set the value of config.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

cat

static org.apache.log4j.Category cat
Set up a reporting category in Log4J

dump

static org.apache.log4j.Category dump

config

private org.apache.commons.collections.ExtendedProperties config
Constructor Detail

XMLDBMSDocHandler

public XMLDBMSDocHandler(org.apache.commons.collections.ExtendedProperties config)
XMLDBMSDocHandler constructor stores the config so we can get at connection details later
Parameters:
config - an ExtendedProperties value
Method Detail

getConfig

public org.apache.commons.collections.ExtendedProperties getConfig()
Get the value of config.
Returns:
ExtendedProperties value of config.

setConfig

public void setConfig(org.apache.commons.collections.ExtendedProperties v)
Set the value of config.
Parameters:
v - Value to assign to config.

getSaxClass

private java.lang.String getSaxClass()

processDocument

public java.lang.Object processDocument(java.lang.Object d)
processDocument: handler for the DocQueue, this method parses the doc.toString() through Xerces to create a DOM, then selected the Map appropriate to the DocType and stuffs the DOM in the database using that O:R Map. If any of the inserts fail, the transaction is rolled back and the document ignored.
Specified by:
processDocument in interface DocHandler
Parameters:
doc - any Object where the string form is XML