Class TransactionAdapter
java.lang.Object
io.debezium.connector.oracle.logminer.processor.infinispan.marshalling.TransactionAdapter
An Infinispan ProtoStream adapter for marshalling a
InfinispanTransaction instance.
This class defines a factory for creating InfinispanTransaction instances 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 -
Method Summary
Modifier and TypeMethodDescriptionfactory(String transactionId, String scn, String changeTime, int numberOfEvents, String userName, Integer redoThreadId) A ProtoStream factory that creates aInfinispanTransactioninstance from field values.getChangeTime(InfinispanTransaction transaction) A ProtoStream handler to extract thechangeTimefield from theInfinispanTransaction.intgetNumberOfEvents(InfinispanTransaction transaction) A ProtoStream handler to extract theeventIdsfield from theInfinispanTransaction.getRedoThreadId(InfinispanTransaction transaction) A ProtoStream handler to extract theredoThreadIdfield from theInfinispanTransaction.getScn(InfinispanTransaction transaction) A ProtoStream handler to extract thestartScnfield from theInfinispanTransaction.getTransactionId(InfinispanTransaction transaction) A ProtoStream handler to extract thetransactionIdfield from theInfinispanTransaction.getUserName(InfinispanTransaction transaction) A ProtoStream handler to extract theuserNamefield from theInfinispanTransaction.
-
Constructor Details
-
TransactionAdapter
public TransactionAdapter()
-
-
Method Details
-
factory
@ProtoFactory public InfinispanTransaction factory(String transactionId, String scn, String changeTime, int numberOfEvents, String userName, Integer redoThreadId) A ProtoStream factory that creates aInfinispanTransactioninstance from field values.- Parameters:
transactionId- the transaction identifierscn- the starting system change number of the transactionchangeTime- the starting time of the transactionnumberOfEvents- the number of events in the transactionuserName- the user nameredoThreadId- the redo thread id- Returns:
- the constructed Transaction instance
-
getTransactionId
@ProtoField(number=1, required=true) public String getTransactionId(InfinispanTransaction transaction) A ProtoStream handler to extract thetransactionIdfield from theInfinispanTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- the transaction identifier, never
null
-
getScn
A ProtoStream handler to extract thestartScnfield from theInfinispanTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- the starting system change number, never
null
-
getChangeTime
A ProtoStream handler to extract thechangeTimefield from theInfinispanTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- the starting time of the transaction, never
null
-
getNumberOfEvents
@ProtoField(number=4, defaultValue="0") public int getNumberOfEvents(InfinispanTransaction transaction) A ProtoStream handler to extract theeventIdsfield from theInfinispanTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- the number of events in the transaction
-
getUserName
A ProtoStream handler to extract theuserNamefield from theInfinispanTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- the username associated with the transaction
-
getRedoThreadId
A ProtoStream handler to extract theredoThreadIdfield from theInfinispanTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- the redo thread id
-