org.apache.lokahi.core.common.database
Class XMLBroker<T extends XMLDao>

java.lang.Object
  extended by org.apache.lokahi.core.common.database.XMLBroker<T>
All Implemented Interfaces:
ReadOnlyBroker<T>

public class XMLBroker<T extends XMLDao>
extends java.lang.Object
implements ReadOnlyBroker<T>

Version:
$Id: XMLBroker.java,v 1.4 2006/03/07 22:05:24 drtobes Exp $
Author:
Stephen Toback

Constructor Summary
XMLBroker(java.io.File f, java.lang.Class<T> aClass)
           
XMLBroker(java.io.InputStream in, java.lang.Class<T> aClass)
           
XMLBroker(java.lang.String filename, java.lang.Class<T> aClass)
           
 
Method Summary
protected  T fillObject(java.lang.Class<T> c, org.jdom.Element r)
           
 T getObject(java.lang.Class<T> aClass, java.lang.String statement, boolean cache, java.lang.Object... objects)
          Gets a singular object from the datastore.
 java.util.Collection<T> getObjects(java.lang.Class<T> aClass, boolean cache, java.lang.String statement, java.lang.Object... objects)
          Gets a collection of objects from the datastore.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLBroker

public XMLBroker(java.lang.String filename,
                 java.lang.Class<T> aClass)
          throws java.io.IOException,
                 org.jdom.JDOMException
Throws:
java.io.IOException
org.jdom.JDOMException

XMLBroker

public XMLBroker(java.io.File f,
                 java.lang.Class<T> aClass)
          throws java.io.IOException,
                 org.jdom.JDOMException
Throws:
java.io.IOException
org.jdom.JDOMException

XMLBroker

public XMLBroker(java.io.InputStream in,
                 java.lang.Class<T> aClass)
          throws java.io.IOException,
                 org.jdom.JDOMException
Throws:
java.io.IOException
org.jdom.JDOMException
Method Detail

getObject

public T getObject(java.lang.Class<T> aClass,
                   java.lang.String statement,
                   boolean cache,
                   java.lang.Object... objects)
                           throws java.sql.SQLException
Description copied from interface: ReadOnlyBroker
Gets a singular object from the datastore.

Specified by:
getObject in interface ReadOnlyBroker<T extends XMLDao>
Parameters:
aClass - Class of the expected object return.
statement - key to get the object from the datastore.
cache - true a cached object will suffice.
objects - objects to look up the desired object by.
Returns:
object of Class c populated.
Throws:
java.sql.SQLException

getObjects

public java.util.Collection<T> getObjects(java.lang.Class<T> aClass,
                                          boolean cache,
                                          java.lang.String statement,
                                          java.lang.Object... objects)
                                                  throws java.sql.SQLException
Description copied from interface: ReadOnlyBroker
Gets a collection of objects from the datastore.

Specified by:
getObjects in interface ReadOnlyBroker<T extends XMLDao>
Parameters:
aClass - Class of the expected object return.
cache - true a cached object will suffice.
statement - key to get the object from the datastore.
objects - objects to look up the desired object by.
Returns:
object of Class c populated.
Throws:
java.sql.SQLException

fillObject

protected T fillObject(java.lang.Class<T> c,
                       org.jdom.Element r)