Class TransactionAdapter
- java.lang.Object
-
- io.debezium.connector.oracle.logminer.processor.infinispan.marshalling.TransactionAdapter
-
@ProtoAdapter(InfinispanTransaction.class) public class TransactionAdapter extends Object
An Infinispan ProtoStream adapter for marshalling aInfinispanTransactioninstance. This class defines a factory for creatingInfinispanTransactioninstances 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 InfinispanTransactionfactory(String transactionId, String scn, String changeTime, int numberOfEvents, String userName)A ProtoStream factory that creates aInfinispanTransactioninstance from field values.StringgetChangeTime(InfinispanTransaction transaction)A ProtoStream handler to extract thechangeTimefield from theInfinispanTransaction.intgetNumberOfEvents(InfinispanTransaction transaction)A ProtoStream handler to extract theeventIdsfield from theInfinispanTransaction.StringgetScn(InfinispanTransaction transaction)A ProtoStream handler to extract thestartScnfield from theInfinispanTransaction.StringgetTransactionId(InfinispanTransaction transaction)A ProtoStream handler to extract thetransactionIdfield from theInfinispanTransaction.StringgetUserName(InfinispanTransaction transaction)A ProtoStream handler to extract theuserNamefield from theInfinispanTransaction.
-
-
-
Method Detail
-
factory
@ProtoFactory public InfinispanTransaction factory(String transactionId, String scn, String changeTime, int numberOfEvents, String userName)
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 name- 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
@ProtoField(number=2, required=true) public String getScn(InfinispanTransaction transaction)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
@ProtoField(number=3, required=true) public String getChangeTime(InfinispanTransaction transaction)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
@ProtoField(number=5) public String getUserName(InfinispanTransaction transaction)
A ProtoStream handler to extract theuserNamefield from theInfinispanTransaction.- Parameters:
transaction- the transaction instance, must not benull- Returns:
- the username associated with the transaction
-
-