/** * Get the data dictionary for the given session. * * @param inSessionId a <code>Message</code> value * @return a <code>DataDictionary</code> value * @throws FieldNotFound if the FIX version could not be determined from the given message * @throws UnsupportedOperationException if the given session ID does not correspond to an active session */ public static DataDictionary getDataDictionary(SessionID inSessionId) throws FieldNotFound { Session session = Session.lookupSession(inSessionId); if(session == null) { throw new UnsupportedOperationException(Messages.MISSING_SESSION.getText(session)); } quickfix.field.ApplVerID applVerId = session.getTargetDefaultApplicationVersionID(); return getDataDictionary(FIXVersion.getFIXVersion(applVerId)); } /**
private static ApplVerID getApplVerID(Session session, String messageString) throws InvalidMessage { ApplVerID applVerID = null; final String applVerIdString = getStringField(messageString, ApplVerID.FIELD); if (applVerIdString != null) { applVerID = new ApplVerID(applVerIdString); } if (applVerID == null) { applVerID = session.getTargetDefaultApplicationVersionID(); } if (applVerID == null && isLogon(messageString)) { final String defaultApplVerIdString = getStringField(messageString, DefaultApplVerID.FIELD); if (defaultApplVerIdString != null) { applVerID = new ApplVerID(defaultApplVerIdString); } } if (applVerID == null) { throw new InvalidMessage("Can't determine ApplVerID for message"); } return applVerID; }
private static ApplVerID getApplVerID(Session session, String messageString) throws InvalidMessage { ApplVerID applVerID = null; final String applVerIdString = getStringField(messageString, ApplVerID.FIELD); if (applVerIdString != null) { applVerID = new ApplVerID(applVerIdString); } if (applVerID == null) { applVerID = session.getTargetDefaultApplicationVersionID(); } if (applVerID == null && isLogon(messageString)) { final String defaultApplVerIdString = getStringField(messageString, DefaultApplVerID.FIELD); if (defaultApplVerIdString != null) { applVerID = new ApplVerID(defaultApplVerIdString); } } if (applVerID == null) { throw newInvalidMessageException("Can't determine ApplVerID from message " + messageString, getMinimalMessage(messageString)); } return applVerID; }
private static ApplVerID getApplVerID(Session session, String messageString) throws InvalidMessage { ApplVerID applVerID = null; final String applVerIdString = getStringField(messageString, ApplVerID.FIELD); if (applVerIdString != null) { applVerID = new ApplVerID(applVerIdString); } if (applVerID == null) { applVerID = session.getTargetDefaultApplicationVersionID(); } if (applVerID == null && isLogon(messageString)) { final String defaultApplVerIdString = getStringField(messageString, DefaultApplVerID.FIELD); if (defaultApplVerIdString != null) { applVerID = new ApplVerID(defaultApplVerIdString); } } if (applVerID == null) { throw newInvalidMessageException("Can't determine ApplVerID from message " + messageString, getMinimalMessage(messageString)); } return applVerID; }
/** * Get the <code>FIXVersion</code> of the given message. * * @param inMessage a <code>Message</code> value * @return a <code>FIXVersion</code> value * @throws FieldNotFound if the given message is malformed and the version cannot be identified * @throws IllegalArgumentException if the FIX version of the given message is unsupported */ public static FIXVersion getFIXVersion(Message inMessage) throws FieldNotFound { SessionID sessionId = MessageUtils.getSessionID(inMessage); if(sessionId.isFIXT()) { if(inMessage.getHeader().isSetField(quickfix.field.ApplVerID.FIELD)) { return doFixApplicationVersionLookup(inMessage.getHeader().getString(quickfix.field.ApplVerID.FIELD)); } // this is a FIXT message _and_ ApplVerID is _not_ set, we need to know something about the session Session session = Session.lookupSession(sessionId); if(session == null) { throw new UnsupportedOperationException(Messages.APPL_VERID_REQUIRED.getText()); } quickfix.field.ApplVerID defaultAppVerId = session.getTargetDefaultApplicationVersionID(); return getFIXVersion(defaultAppVerId); } else { return doFixVersionLookup(inMessage.getHeader().getString(quickfix.field.BeginString.FIELD)); } } /**