com.latencybusters.pdm
Class PDMMessage

java.lang.Object
  extended by com.latencybusters.pdm.PDMMessage

public class PDMMessage
extends java.lang.Object

A PDM message consists of a definition and the corresponding optional and required fields as specified by the definition. Use toBytes() to serialize a message to bytes or parse(byte[]) to deserialize a message from bytes.


Field Summary
static int VERSION_POLICY_BEST
           
static int VERSION_POLICY_EXACT
           
 
Constructor Summary
PDMMessage()
          Empty constructor can be used when the PDMDefinition is not available.
PDMMessage(int definitionId, int versionMajor, int versionMinor)
          Creates a message from a finalized definition by looking it up in the PDMDefinitionCache by the id passed
PDMMessage(PDMDefinition definition)
          Creates a message from a finalized PDMDefinition
 
Method Summary
 PDMFieldIterator createFieldIterator()
          Creates a new PDMFieldIterator to traverse through the PDMFields
protected  int getDataSegmentLen()
           
 PDMDefinition getDefinition()
           
 PDMDeserializer getDeserializer()
           
protected  java.util.Collection<PDMField> getFields()
           
 java.lang.Object getFieldValue(PDMFieldInfo fieldInfo)
          Gets a field value by using the PDMFieldInfo handle from the PDMDefinition
 byte[] getFieldValueAsBlob(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a byte[]
 byte[][] getFieldValueAsBlobArray(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a an array of blobs
 boolean getFieldValueAsBoolean(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a boolean
 boolean[] getFieldValueAsBooleanArray(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a boolean[]
 PDMDecimal getFieldValueAsDecimal(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMDecimal
 PDMDecimal[] getFieldValueAsDecimalArray(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMDecimal[]
 double getFieldValueAsDouble(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a double
 double[] getFieldValueAsDoubleArray(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a double[]
 float getFieldValueAsFloat(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a float
 float[] getFieldValueAsFloatArray(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a float[]
 short getFieldValueAsInt16(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a short
 short[] getFieldValueAsInt16Array(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a short[]
 int getFieldValueAsInt32(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as an int
 int[] getFieldValueAsInt32Array(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a int[]
 long getFieldValueAsInt64(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a long
 long[] getFieldValueAsInt64Array(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a long[]
 byte getFieldValueAsInt8(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a byte
 byte[] getFieldValueAsInt8Array(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a byte[]
 PDMMessage getFieldValueAsMessage(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMMessage
 PDMMessage[] getFieldValueAsMessageArray(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMMessage[]
 java.lang.String getFieldValueAsString(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a String
 java.lang.String[] getFieldValueAsStringArray(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a String[]
 PDMTimestamp getFieldValueAsTimestamp(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMTimestamp
 PDMTimestamp[] getFieldValueAsTimestampArray(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMTimestamp[]
 int getFieldValueAsUInt16(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as an int (UInt16)
 int[] getFieldValueAsUInt16Array(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a int[]
 long getFieldValueAsUInt32(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a long (UInt32)
 long[] getFieldValueAsUInt32Array(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a long[]
 java.math.BigInteger getFieldValueAsUInt64(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a BigInteger
 java.math.BigInteger[] getFieldValueAsUInt64Array(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a BigInteger[]
 short getFieldValueAsUInt8(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a short (UInt8)
 short[] getFieldValueAsUInt8Array(PDMFieldInfo fieldInfo)
          Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a short[]
 int getMessageLen()
          Gets the message length in bytes which is known after it has been serialized
 PDMSerializer getSerializer()
           
 int getVersionPolicy()
           
 boolean isFieldValueSet(PDMFieldInfo fieldInfo)
          Checks to see if the field's value is set
 boolean isIncludeDefinition()
          Returns whether the PDMDefinition will be included when serializing to bytes (defaults to false)
 boolean isMsgDirty()
           
 boolean isTryToLoadDefFromCache()
          Returns whether or not an attempt will be made when parsing a message to try to automatically loaded a PDMDefinition from the PDMDefinitionCache if the one currently set doesn't exactly match the one in the incoming message; the current one will be replaced (defaults to false)
 boolean isUseMsgDefIfNeeded()
          Returns whether an included PDMDefinition should be parsed and used instead of the previously set PDMDefinition in cases where the two ids, major versions, and minor versions do not match exactly (defaults to false)
 void loadDefinition(PDMDefinition definition)
          Loads the PDMDefinition passed and initializes the PDMMessage
 int parse(byte[] ba)
          Deserializes a message from a byte array
 int parse(byte[] ba, int pos)
          Deserializes a message from a byte array at position
 int parse(PDMDeserializer deser, byte[] ba, int pos)
          Deserializes a message from a byte array at position
 PDMMessage removeFieldValue(PDMFieldInfo fieldInfo)
          Removes the field value (corresponding to the passed field info) from the message
 void setDeserializer(PDMDeserializer deser)
           
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, java.math.BigInteger value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT64.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, java.math.BigInteger[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT64_ARR.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, boolean value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.Boolean.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, boolean[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.BOOLEAN_ARR.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, byte value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.INT8.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, byte[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.INT8_ARR or PDMFieldType.BLOB.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, byte[][] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.BLOB_ARR.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, double value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.DOUBLE.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, double[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.DOUBLE_ARR.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, float value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.FLOAT.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, float[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.FLOAT_ARR.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, int value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT16 or PDMFieldType.INT32.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, int[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT16_ARR or PDMFieldType.INT32_ARR.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, long value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT32 or PDMFieldType.INT64.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, long[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT32_ARR or PDMFieldType.INT64_ARR.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, PDMDecimal value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.DECIMAL.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, PDMDecimal[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.DECIMAL_ARR.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, PDMMessage value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.MESSAGE.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, PDMMessage[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.MESSAGE_ARR.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, PDMTimestamp value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.Timestamp.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, PDMTimestamp[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.TIMESTAMP_ARR.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, short value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT8 or PDMFieldType.INT16.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, short[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT8_ARR or PDMFieldType.INT16_ARR.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, java.lang.String value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.FIX_STRING or PDMFieldType.STRING or PDMFieldType.FIX_UNICODE or PDMFieldType.UNICODE.
 PDMMessage setFieldValue(PDMFieldInfo fieldInfo, java.lang.String[] value)
          Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.FIX_STRING_ARR or PDMFieldType.STRING_ARR or PDMFieldType.FIX_UNICODE_ARR or PDMFieldType.UNICODE_ARR.
 void setIncludeDefinition(boolean includeDefinition)
          Sets whether the PDMDefinition will be included when serializing to bytes (defaults to false)
 void setMsgDirty(boolean msgDirty)
           
 void setSerializer(PDMSerializer ser)
           
 void setTryToLoadDefFromCache(boolean tryToLoadDefFromCache)
          Sets whether or not an attempt will be made when parsing a message to try to automatically loaded a PDMDefinition from the PDMDefinitionCache if the one currently set doesn't exactly match the one in the incoming message; the current one will be replaced (defaults to false)
 void setUseMsgDefIfNeeded(boolean useMsgDefIfNeeded)
          Sets whether an included PDMDefinition should be parsed and used instead of the previously set PDMDefinition in cases where the two ids, major versions, and minor versions do not match exactly (defaults to false)
 void setVersionPolicy(int versionPolicy)
           
 byte[] toBytes()
          Serializes the message to a new byte array
 byte[] toBytes(PDMSerializer ser)
          Serializes the message to a new byte array
 int toBytes(PDMSerializer ser, byte[] ba, int pos)
          Serializes the message to an existing byte array at position
 void updateOptOrVarFlag(PDMField field)
          Used internally to update the flag if needed to indicate that the message contains at least one optional or variable field
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_POLICY_EXACT

public static final int VERSION_POLICY_EXACT
See Also:
Constant Field Values

VERSION_POLICY_BEST

public static final int VERSION_POLICY_BEST
See Also:
Constant Field Values
Constructor Detail

PDMMessage

public PDMMessage()
Empty constructor can be used when the PDMDefinition is not available.


PDMMessage

public PDMMessage(PDMDefinition definition)
Creates a message from a finalized PDMDefinition

Parameters:
definition - The finalized PDMDefinition

PDMMessage

public PDMMessage(int definitionId,
                  int versionMajor,
                  int versionMinor)
Creates a message from a finalized definition by looking it up in the PDMDefinitionCache by the id passed

Parameters:
definitionId - The definition id to lookup in the cache
versionMajor -
versionMinor -
Method Detail

getDefinition

public PDMDefinition getDefinition()

getSerializer

public PDMSerializer getSerializer()

setSerializer

public void setSerializer(PDMSerializer ser)

getDeserializer

public PDMDeserializer getDeserializer()

setDeserializer

public void setDeserializer(PDMDeserializer deser)

getVersionPolicy

public int getVersionPolicy()

setVersionPolicy

public void setVersionPolicy(int versionPolicy)

isIncludeDefinition

public boolean isIncludeDefinition()
Returns whether the PDMDefinition will be included when serializing to bytes (defaults to false)

Returns:
true if it will be included

setIncludeDefinition

public void setIncludeDefinition(boolean includeDefinition)
Sets whether the PDMDefinition will be included when serializing to bytes (defaults to false)

Parameters:
includeDefinition -

isUseMsgDefIfNeeded

public boolean isUseMsgDefIfNeeded()
Returns whether an included PDMDefinition should be parsed and used instead of the previously set PDMDefinition in cases where the two ids, major versions, and minor versions do not match exactly (defaults to false)

Returns:
true if the included PDMDefinition can be parsed and used

setUseMsgDefIfNeeded

public void setUseMsgDefIfNeeded(boolean useMsgDefIfNeeded)
Sets whether an included PDMDefinition should be parsed and used instead of the previously set PDMDefinition in cases where the two ids, major versions, and minor versions do not match exactly (defaults to false)

Parameters:
useMsgDefIfNeeded -

isTryToLoadDefFromCache

public boolean isTryToLoadDefFromCache()
Returns whether or not an attempt will be made when parsing a message to try to automatically loaded a PDMDefinition from the PDMDefinitionCache if the one currently set doesn't exactly match the one in the incoming message; the current one will be replaced (defaults to false)

Returns:
true if an attempt will be made to try to load the PDMDefinition

setTryToLoadDefFromCache

public void setTryToLoadDefFromCache(boolean tryToLoadDefFromCache)
Sets whether or not an attempt will be made when parsing a message to try to automatically loaded a PDMDefinition from the PDMDefinitionCache if the one currently set doesn't exactly match the one in the incoming message; the current one will be replaced (defaults to false)

Parameters:
tryToLoadDefFromCache -

getMessageLen

public int getMessageLen()
Gets the message length in bytes which is known after it has been serialized

Returns:
the message length in bytes

getFields

protected java.util.Collection<PDMField> getFields()

getDataSegmentLen

protected int getDataSegmentLen()

updateOptOrVarFlag

public void updateOptOrVarFlag(PDMField field)
Used internally to update the flag if needed to indicate that the message contains at least one optional or variable field

Parameters:
field - the field to check

isFieldValueSet

public boolean isFieldValueSet(PDMFieldInfo fieldInfo)
Checks to see if the field's value is set

Parameters:
fieldInfo - the corresponding field info handle
Returns:
true if the field value has been set or false if it has not

createFieldIterator

public PDMFieldIterator createFieldIterator()
Creates a new PDMFieldIterator to traverse through the PDMFields


loadDefinition

public void loadDefinition(PDMDefinition definition)
Loads the PDMDefinition passed and initializes the PDMMessage

Parameters:
definition - the PDMDefinition to load

removeFieldValue

public PDMMessage removeFieldValue(PDMFieldInfo fieldInfo)
Removes the field value (corresponding to the passed field info) from the message

Parameters:
fieldInfo - the PDMFieldInfo of the field to remove
Returns:
this PDMMessage for chaining

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                boolean value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.Boolean.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the boolean value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                byte value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.INT8.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the byte value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                short value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT8 or PDMFieldType.INT16.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the ubyte (as a short) or short value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                int value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT16 or PDMFieldType.INT32.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the ushort (as an int) or int value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                long value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT32 or PDMFieldType.INT64.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the uint (as a long) or long value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                java.math.BigInteger value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT64.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the ulong (as a BigInteger) value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                float value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.FLOAT.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the float value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                double value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.DOUBLE.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the double value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                PDMDecimal value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.DECIMAL.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the PDMDecimal value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                PDMTimestamp value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.Timestamp.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the PDMTimestamp value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                java.lang.String value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.FIX_STRING or PDMFieldType.STRING or PDMFieldType.FIX_UNICODE or PDMFieldType.UNICODE.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the String value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                PDMMessage value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.MESSAGE.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the PDMMessage value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                boolean[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.BOOLEAN_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the boolean array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                byte[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.INT8_ARR or PDMFieldType.BLOB.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the byte array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                short[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT8_ARR or PDMFieldType.INT16_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the ubtye (as a short) or short array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                int[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT16_ARR or PDMFieldType.INT32_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the ushort (as an int) or int array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                long[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT32_ARR or PDMFieldType.INT64_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the uint (as a long) or long array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                java.math.BigInteger[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.UINT64_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the ulong (as a BigInteger) array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                float[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.FLOAT_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the float array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                double[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.DOUBLE_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the double array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                PDMDecimal[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.DECIMAL_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the PDMDecimal array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                PDMTimestamp[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.TIMESTAMP_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the PDMTimestamp array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                java.lang.String[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.FIX_STRING_ARR or PDMFieldType.STRING_ARR or PDMFieldType.FIX_UNICODE_ARR or PDMFieldType.UNICODE_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the PDMMessage array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                byte[][] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.BLOB_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the byte[] array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

setFieldValue

public PDMMessage setFieldValue(PDMFieldInfo fieldInfo,
                                PDMMessage[] value)
Sets the field value in the message using the PDMFieldInfo handle and should be of type PDMFieldType.MESSAGE_ARR.

Parameters:
fieldInfo - the PDMFieldInfo handle
value - the PDMMessage array value
Returns:
a reference to this PDMMessage for chaining setFieldValue calls

getFieldValue

public java.lang.Object getFieldValue(PDMFieldInfo fieldInfo)
Gets a field value by using the PDMFieldInfo handle from the PDMDefinition

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
The value as an Object that can be casted.

getFieldValueAsBoolean

public boolean getFieldValueAsBoolean(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a boolean

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsInt8

public byte getFieldValueAsInt8(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a byte

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsUInt8

public short getFieldValueAsUInt8(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a short (UInt8)

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsInt16

public short getFieldValueAsInt16(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a short

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsUInt16

public int getFieldValueAsUInt16(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as an int (UInt16)

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsInt32

public int getFieldValueAsInt32(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as an int

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsUInt32

public long getFieldValueAsUInt32(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a long (UInt32)

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsInt64

public long getFieldValueAsInt64(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a long

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsUInt64

public java.math.BigInteger getFieldValueAsUInt64(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a BigInteger

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsFloat

public float getFieldValueAsFloat(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a float

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsDouble

public double getFieldValueAsDouble(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a double

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsDecimal

public PDMDecimal getFieldValueAsDecimal(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMDecimal

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsTimestamp

public PDMTimestamp getFieldValueAsTimestamp(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMTimestamp

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsString

public java.lang.String getFieldValueAsString(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a String

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsBlob

public byte[] getFieldValueAsBlob(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a byte[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsMessage

public PDMMessage getFieldValueAsMessage(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMMessage

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsBooleanArray

public boolean[] getFieldValueAsBooleanArray(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a boolean[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsInt8Array

public byte[] getFieldValueAsInt8Array(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a byte[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsUInt8Array

public short[] getFieldValueAsUInt8Array(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a short[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsInt16Array

public short[] getFieldValueAsInt16Array(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a short[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsUInt16Array

public int[] getFieldValueAsUInt16Array(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a int[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsInt32Array

public int[] getFieldValueAsInt32Array(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a int[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsUInt32Array

public long[] getFieldValueAsUInt32Array(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a long[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsInt64Array

public long[] getFieldValueAsInt64Array(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a long[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsUInt64Array

public java.math.BigInteger[] getFieldValueAsUInt64Array(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a BigInteger[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsFloatArray

public float[] getFieldValueAsFloatArray(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a float[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsDoubleArray

public double[] getFieldValueAsDoubleArray(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a double[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsDecimalArray

public PDMDecimal[] getFieldValueAsDecimalArray(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMDecimal[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsTimestampArray

public PDMTimestamp[] getFieldValueAsTimestampArray(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMTimestamp[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsStringArray

public java.lang.String[] getFieldValueAsStringArray(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a String[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsBlobArray

public byte[][] getFieldValueAsBlobArray(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a an array of blobs

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

getFieldValueAsMessageArray

public PDMMessage[] getFieldValueAsMessageArray(PDMFieldInfo fieldInfo)
Gets the field value by using the PDMFieldInfo handle from the PDMDefinition as a PDMMessage[]

Parameters:
fieldInfo - the PDMFieldInfo handle
Returns:
the value

toBytes

public byte[] toBytes()
Serializes the message to a new byte array

Returns:
the new byte array

toBytes

public byte[] toBytes(PDMSerializer ser)
Serializes the message to a new byte array

Parameters:
ser - the PDMSerializer to use
Returns:
the new byte array

toBytes

public int toBytes(PDMSerializer ser,
                   byte[] ba,
                   int pos)
Serializes the message to an existing byte array at position

Parameters:
ser - the PDMSerializer to use
ba - the byte array
pos - the starting position
Returns:
the updated position in the byte array after serializing this object

parse

public int parse(byte[] ba)
Deserializes a message from a byte array

Parameters:
ba - the byte array
Returns:
the updated position in the byte array after parsing this object

parse

public int parse(byte[] ba,
                 int pos)
Deserializes a message from a byte array at position

Parameters:
ba - the byte array
pos - the starting position
Returns:
the updated position in the byte array after parsing

parse

public int parse(PDMDeserializer deser,
                 byte[] ba,
                 int pos)
Deserializes a message from a byte array at position

Parameters:
deser - the PDMDeserializer to use
ba - the byte array
pos - the starting position
Returns:
the updated position in the byte array after parsing

isMsgDirty

public boolean isMsgDirty()

setMsgDirty

public void setMsgDirty(boolean msgDirty)


All of the documentation and software included in this and any other Informatica Inc "Ultra Messaging" Release is Copyright (C) 2004-2014, Informatica Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted only as covered by the terms of a valid software license agreement with 29West Inc. Copyright © 2004-2014, Informatica, Inc. All Rights Reserved.