Class LogMinerDmlEntryImplAdapter
- 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 marshallLogMinerDmlEntryImplinstances. This class defines a factory for creatingLogMinerDmlEntryImplinstances 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 Summary
Fields Modifier and Type Field Description private static StringNULL_VALUE_SENTINELArrays cannot be serialized with null values and so we use a sentinel value to mark a null element in an array.
-
Constructor Summary
Constructors Constructor Description LogMinerDmlEntryImplAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LogMinerDmlEntryImplfactory(int operation, String[] newValues, String[] oldValues, String name, String owner)A ProtoStream factory that creates aLogMinerDmlEntryImplinstance from field values.StringgetName(LogMinerDmlEntryImpl entry)A ProtoStream handler to extract theobjectNamefrom theLogMinerDmlEntryImpl.String[]getNewValues(LogMinerDmlEntryImpl entry)A ProtoStream handler to extract thenewValuesobject-array from theLogMinerDmlEntryImpl.String[]getOldValues(LogMinerDmlEntryImpl entry)A ProtoStream handler to extract teholdValuesobject-array from theLogMinerDmlEntryImpl.intgetOperation(LogMinerDmlEntryImpl entry)A ProtoStream handler to extract theentryfield from theLogMinerDmlEntryImpl.StringgetOwner(LogMinerDmlEntryImpl entry)A ProtoStream handler to extract theobjectOwnerfrom theLogMinerDmlEntryImpl.private String[]objectArrayToStringArray(Object[] values)Converts the provided object-array to a string-array.private Object[]stringArrayToObjectArray(String[] values)Converters the provided string-array to an object-array.
-
-
-
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
-
-
Method Detail
-
factory
@ProtoFactory public LogMinerDmlEntryImpl factory(int operation, String[] newValues, String[] oldValues, String name, String owner)
A ProtoStream factory that creates aLogMinerDmlEntryImplinstance from field values.- Parameters:
operation- the operationnewValues- string-array of the after state valuesoldValues- string-array of the before state valuesname- name of the tableowner- 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 theentryfield from theLogMinerDmlEntryImpl.- Parameters:
entry- the entry instance, must not benull- Returns:
- the operation code, never
null
-
getNewValues
@ProtoField(number=2) public String[] getNewValues(LogMinerDmlEntryImpl entry)
A ProtoStream handler to extract thenewValuesobject-array from theLogMinerDmlEntryImpl.- Parameters:
entry- the entry instance, must not benull- Returns:
- a string-array of all the after state
-
getOldValues
@ProtoField(number=3) public String[] getOldValues(LogMinerDmlEntryImpl entry)
A ProtoStream handler to extract teholdValuesobject-array from theLogMinerDmlEntryImpl.- Parameters:
entry- the entry instance, must not benull- 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 theobjectNamefrom theLogMinerDmlEntryImpl.- Parameters:
entry- the entry instance, must not benull- Returns:
- the table name
-
getOwner
@ProtoField(number=5, required=true) public String getOwner(LogMinerDmlEntryImpl entry)A ProtoStream handler to extract theobjectOwnerfrom theLogMinerDmlEntryImpl.- Parameters:
entry- the entry instance, must not benull- 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 isnullwill be initialized asNULL_VALUE_SENTINEL.- Parameters:
values- the values array to be converted, should never benull- 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 ofNULL_VALUE_SENTINELsentinel values tonull.- Parameters:
values- the values array to eb converted, should never benull- Returns:
- the values array converted to an object-array
-
-