Class TransactionAdapter
- java.lang.Object
-
- io.debezium.connector.oracle.logminer.processor.infinispan.marshalling.TransactionAdapter
-
@ProtoAdapter(Transaction.class) public class TransactionAdapter extends Object
An Infinispan ProtoStream adapter for marshalling aTransactioninstance. This class defines a factory for creatingTransactioninstances when hydrating a transaction record from the protocol buffer datastore as well as field handlers to extract values from a given transaction instance for serializing the instance to a protocol buffer stream.- Author:
- Chris Cranford
-
-
Constructor Summary
Constructors Constructor Description TransactionAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Transactionfactory(String transactionId, String scn, String changeTime, List<LogMinerEvent> events, Set<Long> hashes)A ProtoStream factory that creates aTransactioninstance from field values.StringgetChangeTime(Transaction transaction)A ProtoStream handler to extract thechangeTimefield from theTransaction.List<LogMinerEvent>getEvents(Transaction transaction)A ProtoStream handler to extract theeventsfield from theTransaction.Set<Long>getHashes(Transaction transaction)A ProtoStream handler to extract thehashesfield from theTransaction.StringgetScn(Transaction transaction)A ProtoStream handler to extract thestartScnfield from theTransaction.StringgetTransactionId(Transaction transaction)A ProtoStream handler to extract thetransactionIdfield from theTransaction.
-
-
-
Method Detail
-
factory
@ProtoFactory public Transaction factory(String transactionId, String scn, String changeTime, List<LogMinerEvent> events, Set<Long> hashes)
A ProtoStream factory that creates aTransactioninstance from field values.- Parameters:
transactionId- the transaction identifierscn- the starting system change number of the transactionchangeTime- the starting time of the transactionevents- list of events that are part of the transactionhashes- list of hashes that represent each event in the transaction- Returns:
- the constructed Transaction instance
-
getTransactionId
@ProtoField(number=1, required=true) public String getTransactionId(Transaction transaction)A ProtoStream handler to extract thetransactionIdfield from theTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- the transaction identifier, never
null
-
getScn
@ProtoField(number=2, required=true) public String getScn(Transaction transaction)A ProtoStream handler to extract thestartScnfield from theTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- the starting system change number, never
null
-
getChangeTime
@ProtoField(number=3, required=true) public String getChangeTime(Transaction transaction)A ProtoStream handler to extract thechangeTimefield from theTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- the starting time of the transaction, never
null
-
getEvents
@ProtoField(number=4) public List<LogMinerEvent> getEvents(Transaction transaction)
A ProtoStream handler to extract theeventsfield from theTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- list of events within the transaction
-
getHashes
@ProtoField(number=5) public Set<Long> getHashes(Transaction transaction)
A ProtoStream handler to extract thehashesfield from theTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- list of event hashes witin the transaction
-
-