java.lang.Object
io.debezium.connector.oracle.logminer.processor.infinispan.marshalling.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 Details

    • 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:
    • UNAVAILABLE_VALUE_SENTINEL

      private static final String UNAVAILABLE_VALUE_SENTINEL
      The supplied value arrays can now be populated with OracleValueConverters.UNAVAILABLE_VALUE which is simple java object. This cannot be represented as a string in the cached Infinispan record and so this sentinel is used to translate the runtime object representation to a serializable form and back during cache to object conversion.
      See Also:
  • Constructor Details

    • LogMinerDmlEntryImplAdapter

      public LogMinerDmlEntryImplAdapter()
  • Method Details

    • 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. Internally this method examines the supplied object array and handles conversion for null and OracleValueConverters.UNAVAILABLE_VALUE values so that they can be serialized.
      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. Internally this method examines the supplied string array and handles the conversion of specific sentinel values back to their runtime equivalents. For example, NULL_VALUE_SENTINEL will be interpreted as null and UNAVAILABLE_VALUE_SENTINEL will be converted back to OracleValueConverters.UNAVAILABLE_VALUE.
      Parameters:
      values - the values array to eb converted, should never be null
      Returns:
      the values array converted to an object-array