org.openadaptor.adaptor.jdbc.sybase
Class SybaseBatchSource
java.lang.Object
org.openadaptor.adaptor.SimpleComponent
org.openadaptor.adaptor.AbstractReader
org.openadaptor.adaptor.AbstractSimpleSource
org.openadaptor.adaptor.jdbc.JdbcSource
org.openadaptor.adaptor.jdbc.sybase.SybaseSource
org.openadaptor.adaptor.jdbc.sybase.SybaseBatchSource
- All Implemented Interfaces:
- java.lang.Runnable, CallbackProvider, Component, Configurable, IbafTransactionalResource, Source, DOMessageReaderDelegate
public class SybaseBatchSource
- extends SybaseSource
Sybase-specific JdbcSource
- Author:
- Fred Perry, Steve Howe
Field Summary |
java.lang.String |
DO_TYPE_NAME
default DataObject type name used for the DataObjects that
are created from the batch select |
(package private) static org.apache.log4j.Logger |
log
|
Fields inherited from class org.openadaptor.adaptor.jdbc.JdbcSource |
_batchSize, _bcgProcNamePrefix, _dbConnection, _deadlockIsFatal, _deadlockRetryDelay, _jdbcDriver, _jdbcTypeMap, _jdbcUrl, _maxDeadlockRetry, _maxNumberOfFailures, _msgServiceId, _msgServiceName, _passingProcParamNames, _password, _sqlQueryTimeout, _sqlQueryTimeoutSet, _transactionIsolationLevel, _userName, _usingSelect, DEFAULT_DOTYPE_MAP, failedEvents, sentEvents |
Fields inherited from class org.openadaptor.adaptor.AbstractReader |
_batch_size, _comment_regexps, _end_data, _file_name, _file_name_att, _header_lines, _re_compiler, _re_matcher, _reader, _rec_num, _rec_num_att, _record_regexps, _start_data, _stream_reader, _string_reader, _useAlternateDOXMLReader |
Method Summary |
protected JdbcSourceEventMessage |
getNextEvent(int msgServiceId)
Retrieves the next event from the database. |
protected JdbcSourceEventMessage |
getNextQueuedMsgStatement(int msgServiceId)
calls special proc that returns batches of result sets, with MsgTypeName
and msgId as part as the first two columns. |
void |
init(java.lang.String name,
java.util.Properties props,
java.lang.String prefix,
Controller controller)
initialise using properties |
protected void |
setEventMessageStatus(JdbcSourceEventMessage theEvent,
java.lang.String messageStatus,
java.lang.String failedMessage)
Sets the status of a particular event on the BCG_MsgQueue table. |
protected void |
setEventMessageStatus(JdbcSourceEventMessage theEvent,
java.lang.String messageStatus,
java.lang.String failedMessage,
int numFailed)
Sets the status of a particular event on the BCG_MsgQueue table. |
protected void |
setEventMessageStatus(java.lang.String msgId,
java.lang.String messageStatus,
java.lang.String failedMessage)
Sets the status of a particular event on the BCG_MsgQueue table. |
void |
sourceStartUp()
Called when the source starts. |
void |
txnCommitWithExceptions(Message m)
Called by the controller when a txnCommit is requested by the Source of a message
In this case not all of the data in the message was successfully processed, you
can get an array of Exceptions using Message.getExceptions, this corresponds
to the array of data objects. |
Methods inherited from class org.openadaptor.adaptor.jdbc.JdbcSource |
getBcgProcNamePrefix, getDeadlockIsFatal, getDeadlockRetryDelay, getJdbcConnection, getJdbcDriver, getJdbcUrl, getMaxDeadlockRetry, getMaxNumberOfFailures, getMsgServiceName, getPassword, getSqlQueryTimeout, getTransactionIsolationLevel, getUserName, isPassingProcParamNames, isUsingSelect, jdbcTxnBegin, jdbcTxnCommit, jdbcTxnRollback, setBatchSize, setBcgProcNamePrefix, setDeadlockIsFatal, setDeadlockRetryDelay, setJdbcConnection, setJdbcDriver, setJDBCTypeMap, setJdbcUrl, setMaxDeadlockRetry, setMaxNumberOfFailures, setMsgServiceName, setPassingProcParamNames, setPassword, setSqlQueryTimeout, setTransactionIsolationLevel, setUserName, setUsingSelect, sourceCleanUp, sourcePoll, txnBegin, txnCommit, txnRollback |
Methods inherited from class org.openadaptor.adaptor.AbstractSimpleSource |
getPollPeriod, getSourceType, getStatus, processMessage, processMessage, processMessageWithTxn, run, runCallback, runListen, runPoll, setMaxCallsPerPoll, setPollPeriod, setSourceType, sourceHasTransactionRecovery, sourceListen, sourcePause, sourceProcess, sourceProcess, sourceProcess, sourceResume, sourceStop, sourceTransactionBegin, sourceTransactionProcess |
Methods inherited from class org.openadaptor.adaptor.AbstractReader |
getDOStreamReader, getDOStringReader, getLineNumberReader, getReader, getXMLString, isReaderEOF, isWhitespace, nextDataObjectArray, readDOStreamReader, readDOStringReader, readDOXML, readDOXMLAlternate, readerCleanUp, readerEOF, readerException, readerStartUp, setDOStringReader, setHeaderLines, setReader |
Methods inherited from class org.openadaptor.adaptor.SimpleComponent |
addCallback, canUpdateWhileRunning, cleanUp, customControl, didReceiveMessage, getAsProperties, getCallbackManager, getCurrentState, getCustomControlProperties, getLastUID, getName, getProperty, getProperty, getPropsPrefix, getRequestedState, getSecurityManager, getTextEncoding, getXMLFormatter, notifyEvent, pause, removeCallback, resume, setCallbackManager, setCallbackManager, setCurrentState, setFromProperties, setFromProperties, setFromResource, setName, setPropsPrefix, setRequestedState, terminate, txnRollback, waitForRequestedStateChange |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
static org.apache.log4j.Logger log
DO_TYPE_NAME
public java.lang.String DO_TYPE_NAME
- default DataObject type name used for the DataObjects that
are created from the batch select
SybaseBatchSource
public SybaseBatchSource()
init
public void init(java.lang.String name,
java.util.Properties props,
java.lang.String prefix,
Controller controller)
throws IbafException
- initialise using properties
- Specified by:
init
in interface Component
- Overrides:
init
in class SybaseSource
- Parameters:
name
- The name to be given to the componentprops
- Properties objectprefix
- Prefix string to search for propertiescontroller
- The component's controller object
- Throws:
IbafException
- if initialization fails- See Also:
Controller
,
SimpleController
sourceStartUp
public void sourceStartUp()
throws IbafException
- Called when the source starts. If the user has supplied the 'InitialisationProcedure'
configuration parameter this stored procedure will be called.
- Overrides:
sourceStartUp
in class JdbcSource
- Throws:
IbafException
txnCommitWithExceptions
public void txnCommitWithExceptions(Message m)
throws IbafException
- Description copied from class:
SimpleComponent
- Called by the controller when a txnCommit is requested by the Source of a message
In this case not all of the data in the message was successfully processed, you
can get an array of Exceptions using Message.getExceptions, this corresponds
to the array of data objects.
This default implementation must be overridden to support this behaviour
- Specified by:
txnCommitWithExceptions
in interface IbafTransactionalResource
- Overrides:
txnCommitWithExceptions
in class SimpleComponent
- Throws:
IbafException
- If fails to commit the transaction- See Also:
Controller.txnCommit(Source)
getNextEvent
protected JdbcSourceEventMessage getNextEvent(int msgServiceId)
throws java.sql.SQLException,
DeadlockException
- Description copied from class:
JdbcSource
- Retrieves the next event from the database.
- Overrides:
getNextEvent
in class JdbcSource
- Throws:
java.sql.SQLException
- if something goes wrong
DeadlockException
getNextQueuedMsgStatement
protected JdbcSourceEventMessage getNextQueuedMsgStatement(int msgServiceId)
throws java.sql.SQLException,
DeadlockException
- calls special proc that returns batches of result sets, with MsgTypeName
and msgId as part as the first two columns.
- Overrides:
getNextQueuedMsgStatement
in class SybaseSource
- Throws:
java.sql.SQLException
- if something goes wrong.
DeadlockException
setEventMessageStatus
protected void setEventMessageStatus(JdbcSourceEventMessage theEvent,
java.lang.String messageStatus,
java.lang.String failedMessage)
throws java.sql.SQLException,
DeadlockException
- Sets the status of a particular event on the BCG_MsgQueue table.
- Overrides:
setEventMessageStatus
in class SybaseSource
- Throws:
java.sql.SQLException
- if something goes wrong.
DeadlockException
setEventMessageStatus
protected void setEventMessageStatus(JdbcSourceEventMessage theEvent,
java.lang.String messageStatus,
java.lang.String failedMessage,
int numFailed)
throws java.sql.SQLException,
DeadlockException
- Sets the status of a particular event on the BCG_MsgQueue table.
- Throws:
java.sql.SQLException
- if something goes wrong.
DeadlockException
setEventMessageStatus
protected void setEventMessageStatus(java.lang.String msgId,
java.lang.String messageStatus,
java.lang.String failedMessage)
throws java.sql.SQLException,
DeadlockException
- Sets the status of a particular event on the BCG_MsgQueue table.
- Throws:
java.sql.SQLException
- if something goes wrong.
DeadlockException