Class LogMinerEventAdapter


  • @ProtoAdapter(LogMinerEvent.class)
    public class LogMinerEventAdapter
    extends Object
    An Infinispan ProtoStream adapter to marshall LogMinerEvent instances and its subclasses. This class defines a factory for creating LogMinerEvent instances and its subclasses for when hydrating records from the persisted datastore as well as field handlers to extract instance values to be marshalled to the protocol buffer stream. The underlying protocol buffer record consists of the following structure:
         message LogMinerEvent {
              required int32 eventType = 1;
              required string scn = 2;
              required string tableId = 3;
              required string rowId = 4;
              required object rsId = 5;
              required string changeTime = 6;
              LogMinerDmlEntryImpl entry = 7;
              string columnName = 8;
              boolean binary = 9;
              string data = 10;
         }
     
    Author:
    Chris Cranford
    • Constructor Detail

      • LogMinerEventAdapter

        public LogMinerEventAdapter()
    • Method Detail

      • factory

        @ProtoFactory
        public LogMinerEvent factory​(int eventType,
                                     String scn,
                                     String tableId,
                                     String rowId,
                                     String rsId,
                                     String changeTime,
                                     LogMinerDmlEntryImpl entry,
                                     String columnName,
                                     Boolean binary,
                                     String data)
        A ProtoStream factory that creates LogMinerEvent instances or one of its subclasses from field values.
        Parameters:
        eventType - the event type
        scn - the system change number, must not be null
        tableId - the fully-qualified table name
        rowId - the Oracle row-id the change is associated with
        rsId - the Oracle rollback segment identifier
        changeTime - the time the change occurred
        entry - the parsed SQL statement entry
        columnName - the column name for a SEL_LOB_LOCATOR event type
        binary - whether the data is binary for a SEL_LOB_LOCATOR event type
        data - the data to be written by a LOB_WRITE event type
        Returns:
        the constructed LogMinerEvent or one of its subclasses
      • getEventType

        @ProtoField(number=1,
                    required=true)
        public int getEventType​(LogMinerEvent event)
        A ProtoStream handler to extract the eventType field from the LogMinerEvent.
        Parameters:
        event - the event instance, must not be null
        Returns:
        the event type's numerical representation
      • getScn

        @ProtoField(number=2,
                    required=true)
        public String getScn​(LogMinerEvent event)
        A ProtoStream handler to extract the scn field from the LogMinerEvent.
        Parameters:
        event - the event instance, must not be null
        Returns:
        the event's system change number represented as a string
      • getTableId

        @ProtoField(number=3,
                    required=true)
        public String getTableId​(LogMinerEvent event)
        A ProtoStream handler to extract the tableId field from the LogMinerEvent.
        Parameters:
        event - the event instance, must not be null
        Returns:
        the event's table identifier represented as a string
      • getRowId

        @ProtoField(number=4,
                    required=true)
        public String getRowId​(LogMinerEvent event)
        A ProtoStream handler to extract the rowId field from the LogMinerEvent.
        Parameters:
        event - the event instance, must not be null
        Returns:
        the event's row identifier, never null
      • getRsId

        @ProtoField(number=5,
                    required=true)
        public String getRsId​(LogMinerEvent event)
        A ProtoStream handler to extract the rsId field from the LogMinerEvent.
        Parameters:
        event - the event instance, must not be null
        Returns:
        the rollback segment identifier, never null
      • getChangeTime

        @ProtoField(number=6,
                    required=true)
        public String getChangeTime​(LogMinerEvent event)
        A ProtoStream handler to extract the changeTime field from the LogMinerEvent.
        Parameters:
        event - the event instance, must not be null
        Returns:
        the time when the event occurred as a string, never null
      • getEntry

        @ProtoField(number=7)
        public LogMinerDmlEntryImpl getEntry​(LogMinerEvent event)
        A ProtoStream handler to extract the entry field from the DmlEvent and subclass types.
        Parameters:
        event - the event instance, must not be null
        Returns:
        the LogMinerDmlEntryImpl instance or null if the event type isn't related to DML events
      • getColumnName

        @ProtoField(number=8)
        public String getColumnName​(LogMinerEvent event)
        A ProtoStream handler to extract the columnName field from a SelectLobLocatorEvent type.
        Parameters:
        event - the event instance, must not be null
        Returns:
        the column name or null if the event is not a SelectLobLocatorEvent type
      • getBinary

        @ProtoField(number=9)
        public Boolean getBinary​(LogMinerEvent event)
        A ProtoStream handler to extract the binary field from a SelectLobLocatorEvent type.
        Parameters:
        event - the event instance, must not be null
        Returns:
        the binary data flag or null if the event is not a SelectLobLocatorEvent type
      • getData

        @ProtoField(number=10)
        public String getData​(LogMinerEvent event)
        A ProtoStream handler to extract the data field from a LobWriteEvent type.
        Parameters:
        event - the event instance, must not be null
        Returns:
        the data to be written for a LOB field or null if the event is not a LobWriteEvent type