public class JDBCOITransport extends OITransport implements StateBufferSaveable
dataProvider, filedataProvider, node, pollingInterval| Constructor and Description |
|---|
JDBCOITransport(OINode oinode,
JDBCConnectionFactoryIfc cFactory,
com.nt.udc.admin.FieldDescriptor[] tblInfo,
com.nt.udc.admin.FieldDescriptor[] lobInfo,
java.lang.String catalog,
java.lang.String schema,
java.util.List<java.util.List<java.lang.String>> reservedNameList,
boolean badRecordFormat)
Construct a new JDBCOITransport.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
close(boolean commit)
Close the connection to the database.
|
protected void |
connect()
Attempt to establish the connection with the database.
|
void |
dataIsAvailable()
This method allows the transport's DataProvider to tell the transport
that data is waiting to be 'picked up'.
|
void |
handleLostConnection(java.lang.String mesg) |
boolean |
isBadRecordFormat() |
boolean |
isConnected()
Indicates whether this JDBCOITransport is connected to the database
|
boolean |
isDataAvailable()
Indicates whether data is available from the transport's DataProvider
|
boolean |
isHealthy()
Indicates whether the transport is fully functional
|
boolean |
isProcessingData()
Indicates whether this JDBCOITransport is currently processing data
|
boolean |
isRunning()
Indicates whether this JDBCOITransport is running
|
void |
processData(DCFieldContainer record)
Accept an
OIRecord to be written to the database. |
void |
processData(DCFieldContainer[] records)
Accept some
OIRecord objects to be written to the database. |
protected void |
reconnect()
Attempt to re-establish the database connection.
|
void |
restoreState(StateBuffer buffer)
Restore the Object's state from the given buffer.
|
void |
run()
This method is used when the OITransport runs within its own thread.
|
void |
saveState(StateBuffer buffer)
Save the Object's state to the given buffer.
|
void |
setBadRecordFormat(boolean badRecordFormat) |
void |
setConnectionFactory(JDBCConnectionFactoryIfc factory)
Set the object used to provide this transport with a connection
to the database.
|
protected void |
setProcessingData(boolean value)
Sets the boolean indicating whether the transport is currently
processing data.
|
protected void |
setRunning(boolean run)
Sets the boolean which indicates whether the transport is running
|
void |
shutdown()
Stop the transport.
|
fileDataIsAvailable, getDataProvider, getFileDataProvider, getNode, getPollingInterval, getRealNarsOut, incrementOut, processEndOfFileData, processFileData, processFileData, processRejectFile, processStartOfFileData, setDataProvider, setFileDataProvider, setNode, setPollingInterval, setTransactionIDpublic JDBCOITransport(OINode oinode, JDBCConnectionFactoryIfc cFactory, com.nt.udc.admin.FieldDescriptor[] tblInfo, com.nt.udc.admin.FieldDescriptor[] lobInfo, java.lang.String catalog, java.lang.String schema, java.util.List<java.util.List<java.lang.String>> reservedNameList, boolean badRecordFormat) throws NodeStartException
oinode - Reference to the OINode containing the transportcFactory - A connection factory used to provide the transport
with a java.sql.Connection objecttblInfo - An array of FieldDescriptor objects that define
the relationship between record attributes and
DB tables/columns. The 'tag' member of the
FieldDescriptor object is expected to be in
the format of 'DB_table.DB_column'lobInfo - An array of FieldDescriptor objects that contains information
regarding which of the record attributes are LOB type.catalog - The DB catalog name, for columns validationschema - The DB schema pattern, for columns validationreservedNameList - NodeStartExceptionpublic void dataIsAvailable()
getData() method and process it via the receiver's
processData() method.dataIsAvailable in interface DataReceiverIfcdataIsAvailable in class OITransportpublic void processData(DCFieldContainer record)
OIRecord to be written to the database. This
method will block until the data can be successfully written.processData in interface DataReceiverIfcprocessData in class OITransportrecord - OIRecord containing the data.public void processData(DCFieldContainer[] records) throws NodeProcessingException
OIRecord objects to be written to the database.
This method will block until the data can be successfully written.processData in interface DataReceiverIfcrecords - An array of OIRecord objects.NodeProcessingExceptionpublic void run()
run in interface java.lang.Runnablerun in class OITransportpublic void shutdown()
shutdown in interface DCTransportshutdown in class OITransportpublic void saveState(StateBuffer buffer) throws StateException
saveState in interface StateBufferSaveablebuffer - Buffer for writingStateExceptionpublic void restoreState(StateBuffer buffer) throws StateException
restoreState in interface StateBufferSaveablebuffer - Buffer for readingStateExceptionpublic void setConnectionFactory(JDBCConnectionFactoryIfc factory)
factory - A JDBCConnectionFactoryIfc object that
knows how to connect to the desired database and can
provide this transport with a
java.sql.Connection object for
communicating with that database.public boolean isConnected()
public boolean isDataAvailable()
public boolean isRunning()
protected void setRunning(boolean run)
public boolean isProcessingData()
protected void setProcessingData(boolean value)
public boolean isHealthy()
isHealthy in interface DCTransportisHealthy in class OITransportprotected void connect()
throws java.sql.SQLException
java.sql.SQLExceptionprotected void close(boolean commit)
commit - true, if any pending transactions should
be commited prior to closing the database connection.protected void reconnect()
public void handleLostConnection(java.lang.String mesg)
public boolean isBadRecordFormat()
public void setBadRecordFormat(boolean badRecordFormat)