org.infoglue.deliver.controllers.kernel.impl.simple
Class BaseDeliveryController

java.lang.Object
  extended by org.infoglue.deliver.controllers.kernel.impl.simple.BaseDeliveryController
Direct Known Subclasses:
AvailableServiceBindingDeliveryController, ContentDeliveryController, DigitalAssetDeliveryController, ExtranetController, LanguageDeliveryController, NodeDeliveryController, RepositoryDeliveryController

public abstract class BaseDeliveryController
extends java.lang.Object

BaseDeliveryController.java Baseclass for Castor Controller Classes. Various methods to handle transactions and so on


Constructor Summary
BaseDeliveryController()
           
 
Method Summary
static void beginTransaction(org.exolab.castor.jdo.Database db)
          Begins a transaction on the named database
static void closeDatabase(org.exolab.castor.jdo.Database db)
          Close the database
static void closeTransaction(org.exolab.castor.jdo.Database db)
          Rollbacks a transaction on the named database
static void commitTransaction(org.exolab.castor.jdo.Database db)
          Ends a transaction on the named database
protected static org.exolab.castor.jdo.OQLQuery createQuery(org.exolab.castor.jdo.Database db, java.lang.String query, java.util.List params)
          Creates an OQLQuery for the provided Database and binds the parameters to it.
protected static java.util.List executeQuery(org.exolab.castor.jdo.Database db, java.lang.String query)
          Executes a Query with no parameters
protected static java.util.List executeQuery(org.exolab.castor.jdo.Database db, java.lang.String query, java.util.List params)
          Executes a Query, also binds the provided parameters
 java.util.List getAllVOObjects(java.lang.Class arg, org.exolab.castor.jdo.Database db)
          This method fetches all object in read only mode and returns a list of value objects.
 java.util.List getAllVOObjects(java.lang.Class arg, java.lang.String orderByField, java.lang.String direction, org.exolab.castor.jdo.Database db)
          This method fetches all object in read only mode and returns a list of value objects.
protected  java.lang.Object getObjectWithId(java.lang.Class arg, java.lang.Integer id, org.exolab.castor.jdo.Database db)
          This method fetches one object / entity within a transaction.
protected  BaseEntityVO getVOWithId(java.lang.Class arg, java.lang.Integer id, org.exolab.castor.jdo.Database db)
          This method fetches one object in read only mode and returns it's value object.
static void rollbackTransaction(org.exolab.castor.jdo.Database db)
          Rollbacks a transaction on the named database
protected static java.util.List toVOList(java.util.Collection entities)
          This method converts a List of entities to a list of value-objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseDeliveryController

public BaseDeliveryController()
Method Detail

getObjectWithId

protected java.lang.Object getObjectWithId(java.lang.Class arg,
                                           java.lang.Integer id,
                                           org.exolab.castor.jdo.Database db)
                                    throws SystemException,
                                           Bug
This method fetches one object / entity within a transaction.

Throws:
SystemException
Bug

getVOWithId

protected BaseEntityVO getVOWithId(java.lang.Class arg,
                                   java.lang.Integer id,
                                   org.exolab.castor.jdo.Database db)
                            throws SystemException,
                                   Bug
This method fetches one object in read only mode and returns it's value object.

Throws:
SystemException
Bug

getAllVOObjects

public java.util.List getAllVOObjects(java.lang.Class arg,
                                      org.exolab.castor.jdo.Database db)
                               throws SystemException,
                                      Bug
This method fetches all object in read only mode and returns a list of value objects.

Throws:
SystemException
Bug

getAllVOObjects

public java.util.List getAllVOObjects(java.lang.Class arg,
                                      java.lang.String orderByField,
                                      java.lang.String direction,
                                      org.exolab.castor.jdo.Database db)
                               throws SystemException,
                                      Bug
This method fetches all object in read only mode and returns a list of value objects.

Throws:
SystemException
Bug

executeQuery

protected static java.util.List executeQuery(org.exolab.castor.jdo.Database db,
                                             java.lang.String query)
                                      throws SystemException,
                                             java.lang.Exception
Executes a Query with no parameters

Parameters:
query - An OQL Query
Returns:
A list of the query results as Impls
Throws:
SystemException - If an error occurs
java.lang.Exception

executeQuery

protected static java.util.List executeQuery(org.exolab.castor.jdo.Database db,
                                             java.lang.String query,
                                             java.util.List params)
                                      throws java.lang.Exception
Executes a Query, also binds the provided parameters

Parameters:
query - An OQL Query
params - A List of paramters
Returns:
A list of the query results as Castor Impl
Throws:
SystemException - If an error occurs
java.lang.Exception

createQuery

protected static org.exolab.castor.jdo.OQLQuery createQuery(org.exolab.castor.jdo.Database db,
                                                            java.lang.String query,
                                                            java.util.List params)
                                                     throws org.exolab.castor.jdo.PersistenceException
Creates an OQLQuery for the provided Database and binds the parameters to it.

Parameters:
db - The Database to create the OQLQuery on
query - The String OQL query
params - A List of Objects to bind to the query sequentially
Returns:
An OQLQuery instance that can be executer
Throws:
org.exolab.castor.jdo.PersistenceException

toVOList

protected static java.util.List toVOList(java.util.Collection entities)
                                  throws SystemException,
                                         Bug
This method converts a List of entities to a list of value-objects.

Throws:
SystemException
Bug

beginTransaction

public static void beginTransaction(org.exolab.castor.jdo.Database db)
                             throws SystemException
Begins a transaction on the named database

Throws:
SystemException

closeTransaction

public static void closeTransaction(org.exolab.castor.jdo.Database db)
                             throws SystemException
Rollbacks a transaction on the named database

Throws:
SystemException

commitTransaction

public static void commitTransaction(org.exolab.castor.jdo.Database db)
                              throws SystemException
Ends a transaction on the named database

Throws:
SystemException

rollbackTransaction

public static void rollbackTransaction(org.exolab.castor.jdo.Database db)
                                throws SystemException
Rollbacks a transaction on the named database

Throws:
SystemException

closeDatabase

public static void closeDatabase(org.exolab.castor.jdo.Database db)
                          throws SystemException
Close the database

Throws:
SystemException


Copyright © 2005 InfoGlue.org All Rights Reserved.