org.osesb.scheduledjobs.databasepoller
Class SelectAndDeleteProcessedRowsTableSetAdapter

java.lang.Object
  extended by org.osesb.connectors.jdbc.TableSetAdapter
      extended by org.osesb.connectors.jdbc.SelectStatementTableSetAdapter
          extended by org.osesb.scheduledjobs.databasepoller.SelectAndCheckpointProcessedRowsTableSetAdapter
              extended by org.osesb.scheduledjobs.databasepoller.SelectAndDeleteProcessedRowsTableSetAdapter

public class SelectAndDeleteProcessedRowsTableSetAdapter
extends SelectAndCheckpointProcessedRowsTableSetAdapter

SelectAndDeleteProcessedRowsTableSetAdapter is a TableSetAdapter that is designed to be used with a database poller scheduled job.

SelectAndDeleteProcessedRowsTableSetAdapter extends SelectAndCheckpointProcessedRowsTableSetAdapter with a checkpointProcessedRows() method that removes processed rows from the target table.

SelectAndDeleteProcessedRowsTableSetAdapter extends SelectStatementTableSetAdapter, which accomplishes the table scan, and has a checkpointProcessedRows() method that is invoked to delete processed rows after message(s) are sent to an osESB transfort handlers. Typically, a scrollable, updatable ResultSet is configured for the select statement.

By default, processTableSet() looks for a SQL statement named 'selectStatement' in the SQLStatementListConfiguration portion of the TableSetConfiguration file. To specify a SQLStatement with a different name, configure an adapter property named 'selectStatementName'.

See Also:
SelectAndCheckpointProcessedRowsTableSetAdapter

Field Summary
 
Fields inherited from class org.osesb.connectors.jdbc.SelectStatementTableSetAdapter
connectedResultSetConnection
 
Fields inherited from class org.osesb.connectors.jdbc.TableSetAdapter
log, parentTableSet, tableSetAdapterConfiguration, thisClassName
 
Constructor Summary
SelectAndDeleteProcessedRowsTableSetAdapter(TableSet parentTableSet, TableSetAdapterConfiguration tableSetAdapterConfiguration)
          Creates a new instance of SelectAndDeleteProcessedRowsTableSetAdapter.
 
Method Summary
 java.lang.Object[] checkpointProcessedRows(java.sql.ResultSet rs)
          Delete processed rows using a scrollable, updatable ResultSet.
static void main(java.lang.String[] args)
          main() For testing and sandboxing.
 
Methods inherited from class org.osesb.scheduledjobs.databasepoller.SelectAndCheckpointProcessedRowsTableSetAdapter
doCustomProcessing
 
Methods inherited from class org.osesb.connectors.jdbc.SelectStatementTableSetAdapter
processStatement, processTableSet
 
Methods inherited from class org.osesb.connectors.jdbc.TableSetAdapter
getParentTableSet, logMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectAndDeleteProcessedRowsTableSetAdapter

public SelectAndDeleteProcessedRowsTableSetAdapter(TableSet parentTableSet,
                                                   TableSetAdapterConfiguration tableSetAdapterConfiguration)
                                            throws java.lang.Exception
Creates a new instance of SelectAndDeleteProcessedRowsTableSetAdapter.

Parameters:
parentTableSet - The TableSet that owns this TableSetAdapter.
Throws:
java.lang.Exception - if constructed with a null TableSet.
Method Detail

checkpointProcessedRows

public java.lang.Object[] checkpointProcessedRows(java.sql.ResultSet rs)
                                           throws java.lang.Exception
Delete processed rows using a scrollable, updatable ResultSet.

checkpointProcessedRows() DOES NOT release TableSet and JDBC resources; it is the responsibility of the caller to invoke TableSet#releaseConnection().

Overrides:
checkpointProcessedRows in class SelectAndCheckpointProcessedRowsTableSetAdapter
Parameters:
rs - The ResultSet that was returned by processTableSet().
Returns:
the result of SQL processing of as an Object[] where the first element of the array is an Integer for the number of rows that were deleted.
Throws:
java.lang.Exception - if there is a problem with processing the TableSet SQL.

main

public static void main(java.lang.String[] args)
main() For testing and sandboxing.

Parameters:
args - commandline arguments