Class TransactionAdapter


  • @ProtoAdapter(Transaction.class)
    public class TransactionAdapter
    extends Object
    An Infinispan ProtoStream adapter for marshalling a Transaction instance. This class defines a factory for creating Transaction 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 Detail

      • TransactionAdapter

        public TransactionAdapter()
    • Method Detail

      • factory

        @ProtoFactory
        public Transaction factory​(String transactionId,
                                   String scn,
                                   String changeTime,
                                   List<LogMinerEvent> events,
                                   Set<Long> hashes)
        A ProtoStream factory that creates a Transaction instance from field values.
        Parameters:
        transactionId - the transaction identifier
        scn - the starting system change number of the transaction
        changeTime - the starting time of the transaction
        events - list of events that are part of the transaction
        hashes - 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 the transactionId field from the Transaction.
        Parameters:
        transaction - the transaction instance, must not be null
        Returns:
        the transaction identifier, never null
      • getScn

        @ProtoField(number=2,
                    required=true)
        public String getScn​(Transaction transaction)
        A ProtoStream handler to extract the startScn field from the Transaction.
        Parameters:
        transaction - the transaction instance, must not be null
        Returns:
        the starting system change number, never null
      • getChangeTime

        @ProtoField(number=3,
                    required=true)
        public String getChangeTime​(Transaction transaction)
        A ProtoStream handler to extract the changeTime field from the Transaction.
        Parameters:
        transaction - the transaction instance, must not be null
        Returns:
        the starting time of the transaction, never null
      • getEvents

        @ProtoField(number=4)
        public List<LogMinerEvent> getEvents​(Transaction transaction)
        A ProtoStream handler to extract the events field from the Transaction.
        Parameters:
        transaction - the transaction instance, must not be null
        Returns:
        list of events within the transaction
      • getHashes

        @ProtoField(number=5)
        public Set<Long> getHashes​(Transaction transaction)
        A ProtoStream handler to extract the hashes field from the Transaction.
        Parameters:
        transaction - the transaction instance, must not be null
        Returns:
        list of event hashes witin the transaction