/** * Gets the market depth for the given message. * * @param inMessage a <code>Message</code> value * @return an <code>int</code> * @throws FieldNotFound if the given message does not contain market depth information */ private static int getMarketDepth(Message inMessage) throws FieldNotFound { return inMessage.getInt(MarketDepth.FIELD); }
/** * Retrieves the total number of symbols in the given message. * * @param inMessage a <code>Message</code> value * @return an <code>int</code> value * @throws CoreException if the number of symbols could not be determined */ public static int determineTotalSymbols(Message inMessage) throws CoreException { try { return inMessage.getInt(NoRelatedSym.FIELD); } catch (FieldNotFound e) { throw new CoreException(e); } } }
/** * Get the MDEntry groups from the given message. * * @param inMessage a <code>Message</code> value * @return a <code>List<:Group></code> value * @throws FieldNotFound if the groups could not be extracted */ public List<Group> getMdEntriesFromMessage(Message inMessage) throws FieldNotFound { List<Group> mdEntries = Lists.newArrayList(); int noMdEntries = inMessage.getInt(quickfix.field.NoMDEntries.FIELD); for(int i=1;i<=noMdEntries;i++) { Group mdEntryGroup = createGroup(inMessage.getHeader().getString(quickfix.field.MsgType.FIELD), quickfix.field.NoMDEntries.FIELD); mdEntryGroup = inMessage.getGroup(i, mdEntryGroup); mdEntries.add(mdEntryGroup); } return mdEntries; } /**
private static void addGroupsToMap(Message marketDataMessage, FIXMessageFactory factory, HashMap<Character, Group> consolidatingSet){ try { int noMDEntries = marketDataMessage.getInt(NoMDEntries.FIELD); String msgType = marketDataMessage.getHeader().getString(MsgType.FIELD); for (int i = 1; i <= noMDEntries; i++){ Group group = factory.createGroup(msgType, NoMDEntries.FIELD); try { marketDataMessage.getGroup(i, group); consolidatingSet.put(group.getChar(MDEntryType.FIELD), group); } catch (FieldNotFound e) { //just continue } } } catch (FieldNotFound e) { // ignore } } /**
private FieldMap extractGroup(Message message, Integer groupID, Integer groupDiscriminatorID, Object groupDiscriminatorValue) { FieldMap map = null; try { Group aGroup = messageFactory.createGroup(message.getHeader().getString(MsgType.FIELD), groupID); if (aGroup !=null){ int groupTag = aGroup.getFieldTag(); int numGroups = message.getInt(groupTag); String discriminatorString = groupDiscriminatorValue.toString(); for (int i = 1; i<= numGroups; i++){ message.getGroup(i, aGroup); String messageDiscriminatorValue = aGroup.getString(groupDiscriminatorID); if (discriminatorString.equals(messageDiscriminatorValue)){ return aGroup; } } } else { return null; } } catch (FieldNotFound e) { } return map; } /**
private void nextResendRequest(Message resendRequest) throws IOException, RejectLogon, FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType, InvalidMessage { // QFJ-653: Check if seqnums are too low. // QFJ-673: Do not check if seqnums are too high in verify() since in case of a seqnum mismatch this will // enqueue the ResendRequest for later processing. This might lead to a deadlock situation in // which the counterparty waits for our messages to be resent and we are also waiting for our // ResendRequest to be satisfied in order to process the queued ResendRequest of the counterparty. // Instead, send out the requested messages and afterwards enqueue the ResendRequest in order to // later increase the target seqnum in method nextQueued(int). if (!verify(resendRequest, false, validateSequenceNumbers)) { return; } final int msgSeqNum = resendRequest.getHeader().getInt(MsgSeqNum.FIELD); if (validateSequenceNumbers && isTargetTooHigh(msgSeqNum)) { enqueueMessage(resendRequest, msgSeqNum); } final int beginSeqNo = resendRequest.getInt(BeginSeqNo.FIELD); final int endSeqNo = resendRequest.getInt(EndSeqNo.FIELD); getLog().onEvent( "Received ResendRequest FROM: " + beginSeqNo + " TO: " + formatEndSeqNum(endSeqNo)); manageGapFill(resendRequest, beginSeqNo, endSeqNo); }
private void nextResendRequest(Message resendRequest) throws IOException, RejectLogon, FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType, InvalidMessage { // QFJ-653: Check if seqnums are too low. // QFJ-673: Do not check if seqnums are too high in verify() since in case of a seqnum mismatch this will // enqueue the ResendRequest for later processing. This might lead to a deadlock situation in // which the counterparty waits for our messages to be resent and we are also waiting for our // ResendRequest to be satisfied in order to process the queued ResendRequest of the counterparty. // Instead, send out the requested messages and afterwards enqueue the ResendRequest in order to // later increase the target seqnum in method nextQueued(int). if (!verify(resendRequest, false, validateSequenceNumbers)) { return; } final int msgSeqNum = resendRequest.getHeader().getInt(MsgSeqNum.FIELD); if (validateSequenceNumbers && isTargetTooHigh(msgSeqNum)) { enqueueMessage(resendRequest, msgSeqNum); } final int beginSeqNo = resendRequest.getInt(BeginSeqNo.FIELD); final int endSeqNo = resendRequest.getInt(EndSeqNo.FIELD); getLog().onEvent( "Received ResendRequest FROM: " + beginSeqNo + " TO: " + formatEndSeqNum(endSeqNo)); manageGapFill(resendRequest, beginSeqNo, endSeqNo); }
private void nextResendRequest(Message resendRequest) throws IOException, RejectLogon, FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType, InvalidMessage { // QFJ-653: Check if seqnums are too low. // QFJ-673: Do not check if seqnums are too high in verify() since in case of a seqnum mismatch this will // enqueue the ResendRequest for later processing. This might lead to a deadlock situation in // which the counterparty waits for our messages to be resent and we are also waiting for our // ResendRequest to be satisfied in order to process the queued ResendRequest of the counterparty. // Instead, send out the requested messages and afterwards enqueue the ResendRequest in order to // later increase the target seqnum in method nextQueued(int). if (!verify(resendRequest, false, validateSequenceNumbers)) { return; } final int msgSeqNum = resendRequest.getHeader().getInt(MsgSeqNum.FIELD); if (validateSequenceNumbers && isTargetTooHigh(msgSeqNum)) { enqueueMessage(resendRequest, msgSeqNum); } final int beginSeqNo = resendRequest.getInt(BeginSeqNo.FIELD); final int endSeqNo = resendRequest.getInt(EndSeqNo.FIELD); getLog().onEvent( "Received ResendRequest FROM: " + beginSeqNo + " TO: " + formatEndSeqNum(endSeqNo)); manageGapFill(resendRequest, beginSeqNo, endSeqNo); }
final int heartbeatInterval = message.getInt(HeartBtInt.FIELD); qfSession.setHeartBeatInterval(heartbeatInterval); sessionLog.onEvent("Acceptor heartbeat set to " + heartbeatInterval
final int heartbeatInterval = message.isSetField(HeartBtInt.FIELD) ? message.getInt(HeartBtInt.FIELD) : 0; qfSession.setHeartBeatInterval(heartbeatInterval); sessionLog.onEvent("Acceptor heartbeat set to " + heartbeatInterval
final int heartbeatInterval = message.isSetField(HeartBtInt.FIELD) ? message.getInt(HeartBtInt.FIELD) : 0; qfSession.setHeartBeatInterval(heartbeatInterval); sessionLog.onEvent("Acceptor heartbeat set to " + heartbeatInterval
logon.setBoolean(ResetSeqNumFlag.FIELD, true); logon.setInt(HeartBtInt.FIELD, otherLogon.getInt(HeartBtInt.FIELD)); if (sessionID.isFIXT()) { logon.setField(senderDefaultApplVerID);
logon.setBoolean(ResetSeqNumFlag.FIELD, true); logon.setInt(HeartBtInt.FIELD, otherLogon.getInt(HeartBtInt.FIELD)); if (sessionID.isFIXT()) { logon.setField(senderDefaultApplVerID);
logon.setBoolean(ResetSeqNumFlag.FIELD, true); logon.setInt(HeartBtInt.FIELD, otherLogon.getInt(HeartBtInt.FIELD)); if (sessionID.isFIXT()) { logon.setField(senderDefaultApplVerID);
final int newSequence = sequenceReset.getInt(NewSeqNo.FIELD);
final int newSequence = sequenceReset.getInt(NewSeqNo.FIELD);
final int newSequence = sequenceReset.getInt(NewSeqNo.FIELD);