public class SimpleJournalHandler extends java.lang.Object implements JournalHandler
Constructor and Description |
---|
SimpleJournalHandler(java.lang.String journalTable,
java.lang.String query,
int batchSize,
Publisher publisher,
JournalStrategy strategy) |
Modifier and Type | Method and Description |
---|---|
int |
getBatchSize() |
java.lang.String |
getJournalTable() |
JournalStrategy |
getStrategy()
Establish the journal strategy:
DELETE - removes imported rows from journal table
WINDOW - memorizes
|
java.lang.String |
getTargetQuery()
The query to retrieve changed data can references columns from journal
table as named parameters:
|
void |
publish(Data data)
Publishes captured data (like writing a file or publishing to a kafka
queue).
|
public SimpleJournalHandler(java.lang.String journalTable, java.lang.String query, int batchSize, Publisher publisher, JournalStrategy strategy) throws ConfigurationException
journalTable
- journal table's namequery
- query for data retrievalbatchSize
- number of rows per batchpublisher
- Publisher
objectstrategy
- journal strategyConfigurationException
- invalid parameterspublic java.lang.String getJournalTable()
getJournalTable
in interface JournalHandler
public int getBatchSize()
getBatchSize
in interface JournalHandler
public java.lang.String getTargetQuery()
JournalHandler
The query to retrieve changed data can references columns from journal table as named parameters:
select * from mytable where pk = :pk
getTargetQuery
in interface JournalHandler
public void publish(Data data) throws PublishException
JournalHandler
publish
in interface JournalHandler
data
- retrieved data (see Data
})PublishException
- failed to publish retrieved datapublic JournalStrategy getStrategy()
JournalHandler
getStrategy
in interface JournalHandler