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.private static StringUNAVAILABLE_VALUE_SENTINELThe supplied value arrays can now be populated withOracleValueConverters.UNAVAILABLE_VALUEwhich is simple java object.
-
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
-
UNAVAILABLE_VALUE_SENTINEL
private static final String UNAVAILABLE_VALUE_SENTINEL
The supplied value arrays can now be populated withOracleValueConverters.UNAVAILABLE_VALUEwhich 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:
- 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. Internally this method examines the supplied object array and handles conversion for null andOracleValueConverters.UNAVAILABLE_VALUEvalues so that they can be serialized.- 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. 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_SENTINELwill be interpreted as null andUNAVAILABLE_VALUE_SENTINELwill be converted back toOracleValueConverters.UNAVAILABLE_VALUE.- Parameters:
values- the values array to eb converted, should never benull- Returns:
- the values array converted to an object-array
-
-