|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.onixs.fix.parser.Message
public class Message
FIX message
Field Summary | |
---|---|
protected boolean |
allowEmptyValues
|
protected static String |
APPL_VER_ID_ANCHOR
|
protected static byte[] |
APPL_VER_ID_ANCHOR_BYTES
|
protected static byte[] |
CHECK_SUM_ANCHOR_BYTES
|
protected byte[] |
checksumField
|
protected biz.onixs.util.ByteBuffer |
contents
|
protected static ValuePtr |
DATETIME
|
protected static String |
DEF_APPL_VER_ID_ANCHOR
|
protected static byte[] |
DEF_APPL_VER_ID_ANCHOR_BYTES
|
protected biz.onixs.fix.parser.InstanceDescription |
descr
|
protected static biz.onixs.fix.parser.StandardDictionary |
DICTIONARY
|
protected boolean |
enableUnknownFields
|
protected int[] |
fieldIndexes
|
protected int[] |
fieldLengths
|
protected Group[] |
groups
|
protected static ValuePtr |
LOGON_MSG_TYPE
|
protected static ValuePtr |
MAX_SEQ_NUM
|
protected String |
msgType
|
protected static ValuePtr |
ONE
|
protected Map<Integer,biz.onixs.fix.parser.Message.UserDefinedField> |
userFields
|
protected boolean |
validateNumInGroupCount
|
protected Version |
version
|
protected static ValuePtr |
ZERO
|
Constructor Summary | |
---|---|
Message()
|
|
Message(byte[] rawMessage)
Parses the raw FIX message and creates the corresponding class instance. |
|
Message(byte[] rawMsg,
int length,
boolean enableUnknownFields,
boolean allowEmptyValues,
boolean validateNumInGroupCount,
boolean verifyLength,
boolean verifyCheckSum)
|
|
Message(biz.onixs.util.ByteBuffer rawMsg,
boolean enableUnknownFields,
boolean allowEmptyValues,
boolean validateNumInGroupCount,
boolean verifyLength,
boolean verifyCheckSum)
|
|
Message(Message rh)
|
|
Message(String rawMessage)
Parses the raw FIX message and creates the corresponding class instance. |
|
Message(String rawMessage,
boolean enableUnknownFields,
boolean allowEmptyValues,
boolean validateNumInGroupCount)
|
|
Message(String type,
Version version)
Creates a message. |
|
Message(String type,
Version version,
boolean enableUnknownFields)
Creates a message. |
|
Message(String type,
Version version,
boolean enableUnknownFields,
boolean allowEmptyValues)
Creates a message. |
|
Message(Version version,
byte[] rawMsg,
int length,
boolean enableUnknownFields,
boolean allowEmptyValues,
boolean validateNumInGroupCount,
boolean verifyLength,
boolean verifyCheckSum)
|
|
Message(Version version,
biz.onixs.util.ByteBuffer buffer)
|
|
Message(Version version,
String rawMessage)
Creates a message. |
Method Summary | |
---|---|
void |
assemble(biz.onixs.util.ByteBuffer bb)
|
boolean |
contains(int tag)
Returns whether the field with the specified tag number is set. |
String |
get(int tag)
Returns the field value as string. |
boolean |
get(int tag,
ValuePtr valuePtr)
Returns field value. |
byte[] |
getBytes(int tag)
Returns the field value as a byte array. |
protected biz.onixs.fix.parser.InstanceDescriptionImpl |
getDictionary(String msgType,
Version version)
|
double |
getDouble(int tag)
Returns the field value as double. |
Group |
getGroup(int numberOfInstancesTag)
Returns the repeating group. |
int |
getInteger(int tag)
Returns the field value as integer. |
long |
getLong(int tag)
Returns the field value as long. |
String |
getSenderCompID()
Returns assigned value used to identify firm sending message (the SenderCompID (tag=49) field value). |
long |
getSeqNum()
Returns message sequence number (the MsgSeqNum (tag=34) field value). |
String |
getTargetCompID()
Returns assigned value used to identify receiving firm (the TargetCompID (tag=56) field value). |
String |
getType()
Returns message type (the MsgType (tag=35) field value). |
boolean |
getValidateFieldValues()
|
ValuePtr |
getValuePtr(int tag)
Returns the field value. |
Version |
getVersion()
Financial Interface eXchange (FIX) protocol version. |
boolean |
hasFlag(int tag)
Returns the flag value. |
protected void |
init()
|
void |
init(Message rh)
|
boolean |
isOriginal()
|
boolean |
isSessionLevel()
|
boolean |
remove(int tag)
Removes the field. |
void |
reset()
|
boolean |
set(int tag,
byte[] value)
Sets field value. |
boolean |
set(int tag,
biz.onixs.util.ByteBuffer buffer)
Sets the field value. |
boolean |
set(int tag,
double value)
Sets the field value as double. |
boolean |
set(int tag,
int value)
Sets the field value as integer. |
boolean |
set(int tag,
long value)
Sets the long field value. |
boolean |
set(int tag,
String value)
Sets the field value as string. |
boolean |
set(int tag,
ValuePtr valuePtr)
Sets field value. |
protected void |
setCommonFields()
|
boolean |
setFlag(int tag,
boolean value)
Sets the flag tag value - "Y" or "N". |
Group |
setGroup(int numberOfInstancesTag,
int numberOfIntances)
Creates a new repeating group or changes the number of instances in the existing repeatign group. |
void |
setSenderCompID(String newValue)
Sets assigned value used to identify firm sending message (the SenderCompID (tag=49) field value). |
void |
setSeqNum(long value)
Sets message sequence number (the MsgSeqNum (tag=34) field value). |
void |
setTargetCompID(String newValue)
Sets assigned value used to identify receiving firm (the TargetCompID (tag=56) field value). |
void |
setValidateFieldValues(boolean validateFieldValues)
|
String |
toString()
Returns the <tag>=<value> representation of the message. |
String |
toString(char delimiter)
Returns the <tag>=<value> representation of the message using the given delimiter. |
void |
updateChecksum()
|
void |
validate()
Performs the message validation. |
void |
validate(boolean validateRequiredFields)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final biz.onixs.fix.parser.StandardDictionary DICTIONARY
protected static final byte[] CHECK_SUM_ANCHOR_BYTES
protected static final ValuePtr ZERO
protected static final ValuePtr ONE
protected static final ValuePtr LOGON_MSG_TYPE
protected static final ValuePtr DATETIME
protected static final ValuePtr MAX_SEQ_NUM
protected static final String APPL_VER_ID_ANCHOR
protected static final byte[] APPL_VER_ID_ANCHOR_BYTES
protected static final String DEF_APPL_VER_ID_ANCHOR
protected static final byte[] DEF_APPL_VER_ID_ANCHOR_BYTES
protected biz.onixs.util.ByteBuffer contents
protected int[] fieldIndexes
protected int[] fieldLengths
protected Group[] groups
protected Version version
protected biz.onixs.fix.parser.InstanceDescription descr
protected Map<Integer,biz.onixs.fix.parser.Message.UserDefinedField> userFields
protected boolean enableUnknownFields
protected boolean allowEmptyValues
protected boolean validateNumInGroupCount
protected byte[] checksumField
protected String msgType
Constructor Detail |
---|
public Message(biz.onixs.util.ByteBuffer rawMsg, boolean enableUnknownFields, boolean allowEmptyValues, boolean validateNumInGroupCount, boolean verifyLength, boolean verifyCheckSum)
public Message(byte[] rawMsg, int length, boolean enableUnknownFields, boolean allowEmptyValues, boolean validateNumInGroupCount, boolean verifyLength, boolean verifyCheckSum)
public Message(Version version, byte[] rawMsg, int length, boolean enableUnknownFields, boolean allowEmptyValues, boolean validateNumInGroupCount, boolean verifyLength, boolean verifyCheckSum)
public Message(byte[] rawMessage)
rawMessage
- the raw FIX message (in the <tag>=<value> format)public Message(Version version, biz.onixs.util.ByteBuffer buffer)
public Message(Version version, String rawMessage)
version
- FIX versionrawMessage
- the raw FIX message (in the <tag>=<value> format)public Message(String type, Version version)
type
- Message type (the MsgType (tag=35) field value)version
- FIX versionpublic Message(String type, Version version, boolean enableUnknownFields)
type
- Message type (the MsgType (tag=35) field value)version
- FIX versionenableUnknownFields
- flag to enable unknown fieldspublic Message(String type, Version version, boolean enableUnknownFields, boolean allowEmptyValues)
type
- Message type (the MsgType (tag=35) field value)version
- FIX versionenableUnknownFields
- flag to enable unknown fieldsallowEmptyValues
- flag to allow empty valuespublic Message()
public Message(Message rh)
public Message(String rawMessage)
rawMessage
- the raw FIX message (in the <tag>=<value> format)public Message(String rawMessage, boolean enableUnknownFields, boolean allowEmptyValues, boolean validateNumInGroupCount)
Method Detail |
---|
protected biz.onixs.fix.parser.InstanceDescriptionImpl getDictionary(String msgType, Version version)
public void reset()
public void init(Message rh)
public void assemble(biz.onixs.util.ByteBuffer bb)
public boolean get(int tag, ValuePtr valuePtr)
tag
- tag numbervaluePtr
- value pointer
public byte[] getBytes(int tag)
tag
- tag number
public ValuePtr getValuePtr(int tag)
tag
- tag number
ValuePtr.isSet()
to check whether value is setpublic Version getVersion()
public String get(int tag)
get
in interface FixBlock
tag
- tag number
public boolean contains(int tag)
contains
in interface FixBlock
tag
- field tag number
true
if the field is set, false
if the field is not set
or is not defined for this messagepublic double getDouble(int tag)
contains(int)
.
tag
- Tag number
Double.NaN
if it is not set
ValueIsIncorrectException
- if the value can't be parsed to doublepublic long getLong(int tag)
contains(int)
.
getLong
in interface FixBlock
tag
- tag number
Long.MAX_VALUE
if it is not set
ValueIsIncorrectException
- if the value can't be parsed to longpublic boolean set(int tag, biz.onixs.util.ByteBuffer buffer)
set
in interface FixBlock
tag
- field tag numberbuffer
- field value
TagNotDefinedForThisMessageTypeException
- if field with the specified tag is not defined for this message
and unknown fields are disabledpublic boolean set(int tag, ValuePtr valuePtr)
set
in interface FixBlock
tag
- tag numbervaluePtr
- value pointer
TagNotDefinedForThisMessageTypeException
- if field with the specified tag is not defined for this message
and unknown fields are disabledpublic boolean set(int tag, byte[] value)
set
in interface FixBlock
tag
- field tag numbervalue
- field value
TagNotDefinedForThisMessageTypeException
- if field with the specified tag is not defined for this message
and unknown fields are disabledpublic int getInteger(int tag)
contains(int)
.
getInteger
in interface FixBlock
tag
- tag number
Integer.MAX_VALUE
if it is not set
ValueIsIncorrectException
- if the value can't be parsed to intpublic boolean set(int tag, String value)
set
in interface FixBlock
tag
- field tag numbervalue
- field value
TagNotDefinedForThisMessageTypeException
- if field with the specified tag is not defined for this message
and unknown fields are disabledpublic boolean set(int tag, int value)
set
in interface FixBlock
tag
- Tag numbervalue
- Field value
TagNotDefinedForThisMessageTypeException
- if field with the specified tag is not defined for this message
and unknown fields are disabledpublic boolean set(int tag, double value)
tag
- Tag numbervalue
- Field value
TagNotDefinedForThisMessageTypeException
- if field with the specified tag is not defined for this message
and unknown fields are disabledpublic boolean set(int tag, long value)
set
in interface FixBlock
tag
- tag numbervalue
- field value
TagNotDefinedForThisMessageTypeException
- if field with the specified tag is not defined for this message
and unknown fields are disabledpublic String getSenderCompID()
public void setSenderCompID(String newValue)
newValue
- SenderCompIDpublic String getTargetCompID()
public void setTargetCompID(String newValue)
newValue
- TargetCompIDpublic String getType()
public Group setGroup(int numberOfInstancesTag, int numberOfIntances)
setGroup
in interface FixBlock
numberOfInstancesTag
- Tag number of the field that defines the number of instances in this repeating group
(the NoXXX field)numberOfIntances
- Number of instances in the repeating group
ParserException
- The tag number does not belong to the messagepublic boolean remove(int tag)
tag
- Tag number
public Group getGroup(int numberOfInstancesTag)
getGroup
in interface FixBlock
numberOfInstancesTag
- Tag number of the field that defines the number of instances
in this repeating group (the NoXXX field)
ParserException
- The tag number does not belong to the messagepublic void validate()
ParserException
- The message is not validpublic void validate(boolean validateRequiredFields)
public long getSeqNum()
public void setSeqNum(long value)
value
- message sequence numberpublic String toString()
toString
in class Object
public String toString(char delimiter)
delimiter
- The delimiter between the <tag>=<value> pairs
public boolean isSessionLevel()
public boolean hasFlag(int tag)
tag
- tag number
public boolean setFlag(int tag, boolean value)
tag
- the tag numbervalue
- true
for "Y", false
for "N"
TagNotDefinedForThisMessageTypeException
- if field with the specified tag is not defined for this message
and unknown fields are disabledpublic boolean isOriginal()
public void setValidateFieldValues(boolean validateFieldValues)
public boolean getValidateFieldValues()
protected void init()
protected void setCommonFields()
public void updateChecksum()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |