uk.org.iscream.cms.server.dbinterface
Class DBInserter

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--uk.org.iscream.cms.server.dbinterface.DBInserter
All Implemented Interfaces:
Runnable

public class DBInserter
extends Thread

A class containing a method to accept a String containing XML. This string is then parsed and the contents are added to the database. IMPORTANT: This method obtains the database user and database connection password from a seperate configuration file. As such, this class may be safely placed in a public CVS repository.

Version:
$Id: DBInserter.java,v 1.30 2003/02/05 16:43:47 tdb Exp $
Author:
$Author: tdb $

Field Summary
private  Logger _logger
          This holds a reference to the system logger that is being used.
private  String _mySQLDatabase
          The SQL database name
private  String _mySQLHost
          The SQL Host
private  String _mySQLPassword
          The SQL password
private  String _mySQLUser
          The SQL username
private  String _name
          This is the friendly identifier of the component this class is running in.
private  Queue _queue
          A reference to our Queue
 String REVISION
          The current CVS revision of this class
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DBInserter(Queue queue)
           
 
Method Summary
private  void addToDatabase(XMLPacketWrapper xpw)
          Inserts the data into the database
 void run()
          Main run Thread of this class
 String toString()
          Overrides the Object.toString() method to provide clean logging (every class should have this).
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public final String REVISION
The current CVS revision of this class

See Also:
Constant Field Values

_mySQLUser

private String _mySQLUser
The SQL username


_mySQLPassword

private String _mySQLPassword
The SQL password


_mySQLDatabase

private String _mySQLDatabase
The SQL database name


_mySQLHost

private String _mySQLHost
The SQL Host


_name

private String _name
This is the friendly identifier of the component this class is running in. eg, a Filter may be called "filter1", If this class does not have an owning component, a name from the configuration can be placed here. This name could also be changed to null for utility classes.


_logger

private Logger _logger
This holds a reference to the system logger that is being used.


_queue

private Queue _queue
A reference to our Queue

Constructor Detail

DBInserter

public DBInserter(Queue queue)
           throws ComponentStartException
Method Detail

run

public void run()
Main run Thread of this class

Specified by:
run in interface Runnable
Overrides:
run in class Thread

toString

public String toString()
Overrides the Object.toString() method to provide clean logging (every class should have this). This uses the uk.org.iscream.cms.util.NameFormat class to format the toString()

Overrides:
toString in class Thread
Returns:
the name of this class and its CVS revision

addToDatabase

private void addToDatabase(XMLPacketWrapper xpw)
Inserts the data into the database

Parameters:
xpw - the XML data to be inserted


Copyright © 2000-2003 i-scream. All Rights Reserved.