com.cgiams.esl.util
Class CustomDataManagerImpl

java.lang.Object
  extended bycom.cgiams.esl.util.CustomDataManagerImpl
All Implemented Interfaces:
DataManager, ValueListHandler

public class CustomDataManagerImpl
extends java.lang.Object
implements DataManager

This class is merely an object shell for verifying multiple data access layers can be created through the DataManagerFactory object. It currently provides no real implementation.

Modification History
Programmer Date Description
Scott Bowers 04/06/2005 Original Author


Constructor Summary
CustomDataManagerImpl(java.lang.String as_config_file)
          Default constructor required by the DataManagerFactory class.
 
Method Summary
 void commitTxn()
          Commit a transaction.
 java.util.Collection getData(java.lang.String as_sql_id)
          This method will retrieve a data set based on the specified SQL ID.
 java.util.Collection getData(java.lang.String as_sql_id, java.lang.Object ao_arguments)
          This method will retrieve a data set based on the specified SQL ID and arguments.
 java.lang.String getSystemOptionString(java.lang.String as_option_name)
          This method will return the String value for the specified option name.
 ValueListResultContext getValueObjects(ValueListSearchContext ao_search_parms)
          Retrieves a list of value objects based on the incoming search parameters and returns the list in the ValueListResultContext.
 void rollbackTxn()
          Rollback a transaction.
 void startTxn()
          Start a transaction.
 org.w3c.dom.Document toXML(java.lang.String as_root_name, java.lang.String[] as_sql_ids, java.lang.String[] as_xml_tags, java.lang.Object ao_arguments)
          This method will take a list of SQL IDs to execute, convert the results to an XML document, and return the document.
 void updateData(java.lang.String as_sql_id, java.lang.Object ao_arguments)
          This method will execute an update based on the specified SQL ID and arguments.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomDataManagerImpl

public CustomDataManagerImpl(java.lang.String as_config_file)
Default constructor required by the DataManagerFactory class.

Parameters:
as_config_file - The configuration file name.
Method Detail

startTxn

public void startTxn()
              throws java.sql.SQLException
Start a transaction.

Specified by:
startTxn in interface DataManager
Throws:
java.sql.SQLException - If any error occurs.

commitTxn

public void commitTxn()
               throws java.sql.SQLException
Commit a transaction.

Specified by:
commitTxn in interface DataManager
Throws:
java.sql.SQLException - If any error occurs.

rollbackTxn

public void rollbackTxn()
                 throws java.sql.SQLException
Rollback a transaction.

Specified by:
rollbackTxn in interface DataManager
Throws:
java.sql.SQLException - If any error occurs.

getSystemOptionString

public java.lang.String getSystemOptionString(java.lang.String as_option_name)
                                       throws java.lang.Exception
This method will return the String value for the specified option name. The SQL Select defined in the Data Access Layer must define the String column with the same name as the value defined by the static variable of this class called ss_system_option_string. Also, this method calls DataManager.getSystemOption(String,String), so that method's prerequisites must also be met.

Specified by:
getSystemOptionString in interface DataManager
Parameters:
as_option_name - The option name to return the String value for.
Returns:
The String value for the specified option name.
Throws:
java.lang.Exception - If an error occurres.

getData

public java.util.Collection getData(java.lang.String as_sql_id)
                             throws java.lang.Exception
This method will retrieve a data set based on the specified SQL ID. The SQL ID is defined in the Data Access Layer implmenetation.

Specified by:
getData in interface DataManager
Parameters:
as_sql_id - The ID of a predefined SQL Select statement to execute.
Returns:
The retrieved data set.
Throws:
java.lang.Exception - If an error occurres.

getData

public java.util.Collection getData(java.lang.String as_sql_id,
                                    java.lang.Object ao_arguments)
                             throws java.lang.Exception
This method will retrieve a data set based on the specified SQL ID and arguments. The SQL ID is defined in the Data Access Layer implmenetation.

Specified by:
getData in interface DataManager
Parameters:
as_sql_id - The ID of a predefined SQL Select statement to execute.
ao_arguments - The arguments that will be passed to and used by the SQL Select statement. This argument can be null.
Returns:
The retrieved data set.
Throws:
java.lang.Exception - If an error occurres.

updateData

public void updateData(java.lang.String as_sql_id,
                       java.lang.Object ao_arguments)
                throws java.lang.Exception
This method will execute an update based on the specified SQL ID and arguments. The SQL ID is defined in the Data Access Layer implmenetation.

Specified by:
updateData in interface DataManager
Parameters:
as_sql_id - The ID of a predefined SQL Insert or Update statement to execute.
ao_arguments - The arguments that will be passed to and used by the SQL Insert or Update statement.
Throws:
java.lang.Exception - If an error occurres.

toXML

public org.w3c.dom.Document toXML(java.lang.String as_root_name,
                                  java.lang.String[] as_sql_ids,
                                  java.lang.String[] as_xml_tags,
                                  java.lang.Object ao_arguments)
                           throws java.lang.Exception
This method will take a list of SQL IDs to execute, convert the results to an XML document, and return the document. If the list of SQL IDs is null or empty the XML document is created with the specified root name with child elements built from the ao_argument parameter if it is a Map. the XML document that will be returned.

Specified by:
toXML in interface DataManager
Parameters:
as_root_name - The name that will be used as the root element in the XML document that will be returned.
as_sql_ids - The SQL IDs that are to be executed.
as_xml_tags - The corresponding XML tag names for the SQL IDs.
ao_arguments - A Java Bean or Map containing the arguments to the SQL Selects defined by as_sql_ids.
Returns:
An XML Document containing the data retrieved.
Throws:
java.lang.Exception - If an error occurres.

getValueObjects

public ValueListResultContext getValueObjects(ValueListSearchContext ao_search_parms)
                                       throws ESLException
Retrieves a list of value objects based on the incoming search parameters and returns the list in the ValueListResultContext. The incoming search context specifies whether the retrieval is an initial retrieval or, possibly, asking for the next set of value objects.

Specified by:
getValueObjects in interface ValueListHandler
Parameters:
ao_search_parms - A ValueListSearchContext object indicating how and what to retrieve.
Returns:
A ValueListResultContext object that provides a list of value objects and whether the list is complete or not.
Throws:
ESLException - If any error occurs.