public class JDBCEITransport extends EITransport implements JDBCEIConfigFieldsIfc, Callback, StateBufferSaveable, StateFreezable
dataReceiver, fdChecked, filedataReceiver, fileduplicateCheck, fileToProcess, inputCount, lockFile, movedFile, node, pollingInterval, processing, processingData
DBTABLE, DELETEROWS, FILTERBYID, FILTERBYTIME, FILTERCOLUMN, FILTERTYPE, ORDERBY, QUERYINTERVAL, RULESFILE, WHEREEXPR, WHEREEXPRCOUNT
DBCONNECT, DBPWORD, DBTYPE, DBUSER, ORACLE, ORACONNECT
Constructor and Description |
---|
JDBCEITransport(EINode node,
JDBCEIRecordFactory rFactory,
JDBCConnectionFactoryIfc cFactory,
java.lang.String query,
int fType,
java.lang.String delete)
Construct a new JDBCEITransport.
|
JDBCEITransport(EINode node,
JDBCEIRecordFactory rFactory,
JDBCConnectionFactoryIfc cFactory,
java.lang.String query,
int fType,
java.lang.String delete,
DataReceiverIfc receiver)
Construct a new JDBCEITransport.
|
Modifier and Type | Method and Description |
---|---|
void |
callback()
This method is called when the receiving Object has
performed a certain event, and wants to notify the
implementor that the event has occurred.
|
protected void |
close(boolean commit)
Close the connection to the database.
|
protected java.sql.Connection |
connect()
Attempt to establish the connection with the database.
|
void |
freezeState(Callback freezeCallback)
Used by the StateManager thread to halt the processing while
the state of the node is saved.
|
DCFieldContainer[] |
getBulkData()
Not used, since data is pushed to the DataReceiver.
|
DCFieldContainer |
getData()
Not used, since data is pushed to the DataReceiver.
|
boolean |
isDataAvailable()
Not used, since the data is pushed to the DataReceiver.
|
boolean |
isHealthy()
This method is used to check if the transport if fully functional.
|
protected boolean |
isRunning()
Indicates whether this JDBCEITransport is running
|
void |
restoreState(StateBuffer buffer)
Restore the Object's state from the given buffer.
|
void |
run()
This is the transport's processing loop.
|
void |
saveState(StateBuffer buffer)
Save the Object's state to the given buffer.
|
protected void |
setRunning(boolean run)
Sets the boolean indicating whether the transport is running
|
void |
shutdown()
Shuts the transport down cleanly.
|
void |
unfreezeState()
Used by the StateManager thread to resume the processing
previously halted.
|
getDataReceiver, getDubCheckObj, getDupCheckFlag, getFileBulkData, getFileData, getFileDataReceiver, getMovedFileStatus, getNode, getPollingInterval, handleRejectOfFile, incrementIn, incrementIn, isEndOfFile, isFileDataAvailable, isProcessing, isProcessingData, isStartOfFile, openInputFile, rejectFile, setCountsSuspect, setDataReceiver, setFileDataReceiver, setFileToProcess, setMovedFileStatus, setNode, setPollingInterval, setProcessing
public JDBCEITransport(EINode node, JDBCEIRecordFactory rFactory, JDBCConnectionFactoryIfc cFactory, java.lang.String query, int fType, java.lang.String delete)
node
- Reference to the node using this transportrFactory
- Factory used to create the EI recordscFactory
- Factory used to create the database connectionquery
- The query statement to be used to select specific
rows from the databasefType
- Indicates whether query is time-based or based upon
a unique identifier columndelete
- The delete statement to be used to delete rows
from the database once they have been processedpublic JDBCEITransport(EINode node, JDBCEIRecordFactory rFactory, JDBCConnectionFactoryIfc cFactory, java.lang.String query, int fType, java.lang.String delete, DataReceiverIfc receiver)
node
- Reference to the node using this transportrFactory
- Factory used to create the EI recordscFactory
- Factory used to create the database connectionquery
- The query statement to be used to select specific
rows from the databasefType
- Indicates whether query is time-based or based upon
a unique identifier columndelete
- The delete statement to be used to delete rows
from the database once they have been processedrecevier
- The transport's DataReceiverpublic void run()
run
in interface java.lang.Runnable
run
in class EITransport
public void shutdown()
shutdown
in interface DCTransport
shutdown
in class EITransport
public boolean isHealthy()
isHealthy
in interface DCTransport
isHealthy
in class EITransport
public boolean isDataAvailable()
isDataAvailable
in interface DataProviderIfc
isDataAvailable
in class EITransport
public DCFieldContainer getData()
getData
in interface DataProviderIfc
getData
in class EITransport
public DCFieldContainer[] getBulkData()
getBulkData
in interface DataProviderIfc
getBulkData
in class EITransport
public void callback()
Callback
public void saveState(StateBuffer buffer) throws StateException
saveState
in interface StateBufferSaveable
buffer
- Buffer for writingStateException
public void restoreState(StateBuffer buffer) throws StateException
restoreState
in interface StateBufferSaveable
buffer
- Buffer for readingStateException
public void freezeState(Callback freezeCallback)
freezeState
in interface StateFreezable
freezeCallback
- Object to notify when the processing has
been frozen.public void unfreezeState()
unfreezeState
in interface StateFreezable
protected void setRunning(boolean run)
protected boolean isRunning()
protected java.sql.Connection connect() throws java.sql.SQLException
java.sql.SQLException
protected void close(boolean commit)
commit
- true
, if any pending transactions should
be commited prior to closing the database connection.