Class RetrieveJournal
java.lang.Object
io.debezium.ibmi.db2.journal.retrieve.RetrieveJournal
based on the work of Stanley Vong see
https://www.ibm.com/docs/en/i/7.5?topic=ssw_ibm_i_75/apis/QJORJRNE.html
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ParameterListBuilder(package private) RetrieveConfigprivate final SimpleDateFormatprivate EntryHeaderprivate static final EntryHeaderDecoderprivate static final FirstHeaderDecoderprivate FirstHeaderprivate final ReceiverPaginationprivate static final org.slf4j.Loggerprivate intprivate byte[]private JournalProcessedPositionprivate static final RetrievalCriteria.JournalCode[]private static final RetrievalCriteria.JournalEntryType[]private long -
Constructor Summary
ConstructorsConstructorDescriptionRetrieveJournal(RetrieveConfig config, JournalInfoRetrieval journalRetrieval) -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanalreadyProcessed(JournalProcessedPosition position, EntryHeader entryHeader) <T> Tdecode(JournalEntryDeocder<T> decoder) voidvoiddumpEntryToFile(File path) booleanprivate StringgetFullAS400MessageText(AS400Message message) intlongbooleanhasData()booleanprivate booleanreThrowIfFatal(JournalProcessedPosition retrievePosition, ServiceProgramCall spc, JournalProcessedPosition latestJournalPosition, ParameterListBuilder builder) booleanretrieveJournal(JournalProcessedPosition previousPosition) retrieves a block of journal databooleanretrieveJournal(JournalProcessedPosition previousPosition, PositionRange range) voidsetOutputData(byte[] b, FirstHeader header, JournalProcessedPosition position) (package private) booleanprivate voidprivate static voidupdatePosition(JournalProcessedPosition p, EntryHeader entryHeader)
-
Field Details
-
log
private static final org.slf4j.Logger log -
REQUIRED_JOURNAL_CODES
-
REQURED_ENTRY_TYPES
-
firstHeaderDecoder
-
entryHeaderDecoder
-
dateFormatter
-
journalReceivers
-
builder
-
config
RetrieveConfig config -
outputData
private byte[] outputData -
header
-
entryHeader
-
offset
private int offset -
position
-
totalTransferred
private long totalTransferred
-
-
Constructor Details
-
RetrieveJournal
-
-
Method Details
-
retrieveJournal
retrieves a block of journal data- Parameters:
previousPosition-- Returns:
- true if the journal was read successfully false if there was some problem reading the journal
- Throws:
Exception- CURAVLCHN - returns only available journals CURCHAIN will work though journals that have happened but may no longer be available if the journal is no longer available we need to capture this and log an error as we may have missed data
-
retrieveJournal
public boolean retrieveJournal(JournalProcessedPosition previousPosition, PositionRange range) throws Exception - Throws:
Exception
-
reThrowIfFatal
private boolean reThrowIfFatal(JournalProcessedPosition retrievePosition, ServiceProgramCall spc, JournalProcessedPosition latestJournalPosition, ParameterListBuilder builder) throws InvalidPositionException, InvalidJournalFilterException, RetrieveJournal.RetrieveJournalException -
shouldLimitRange
boolean shouldLimitRange() -
getFullAS400MessageText
-
getPosition
- Returns:
- the current position or the next offset for fetching data when the end of data is reached
-
setOutputData
-
hasData
public boolean hasData() -
futureDataAvailable
public boolean futureDataAvailable() -
nextEntry
public boolean nextEntry() -
updateOffsetFromContinuation
private void updateOffsetFromContinuation() -
alreadyProcessed
-
updatePosition
-
getEntryHeader
-
dumpEntry
public void dumpEntry() -
getOffset
public int getOffset() -
decode
- Throws:
Exception
-
dumpEntryToFile
-
getFirstHeader
-
getTotalTransferred
public long getTotalTransferred()
-