0
点赞
收藏
分享

微信扫一扫

fix协议介绍17-查询订单状态报告(QuoteStateReport)


FIX.5.0SP2 Message

QuoteStatusReport [type 'AI']

<QuotStatRpt>



The quote status report message is used:



• as the response to a Quote Status Request message



• as a response to a Quote Cancel message



• as a response to a Quote Response message in a negotiation dialog (see Volume 7 – PRODUCT: FIXED INCOME and USER GROUP: EXCHANGES AND MARKETS)




Added  FIX.4.3

Expand Components | Collapse Components

 

Field or Component

Field Name

FIXML name

Req'd

Comments

Depr.


fix协议介绍17-查询订单状态报告(QuoteStateReport)_sed

fix协议介绍17-查询订单状态报告(QuoteStateReport)_sed_02

fix协议介绍17-查询订单状态报告(QuoteStateReport)_ide_03

fix协议介绍17-查询订单状态报告(QuoteStateReport)_ide_04

fix协议介绍17-查询订单状态报告(QuoteStateReport)_ide_05

fix协议介绍17-查询订单状态报告(QuoteStateReport)_ci_06

fix协议介绍17-查询订单状态报告(QuoteStateReport)_sed_07

fix协议介绍17-查询订单状态报告(QuoteStateReport)_ci_08

fix协议介绍17-查询订单状态报告(QuoteStateReport)_ide_09

  • © 2007 - 2012 FIX Protocol Limited
  • ​​Contact us​​
  • ​​Copyright and Acceptable Use policy​​
  • ​​Privacy Policy​​

消息实现:

package cs.mina.codec.msg;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import cs.mina.exception.InValidDataException;

/*
*@author(huangxiaoping)
*@date 2013-12-2
*/
public class QuoteStatusReportMsg extends BaseMsg {
private Tag parties = new PartiesTag(false);
private Tag instrument = new InstrumentTag(false);
private Tag bidID = new Tag("390", "String", false);
private Tag offerID = new Tag("1867", "String", false);
private Tag quoteType = new Tag("537", "int", false);
private Tag quoteCancelType=new Tag("298","int",false);
private Tag transactTime = new Tag("60", "UTCTimestamp", false);
private Tag quoteMsgID=new Tag("1166","String",false);
private Tag quoteStatus=new Tag("297","int",false);
private Tag quoteRejectReason=new Tag("300","int",false);
private Tag rejectText=new Tag("1328","String",false);

private Set<String> tagIdsSet = new HashSet<String>();

public QuoteStatusReportMsg(){
this.getHeadEntity().getMsgType().setTagValue("AI");
tagIdsSet.add("390");
tagIdsSet.add("1867");
tagIdsSet.add("537");
tagIdsSet.add("298");
tagIdsSet.add("60");
tagIdsSet.add("1166");
tagIdsSet.add("297");
tagIdsSet.add("300");
tagIdsSet.add("1328");
this.bodyEntity.getBodyTagList().add(parties);
this.bodyEntity.getBodyTagList().add(instrument);
this.bodyEntity.getBodyTagList().add(bidID);
this.bodyEntity.getBodyTagList().add(offerID);
this.bodyEntity.getBodyTagList().add(quoteType);
this.bodyEntity.getBodyTagList().add(quoteCancelType);
this.bodyEntity.getBodyTagList().add(transactTime);
this.bodyEntity.getBodyTagList().add(quoteMsgID);
this.bodyEntity.getBodyTagList().add(quoteStatus);
this.bodyEntity.getBodyTagList().add(quoteRejectReason);
this.bodyEntity.getBodyTagList().add(rejectText);
}

@Override
public void decodeBody() {
Set<String> already=new HashSet<String>();
String input=this.body;
while(input.length()!=0){
String firstTagId=input.substring(0, input.indexOf("="));
if(firstTagId.equals("453")){
input=this.getParties().decode(input, already);
}else if(InstrumentTag.tagIdsSet.contains(firstTagId)){
input=this.instrument.decode(input, already);
}else{
List<Tag> tagList=this.bodyEntity.getBodyTagList();
boolean exist=false;
for(int j=0;j<tagList.size();j++){
Tag tag=tagList.get(j);
if(tag.getTagId().equals(firstTagId)){
input=tag.decode(input, already);
exist=true;
break;
}
}
if(!exist){
throw new InValidDataException(firstTagId+"不在消息字段中");
}
}

}
}

@Override
public void validate() {
this.headEntity.validate();
List<Tag> bodyTagList = this.bodyEntity.getBodyTagList();
for (int i = 0; i < bodyTagList.size(); i++) {
bodyTagList.get(i).validate();
}
this.tailerEntity.validate();
if (quoteType.getTagValue() != null) {
if (!(Integer.parseInt(quoteType.getTagValue()) >= 0 && Integer
.parseInt(quoteType.getTagValue()) <= 3)) {
throw new InValidDataException("quoteType错误["
+ quoteType.getTagId() + "=" + quoteType.getTagValue()
+ "]");
}
}
if(quoteCancelType.getTagValue()!=null){
if(!(Integer.parseInt(quoteCancelType.getTagValue())>=1&&Integer.parseInt(quoteCancelType.getTagValue())<=8)){
throw new InValidDataException("quoteCancelType错误["
+ quoteCancelType.getTagId() + "=" + quoteCancelType.getTagValue()
+ "]");
}
}
if(quoteStatus.getTagValue()!=null){
if(!(Integer.parseInt(quoteStatus.getTagValue())>=0&&Integer.parseInt(quoteStatus.getTagValue())<=20)){
throw new InValidDataException("quoteStatus错误["
+ quoteStatus.getTagId() + "=" + quoteStatus.getTagValue()
+ "]");
}
}
if(quoteRejectReason.getTagValue()!=null){
if(!(Integer.parseInt(quoteRejectReason.getTagValue())>=1&&Integer.parseInt(quoteRejectReason.getTagValue())<=13||Integer.parseInt(quoteRejectReason.getTagValue())==99)){
throw new InValidDataException("quoteRejectReason错误["
+ quoteRejectReason.getTagId() + "=" + quoteRejectReason.getTagValue()
+ "]");
}
}
}

public Tag getParties() {
return parties;
}

public void setParties(Tag parties) {
this.parties = parties;
}

public Tag getInstrument() {
return instrument;
}

public void setInstrument(Tag instrument) {
this.instrument = instrument;
}

public Tag getBidID() {
return bidID;
}

public void setBidID(Tag bidID) {
this.bidID = bidID;
}

public Tag getOfferID() {
return offerID;
}

public void setOfferID(Tag offerID) {
this.offerID = offerID;
}

public Tag getQuoteType() {
return quoteType;
}

public void setQuoteType(Tag quoteType) {
this.quoteType = quoteType;
}

public Tag getQuoteCancelType() {
return quoteCancelType;
}

public void setQuoteCancelType(Tag quoteCancelType) {
this.quoteCancelType = quoteCancelType;
}

public Tag getTransactTime() {
return transactTime;
}

public void setTransactTime(Tag transactTime) {
this.transactTime = transactTime;
}

public Tag getQuoteMsgID() {
return quoteMsgID;
}

public void setQuoteMsgID(Tag quoteMsgID) {
this.quoteMsgID = quoteMsgID;
}

public Tag getQuoteStatus() {
return quoteStatus;
}

public void setQuoteStatus(Tag quoteStatus) {
this.quoteStatus = quoteStatus;
}

public Tag getQuoteRejectReason() {
return quoteRejectReason;
}

public void setQuoteRejectReason(Tag quoteRejectReason) {
this.quoteRejectReason = quoteRejectReason;
}

public Tag getRejectText() {
return rejectText;
}

public void setRejectText(Tag rejectText) {
this.rejectText = rejectText;
}

public Set<String> getTagIdsSet() {
return tagIdsSet;
}

public void setTagIdsSet(Set<String> tagIdsSet) {
this.tagIdsSet = tagIdsSet;
}

}


消息处理:略



举报

相关推荐

0 条评论