com.btobits.fixengine
Class FIXMessage
java.lang.Object
com.btobits.fixengine.FIXMessage
- All Implemented Interfaces:
- Message
public class FIXMessage
- extends Object
- implements Message
Method Summary |
boolean |
areAllReqTagsPresent(boolean checkOnlyApp,
List errors)
|
void |
deleteField(int tag)
|
static int |
generateChecksum(byte[] block,
boolean withChecksum)
|
byte[] |
getBytes()
|
List |
getCustomFields()
|
Calendar |
getDateTimeField(int tag)
|
Calendar |
getDateTimeField(int tag,
Calendar defaultValue)
|
double |
getDoubleField(int tag)
|
double |
getDoubleField(int tag,
double defaultValue)
|
Double |
getDoubleObjField(int tag)
|
Double |
getDoubleObjField(int tag,
int rgNum)
|
Double |
getDoubleObjField(int tag,
int[] rgNums)
|
Double |
getDoubleObjFieldNthOccur(int tag,
int rgNum)
|
FIXField |
getField(int tag)
|
FIXField |
getField(int tagNum,
int startWith)
|
int |
getFieldIndex(int tag)
|
int |
getFieldIndex(int tagNum,
int startWith)
|
FIXField[] |
getFieldList()
|
String |
getFieldValueAsString(int tag)
|
String |
getFieldValueAsString(int tag,
int repeatingGroupNumber)
|
Integer |
getIntegerObjField(int tag)
|
Integer |
getIntegerObjField(int tag,
int rgNum)
|
Integer |
getIntegerObjField(int tag,
int[] rgNums)
|
Integer |
getIntegerObjFieldNthOccur(int tag,
int rgNum)
|
long |
getLongField(int tag)
|
long |
getLongField(int tag,
long defaultValue)
|
Long |
getLongObjField(int tag)
|
Long |
getLongObjField(int tag,
int rgNum)
|
Long |
getLongObjFieldNthOccur(int tag,
int rgNum)
|
String |
getMessageType()
|
static FIXVersion |
getMsgFIXversion(byte[] block)
|
static String |
getMsgType(byte[] block)
|
static String |
getPossDupFlag(byte[] block)
|
static String |
getReasonStr(int reason)
|
int |
getRGFieldInd(int tagNum,
int ocurNum)
|
FIXField[] |
getRGFields(int tag,
int[] rgNums)
|
int |
getRGQty(int tag,
int[] rgNums)
|
static String |
getSenderCompID(byte[] block)
|
String |
getSendingTime()
|
Calendar |
getSendingTimeAsDate()
|
static long |
getSequenceNumber(byte[] msg)
|
String |
getStringField(int tag)
|
String |
getStringField(int tag,
int rgNum)
Deprecated. use getFieldValueAsString instead |
String |
getStringField(int tag,
String defaultValue)
|
String |
getStringObjField(int tag)
|
String |
getStringObjField(int tag,
int rgNum)
|
String |
getStringObjField(int tag,
int[] rgNums)
|
String |
getStringObjFieldNthOccur(int tag,
int rgNum)
|
int |
getTagIndex(int tag,
int from,
int end,
int occurNum)
|
static String |
getTargetCompID(byte[] block)
|
FIXVersion |
getVersion()
|
boolean |
hasValidMessageType()
|
void |
insertDateTimeField(int tag,
int pos,
Calendar value)
|
void |
insertDoubleField(int tag,
int pos,
double value)
|
void |
insertField(FIXField fixField,
int pos)
|
void |
insertLongField(int tag,
int pos,
long value)
|
void |
insertRawField(int tag,
int pos,
byte[] value)
|
void |
insertStringField(int tag,
int pos,
String value)
|
boolean |
isAdministrative()
|
static boolean |
isAdministrative(byte[] block)
|
static boolean |
isMessageGarbled(byte[] block)
|
boolean |
isResendable()
|
void |
setDateTimeField(int index,
Calendar value)
|
void |
setDateValue(int tag,
int pos,
Calendar cal)
|
void |
setDeliverToCompID(String id)
|
void |
setDeliverToLocationID(String id)
|
void |
setDeliverToSubID(String id)
|
void |
setDoubleField(int index,
double value)
|
void |
setFieldList(FIXField[] fields)
|
void |
setFieldList(List fields)
|
void |
setLongField(int index,
long value)
|
void |
setMessageType(String type)
|
void |
setOnBehalfOfCompID(String id)
|
void |
setOnBehalfOfLocationID(String id)
|
void |
setOnBehalfOfSubID(String id)
|
void |
setRawField(int index,
byte[] value)
|
void |
setSenderID(String id)
|
void |
setSenderLocationID(String id)
|
void |
setSenderSubID(String id)
|
void |
setSendingTime()
|
void |
setSequenceNumber(int sequence)
|
void |
setStringField(int index,
String value)
|
void |
setStringValue(int tag,
int pos,
String str)
|
void |
setTargetID(String id)
|
void |
setTargetLocationID(String id)
|
void |
setTargetSubID(String id)
|
void |
setVersion(FIXVersion fixVersion)
|
byte[] |
toFIXBlock()
|
FIXFieldList |
toFIXFieldList()
|
String |
toString()
|
boolean |
validateMessage(List errors)
|
void |
writeTo(OutputStream out)
|
INVALIDTAGNUMBER
public static final int INVALIDTAGNUMBER
- See Also:
- Constant Field Values
REQUIREDTAGMISSING
public static final int REQUIREDTAGMISSING
- See Also:
- Constant Field Values
TAGNOTDEFINEDFORTHISMESSAGETYPE
public static final int TAGNOTDEFINEDFORTHISMESSAGETYPE
- See Also:
- Constant Field Values
UNDEFINEDTAG
public static final int UNDEFINEDTAG
- See Also:
- Constant Field Values
TAGSPECIFIEDWITHOUTAVALUE
public static final int TAGSPECIFIEDWITHOUTAVALUE
- See Also:
- Constant Field Values
VALUEISINCORRECTFORTHISTAG
public static final int VALUEISINCORRECTFORTHISTAG
- See Also:
- Constant Field Values
INCORRECTDATAFORMATFORVALUE
public static final int INCORRECTDATAFORMATFORVALUE
- See Also:
- Constant Field Values
DECRYPTIONPROBLEM
public static final int DECRYPTIONPROBLEM
- See Also:
- Constant Field Values
SIGNATUREPROBLEM
public static final int SIGNATUREPROBLEM
- See Also:
- Constant Field Values
COMPIDPROBLEM
public static final int COMPIDPROBLEM
- See Also:
- Constant Field Values
SENDINGTIMEACCURACYPROBLEM
public static final int SENDINGTIMEACCURACYPROBLEM
- See Also:
- Constant Field Values
INVALIDMSGTYPE
public static final int INVALIDMSGTYPE
- See Also:
- Constant Field Values
XMLVALIDATIONERROR
public static final int XMLVALIDATIONERROR
- See Also:
- Constant Field Values
TAGAPPEARSMORETHENONCE
public static final int TAGAPPEARSMORETHENONCE
- See Also:
- Constant Field Values
TAGSPECIFIEDOUTOFREQUIREDORDER
public static final int TAGSPECIFIEDOUTOFREQUIREDORDER
- See Also:
- Constant Field Values
REPEATINGGROUPFIELDSOUTOFORDER
public static final int REPEATINGGROUPFIELDSOUTOFORDER
- See Also:
- Constant Field Values
INCORRECTNUMINGROUPCOUNTOFREPEATINGGROUP
public static final int INCORRECTNUMINGROUPCOUNTOFREPEATINGGROUP
- See Also:
- Constant Field Values
NONDATAVALUEINCLUDESFIELDDELIMITER
public static final int NONDATAVALUEINCLUDESFIELDDELIMITER
- See Also:
- Constant Field Values
DATATYPEMISMATCH
public static final int DATATYPEMISMATCH
- See Also:
- Constant Field Values
GARBLEDMESSAGE
public static final int GARBLEDMESSAGE
- See Also:
- Constant Field Values
INVALIDDATATYPE
public static final int INVALIDDATATYPE
- See Also:
- Constant Field Values
FIXMessage
public FIXMessage(FIXMessage fixMessage)
FIXMessage
public FIXMessage()
FIXMessage
public FIXMessage(FIXField[] fields,
FIXVersion fixVersion)
FIXMessage
public FIXMessage(List fields,
FIXVersion fixVersion)
FIXMessage
public FIXMessage(FIXFieldList message)
getReasonStr
public static String getReasonStr(int reason)
isMessageGarbled
public static boolean isMessageGarbled(byte[] block)
generateChecksum
public static int generateChecksum(byte[] block,
boolean withChecksum)
getDateTimeField
public Calendar getDateTimeField(int tag)
throws Exception
- Throws:
Exception
getDateTimeField
public Calendar getDateTimeField(int tag,
Calendar defaultValue)
getDoubleField
public double getDoubleField(int tag)
throws Exception
- Throws:
Exception
getDoubleField
public double getDoubleField(int tag,
double defaultValue)
getDoubleObjField
public Double getDoubleObjField(int tag)
getDoubleObjField
public Double getDoubleObjField(int tag,
int rgNum)
getDoubleObjField
public Double getDoubleObjField(int tag,
int[] rgNums)
getDoubleObjFieldNthOccur
public Double getDoubleObjFieldNthOccur(int tag,
int rgNum)
getFieldIndex
public int getFieldIndex(int tag)
getFieldIndex
public int getFieldIndex(int tagNum,
int startWith)
getField
public FIXField getField(int tag)
getField
public FIXField getField(int tagNum,
int startWith)
getFieldList
public FIXField[] getFieldList()
getIntegerObjField
public Integer getIntegerObjField(int tag)
getIntegerObjField
public Integer getIntegerObjField(int tag,
int rgNum)
getTagIndex
public int getTagIndex(int tag,
int from,
int end,
int occurNum)
getIntegerObjField
public Integer getIntegerObjField(int tag,
int[] rgNums)
getIntegerObjFieldNthOccur
public Integer getIntegerObjFieldNthOccur(int tag,
int rgNum)
getLongField
public long getLongField(int tag)
throws Exception
- Throws:
Exception
getLongField
public long getLongField(int tag,
long defaultValue)
getLongObjField
public Long getLongObjField(int tag)
getLongObjField
public Long getLongObjField(int tag,
int rgNum)
getLongObjFieldNthOccur
public Long getLongObjFieldNthOccur(int tag,
int rgNum)
getMessageType
public String getMessageType()
getMsgType
public static String getMsgType(byte[] block)
getTargetCompID
public static String getTargetCompID(byte[] block)
getSenderCompID
public static String getSenderCompID(byte[] block)
getSequenceNumber
public static long getSequenceNumber(byte[] msg)
getPossDupFlag
public static String getPossDupFlag(byte[] block)
getMsgFIXversion
public static FIXVersion getMsgFIXversion(byte[] block)
getRGFieldInd
public int getRGFieldInd(int tagNum,
int ocurNum)
getSendingTime
public String getSendingTime()
getSendingTimeAsDate
public Calendar getSendingTimeAsDate()
getStringField
public String getStringField(int tag)
getStringField
public String getStringField(int tag,
int rgNum)
- Deprecated. use getFieldValueAsString instead
- Parameters:
tag
-
- Returns:
- string value of field
getStringField
public String getStringField(int tag,
String defaultValue)
getStringObjField
public String getStringObjField(int tag)
getFieldValueAsString
public String getFieldValueAsString(int tag,
int repeatingGroupNumber)
getFieldValueAsString
public String getFieldValueAsString(int tag)
getStringObjField
public String getStringObjField(int tag,
int rgNum)
getStringObjField
public String getStringObjField(int tag,
int[] rgNums)
getRGFields
public FIXField[] getRGFields(int tag,
int[] rgNums)
getRGQty
public int getRGQty(int tag,
int[] rgNums)
getStringObjFieldNthOccur
public String getStringObjFieldNthOccur(int tag,
int rgNum)
insertField
public void insertField(FIXField fixField,
int pos)
deleteField
public void deleteField(int tag)
isResendable
public boolean isResendable()
isAdministrative
public boolean isAdministrative()
isAdministrative
public static boolean isAdministrative(byte[] block)
setFieldList
public void setFieldList(List fields)
setFieldList
public void setFieldList(FIXField[] fields)
setMessageType
public void setMessageType(String type)
throws FIXMessageException
- Throws:
FIXMessageException
setSenderID
public void setSenderID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setSenderSubID
public void setSenderSubID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setSenderLocationID
public void setSenderLocationID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setOnBehalfOfCompID
public void setOnBehalfOfCompID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setDeliverToCompID
public void setDeliverToCompID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setOnBehalfOfSubID
public void setOnBehalfOfSubID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setDeliverToSubID
public void setDeliverToSubID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setOnBehalfOfLocationID
public void setOnBehalfOfLocationID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setDeliverToLocationID
public void setDeliverToLocationID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setSendingTime
public void setSendingTime()
throws FIXMessageException
- Throws:
FIXMessageException
setSequenceNumber
public void setSequenceNumber(int sequence)
throws FIXMessageException
- Throws:
FIXMessageException
setTargetID
public void setTargetID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setTargetSubID
public void setTargetSubID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setTargetLocationID
public void setTargetLocationID(String id)
throws FIXMessageException
- Throws:
FIXMessageException
setDateValue
public void setDateValue(int tag,
int pos,
Calendar cal)
throws FIXMessageException
- Throws:
FIXMessageException
setStringValue
public void setStringValue(int tag,
int pos,
String str)
throws FIXMessageException
- Throws:
FIXMessageException
insertStringField
public void insertStringField(int tag,
int pos,
String value)
throws FIXMessageException
- Throws:
FIXMessageException
insertRawField
public void insertRawField(int tag,
int pos,
byte[] value)
throws FIXMessageException
- Throws:
FIXMessageException
insertLongField
public void insertLongField(int tag,
int pos,
long value)
throws FIXMessageException
- Throws:
FIXMessageException
insertDoubleField
public void insertDoubleField(int tag,
int pos,
double value)
throws FIXMessageException
- Throws:
FIXMessageException
insertDateTimeField
public void insertDateTimeField(int tag,
int pos,
Calendar value)
throws FIXMessageException
- Throws:
FIXMessageException
setStringField
public void setStringField(int index,
String value)
throws FIXMessageException
- Throws:
FIXMessageException
setLongField
public void setLongField(int index,
long value)
throws FIXMessageException
- Throws:
FIXMessageException
setDoubleField
public void setDoubleField(int index,
double value)
throws FIXMessageException
- Throws:
FIXMessageException
setDateTimeField
public void setDateTimeField(int index,
Calendar value)
throws FIXMessageException
- Throws:
FIXMessageException
setRawField
public void setRawField(int index,
byte[] value)
throws FIXMessageException
- Throws:
FIXMessageException
setVersion
public void setVersion(FIXVersion fixVersion)
throws FIXMessageException
- Throws:
FIXMessageException
getVersion
public FIXVersion getVersion()
toFIXBlock
public byte[] toFIXBlock()
toString
public String toString()
- Overrides:
toString
in class Object
areAllReqTagsPresent
public boolean areAllReqTagsPresent(boolean checkOnlyApp,
List errors)
hasValidMessageType
public boolean hasValidMessageType()
validateMessage
public boolean validateMessage(List errors)
getCustomFields
public List getCustomFields()
getBytes
public byte[] getBytes()
- Specified by:
getBytes
in interface Message
writeTo
public void writeTo(OutputStream out)
throws IOException
- Specified by:
writeTo
in interface Message
- Throws:
IOException
toFIXFieldList
public FIXFieldList toFIXFieldList()
Copyright © 2000-2014 EPAM Systems. All Rights Reserved.