|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.wgen.op.db.dbunit.DBUnitCapture
Event driven database data capturer.
When registered in a DatabaseCall in the DBUnitHandlingOption.PROP_DBUNIT_CAPTURE option,
the outputs of the call will be captured to a file within the /opt/op_data directory.
This class uses a Transformer registered in the call's
DBUnitHandlingOption.PROP_DBUNIT_CALL_FILE_TRANSFORM_CALLBACK
option to determine the file to store the data. It uses Transformer registered in the
call's DBUnitHandlingOption.PROP_DBUNIT_PARAM_TABLE_TRANSFORM_CALLBACK
to determine the table name within that file. If no Transformer is registered in those
options, the PathCallbackTransformer is used.
PathCallbackTransformer| Field Summary | |
private DatabaseCall |
_call
|
private org.dbunit.dataset.DefaultDataSet |
_dataSet
|
static java.lang.String |
ROOT_DATA_DIR
|
static java.lang.String |
SINGLE_VALUE_COLUMN_NAME
|
| Constructor Summary | |
DBUnitCapture(DatabaseCall call)
|
|
| Method Summary | |
void |
captureMetaData(int paramIdx,
java.sql.ResultSet resultSet)
Called at the beginning of a ResultSet capture to initialize the table within the DataSet. |
void |
captureRow(int paramIdx,
java.lang.Object[] rowValues)
Captures one row of a ResultSet or array and puts it into the table at the given index. |
void |
captureSingleOutputValue(int paramIdx,
int jdbcType,
java.lang.Object value)
Captures a database call output. |
static int |
findParamIndexTableNameForParam(DatabaseCall dbCall,
java.lang.String tableName)
Uses a Transformer registered in DBUnitHandlingOption.PROP_DBUNIT_PARAM_TABLE_TRANSFORM_CALLBACK to come up
with the index associated with the discovered table name. |
static java.io.File |
findPathForCall(DatabaseCall dbCall,
HandlingOption option)
|
static java.lang.String |
findTableNameForParam(DatabaseCall dbCall,
int idx)
Uses a Transformer registered in DBUnitHandlingOption.PROP_DBUNIT_PARAM_TABLE_TRANSFORM_CALLBACK
to come up with the name of the table for the given index. |
void |
writeOutputsToFileSystem()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String ROOT_DATA_DIR
public static final java.lang.String SINGLE_VALUE_COLUMN_NAME
private final DatabaseCall _call
private org.dbunit.dataset.DefaultDataSet _dataSet
| Constructor Detail |
public DBUnitCapture(DatabaseCall call)
| Method Detail |
public void captureMetaData(int paramIdx,
java.sql.ResultSet resultSet)
throws java.sql.SQLException,
DatabaseCallException
paramIdx - the parameter index of the ResultSet (use 0 for PreparedStatement queries)resultSet - the resultSet to be captured
java.sql.SQLException
DatabaseCallException
public void captureRow(int paramIdx,
java.lang.Object[] rowValues)
throws DatabaseCallException
paramIdx - the index of the ResultSet return (use 0 for PreparedStatement queries)rowValues - the values of the row
DatabaseCallException
public void captureSingleOutputValue(int paramIdx,
int jdbcType,
java.lang.Object value)
throws DatabaseCallException
paramIdx - the index of the output being capturedjdbcType - the jdbcType of the output either from javax.sql.Types or oracle.jdbc.OracleTypesvalue - the value to be captured
DatabaseCallException
public void writeOutputsToFileSystem()
throws java.io.IOException,
org.dbunit.dataset.DataSetException,
javax.xml.parsers.ParserConfigurationException,
javax.xml.transform.TransformerException
java.io.IOException
org.dbunit.dataset.DataSetException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException
public static java.io.File findPathForCall(DatabaseCall dbCall,
HandlingOption option)
dbCall - option - the name of the option holding the name of the set
/opt/wgen/dbunit
ddirectory.
public static java.lang.String findTableNameForParam(DatabaseCall dbCall,
int idx)
DBUnitHandlingOption.PROP_DBUNIT_PARAM_TABLE_TRANSFORM_CALLBACK
to come up with the name of the table for the given index. If no Transformer is registered,
a PathCallbackTransformer is used.
dbCall - the call being capturedidx - the index of the parameter being captured
public static int findParamIndexTableNameForParam(DatabaseCall dbCall,
java.lang.String tableName)
DBUnitHandlingOption.PROP_DBUNIT_PARAM_TABLE_TRANSFORM_CALLBACK to come up
with the index associated with the discovered table name. If no Transformer is
registered, a PathCallbackTransformer is used.
dbCall - the call being capturedtableName - the name of the table that was found
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||