/** * <p>Prepare a message.</p> * * @param message a message * @param msgType the MsgType(35) * @see #prepare(FIXMessage, char) */ public void prepare(FIXMessage message, CharSequence msgType) { message.reset(); message.addField(MsgType).setString(msgType); prepare(message); }
/** * <p>Prepare a message.</p> * * @param message a message * @param msgType the MsgType(35) * @see #prepare(FIXMessage, char) */ public void prepare(FIXMessage message, CharSequence msgType) { message.reset(); message.addField(MsgType).setString(msgType); prepare(message); }
/** * Read this message from a buffer. * * @param buffer a buffer * @return true if this message was successfully read from the buffer, * otherwise false * @throws FIXMessageOverflowException if the number of fields exceeds the * maximum number of fields * @throws FIXValueOverflowException if the length of a value exceeds the * capacity of the value container */ public boolean get(ByteBuffer buffer) throws FIXMessageOverflowException, FIXValueOverflowException { reset(); while (buffer.hasRemaining()) { if (count == tags.length) throw new FIXMessageOverflowException("Too many fields"); int tag = FIXTags.get(buffer); if (tag == 0) return false; tags[count] = tag; if (!values[count].get(buffer)) return false; count++; } return true; }
/** * Read this message from a buffer. * * @param buffer a buffer * @return true if this message was successfully read from the buffer, * otherwise false * @throws FIXMessageOverflowException if the number of fields exceeds the * maximum number of fields * @throws FIXValueOverflowException if the length of a value exceeds the * capacity of the value container */ public boolean get(ByteBuffer buffer) throws FIXMessageOverflowException, FIXValueOverflowException { reset(); while (buffer.hasRemaining()) { if (count == tags.length) tooManyFields(); int tag = FIXTags.get(buffer); if (tag == 0) return false; tags[count] = tag; if (!values[count].get(buffer)) return false; count++; } return true; }
/** * <p>Prepare a message. When preparing a message, the following mandatory * fields are added:</p> * * <ul> * <li>MsgType(35)</li> * <li>SenderCompID(49)</li> * <li>TargetCompID(56)</li> * <li>MsgSeqNum(34)</li> * <li>SendingTime(52)</li> * </ul> * * @param message a message * @param msgType the MsgType(35) */ public void prepare(FIXMessage message, char msgType) { message.reset(); message.addField(MsgType).setChar(msgType); prepare(message); }
/** * <p>Prepare a message. When preparing a message, the following mandatory * fields are added:</p> * * <ul> * <li>MsgType(35)</li> * <li>SenderCompID(49)</li> * <li>TargetCompID(56)</li> * <li>MsgSeqNum(34)</li> * <li>SendingTime(52)</li> * </ul> * * @param message a message * @param msgType the MsgType(35) */ public void prepare(FIXMessage message, char msgType) { message.reset(); message.addField(MsgType).setChar(msgType); prepare(message); }
private void format() { message.reset(); message.addField(MsgType).setChar(OrderSingle); message.addField(SenderCompID).setString("initiator"); message.addField(TargetCompID).setString("acceptor"); message.addField(MsgSeqNum).setInt(2); message.addField(SendingTime).setString("20150924-09:30:05.250"); message.addField(ClOrdID).setString("123"); message.addField(HandlInst).setChar(HandlInstValues.AutomatedExecutionNoIntervention); message.addField(Symbol).setString("FOO"); message.addField(Side).setChar(SideValues.Buy); message.addField(TransactTime).setString("20150924-09:30:05.250"); message.addField(OrdType).setChar(OrdTypeValues.Limit); message.addField(Price).setFloat(150.25, 2); }