Class LogMinerDmlEntryImplAdapter


  • @ProtoAdapter(LogMinerDmlEntryImpl.class)
    public class LogMinerDmlEntryImplAdapter
    extends Object
    An Infinispan ProtoStream adapter to marshall LogMinerDmlEntryImpl instances. This class defines a factory for creating LogMinerDmlEntryImpl instances 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 LogMinerDmlEntryImpl {
             required int32 operation = 1;
             string newValues = 2;
             string oldValues = 3;
             required string name = 4;
             required string owner = 5;
         }
     
    Author:
    Chris Cranford
    • Field Detail

      • NULL_VALUE_SENTINEL

        private static final String NULL_VALUE_SENTINEL
        Arrays cannot be serialized with null values and so we use a sentinel value to mark a null element in an array.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LogMinerDmlEntryImplAdapter

        public LogMinerDmlEntryImplAdapter()
    • Method Detail

      • factory

        @ProtoFactory
        public LogMinerDmlEntryImpl factory​(int operation,
                                            String[] newValues,
                                            String[] oldValues,
                                            String name,
                                            String owner)
        A ProtoStream factory that creates a LogMinerDmlEntryImpl instance from field values.
        Parameters:
        operation - the operation
        newValues - string-array of the after state values
        oldValues - string-array of the before state values
        name - name of the table
        owner - tablespace or schema that owns the table
        Returns:
        the constructed LogMinerDmlEntryImpl instance
      • getOperation

        @ProtoField(number=1,
                    required=true)
        public int getOperation​(LogMinerDmlEntryImpl entry)
        A ProtoStream handler to extract the entry field from the LogMinerDmlEntryImpl.
        Parameters:
        entry - the entry instance, must not be null
        Returns:
        the operation code, never null
      • getNewValues

        @ProtoField(number=2)
        public String[] getNewValues​(LogMinerDmlEntryImpl entry)
        A ProtoStream handler to extract the newValues object-array from the LogMinerDmlEntryImpl.
        Parameters:
        entry - the entry instance, must not be null
        Returns:
        a string-array of all the after state
      • getOldValues

        @ProtoField(number=3)
        public String[] getOldValues​(LogMinerDmlEntryImpl entry)
        A ProtoStream handler to extract teh oldValues object-array from the LogMinerDmlEntryImpl.
        Parameters:
        entry - the entry instance, must not be null
        Returns:
        a string-array of all the before state
      • getName

        @ProtoField(number=4,
                    required=true)
        public String getName​(LogMinerDmlEntryImpl entry)
        A ProtoStream handler to extract the objectName from the LogMinerDmlEntryImpl.
        Parameters:
        entry - the entry instance, must not be null
        Returns:
        the table name
      • getOwner

        @ProtoField(number=5,
                    required=true)
        public String getOwner​(LogMinerDmlEntryImpl entry)
        A ProtoStream handler to extract the objectOwner from the LogMinerDmlEntryImpl.
        Parameters:
        entry - the entry instance, must not be null
        Returns:
        the tablespace name
      • objectArrayToStringArray

        private String[] objectArrayToStringArray​(Object[] values)
        Converts the provided object-array to a string-array. This conversion is safe since LogMinerDmlParser always populates the object-array with strings. Any element in the array that is null will be initialized as NULL_VALUE_SENTINEL.
        Parameters:
        values - the values array to be converted, should never be null
        Returns:
        the values array converted to a string-array
      • stringArrayToObjectArray

        private Object[] stringArrayToObjectArray​(String[] values)
        Converters the provided string-array to an object-array. This conversion is safe since Strings are also Objects. This method also is responsible for the conversion of NULL_VALUE_SENTINEL sentinel values to null.
        Parameters:
        values - the values array to eb converted, should never be null
        Returns:
        the values array converted to an object-array