fix协议介绍7-序列号重置
2013-12-13 11:39
453 查看
FIX.5.0SP2 Message
SequenceReset [type '4']
The sequence reset message is used by the sending application to reset the incoming sequence number on the opposing side.Added FIX.2.7
Expand Components | Collapse Components
Field or Component | Field Name | FIXML name | Req'd | Comments | Depr. |
---|
Component | StandardHeader | BaseHeader | MsgType = 4 |
123 | GapFillFlag | |||||
36 | NewSeqNo |
Component | StandardTrailer |
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-11-27 */ public class SequenceResetMsg extends BaseMsg { private Tag gapFillFlag=new Tag("123","Boolean",false); private Tag newSeqNo=new Tag("36","SeqNum",true); private Set<String> tagIdsSet=new HashSet<String>(); public SequenceResetMsg(){ tagIdsSet.add("123"); tagIdsSet.add("36"); this.getBodyEntity().getBodyTagList().add(gapFillFlag); this.getBodyEntity().getBodyTagList().add(newSeqNo); } @Override public void decodeBody() { Set<String> already=new HashSet<String>(); String[] bodyItems=this.body.split(BaseMsg.SOH); for(int i=0;i<bodyItems.length;i++){ String[]tagItems=bodyItems[i].split("="); if(tagItems.length!=2){ throw new InValidDataException("消息格式错误"); } String tagId=tagItems[0]; if(already.contains(tagId)){ throw new InValidDataException("消息格式错误"); } already.add(tagId); if(this.tagIdsSet.contains(tagId)){ List<Tag> tagList=this.bodyEntity.getBodyTagList(); for(int j=0;j<tagList.size();j++){ Tag tag=tagList.get(j); if(tag.getTagId().equals(tagId)){ tag.setTagValue(tagItems[1]); break; } } }else{ throw new InValidDataException("消息格式错误,"+tagId+"不在消息体内"); } } } @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(); } public Tag getGapFillFlag() { return gapFillFlag; } public void setGapFillFlag(Tag gapFillFlag) { this.gapFillFlag = gapFillFlag; } public Tag getNewSeqNo() { return newSeqNo; } public void setNewSeqNo(Tag newSeqNo) { this.newSeqNo = newSeqNo; } public Set<String> getTagIdsSet() { return tagIdsSet; } public void setTagIdsSet(Set<String> tagIdsSet) { this.tagIdsSet = tagIdsSet; } }
相关文章推荐
- fix协议介绍3-登出消息
- fix协议介绍6-重发消息
- fix协议介绍8-Reject消息
- fix协议介绍9-下单(NewOrderSingle)
- fix协议介绍14-批量取消订单(OrderMassCancelRequest)
- Fix协议介绍10-取消订单请求(OrderCancelRequest)
- fix协议介绍15-批量取消订单执行报告(OrderMassCancelReport)
- fix协议介绍11-修改订单(OrderCacelReplaceRequest)
- fix协议介绍16-查询叮当(quote)
- fix协议介绍12-取消订单被拒(OrderCacelReject)
- fix协议介绍17-查询订单状态报告(QuoteStateReport)
- fix协议介绍13-执行报告(ExecutionReport)
- fix协议介绍18-取消查询订单(QuoteCancel)
- fix协议介绍-常用资源
- fix协议介绍19-交易报告(TradeCaptureReport )
- fix协议介绍2-登入消息
- fix协议介绍20-TradeCaptureReportAck
- fix协议介绍4-心跳
- Fix协议介绍21-party信息查询(PartyEntitlementsRequest )
- fix协议介绍5-测试消息