private boolean isMatching(SessionID pattern, SessionID sessionID) { return isMatching(pattern.getBeginString(), sessionID.getBeginString()) && isMatching(pattern.getSenderCompID(), sessionID.getSenderCompID()) && isMatching(pattern.getSenderSubID(), sessionID.getSenderSubID()) && isMatching(pattern.getSenderLocationID(), sessionID.getSenderLocationID()) && isMatching(pattern.getTargetCompID(), sessionID.getTargetCompID()) && isMatching(pattern.getTargetSubID(), sessionID.getTargetSubID()) && isMatching(pattern.getTargetLocationID(), sessionID.getTargetLocationID()); }
/** * Remove the extra fields added to the session ID in QF-272. */ private SessionID reduceSessionID(SessionID sessionID) { // Acceptors don't use qualifiers. return new SessionID(sessionID.getBeginString(), sessionID.getSenderCompID(), sessionID.getTargetCompID()); } }
EventLog(String path, SessionID sessionID) throws FileNotFoundException { String sessionName = sessionID.getBeginString() + "-" + sessionID.getSenderCompID() + "-" //$NON-NLS-1$ //$NON-NLS-2$ + sessionID.getTargetCompID(); this.sessionID = sessionID; if (sessionID.getSessionQualifier() != null && sessionID.getSessionQualifier().length() > 0) { sessionName += "-" + sessionID.getSessionQualifier(); //$NON-NLS-1$ } String prefix = fileAppendPath(path, sessionName + "."); //$NON-NLS-1$ eventFileName = prefix + "event.log"; //$NON-NLS-1$ File directory = new File(eventFileName).getParentFile(); if (!directory.exists()) { directory.mkdirs(); } openLogStreams(true); }
private void updateSessionIDFields() { if (!settings.containsKey(BEGIN_STRING_KEY)){ settings.put(BEGIN_STRING_KEY, cachedSessionID.getBeginString()); } if (!settings.containsKey(SENDER_COMP_ID_KEY)){ settings.put(SENDER_COMP_ID_KEY, cachedSessionID.getSenderCompID()); } if (!settings.containsKey(TARGET_COMP_ID_KEY)){ settings.put(TARGET_COMP_ID_KEY, cachedSessionID.getTargetCompID()); } }
private boolean isTargetValid(Map<String, String> fieldValues, SessionID targetSession, boolean beginStrValidation) { String beginString = fieldValues.get(FIXConstants.BEGIN_STRING); String deliverToCompID = fieldValues.get(FIXConstants.DELIVER_TO_COMP_ID); String deliverToSubID = fieldValues.get(FIXConstants.DELIVER_TO_SUB_ID); String deliverToLocationID = fieldValues.get(FIXConstants.DELIVER_TO_LOCATION_ID); if (beginStrValidation && !targetSession.getBeginString().equals(beginString)) { return false; } else if (!targetSession.getTargetCompID().equals(deliverToCompID)) { return false; } else if (deliverToSubID != null && !deliverToSubID.equals(targetSession.getTargetSubID())) { return false; } else if (deliverToLocationID != null && !deliverToLocationID.equals(targetSession.getTargetLocationID())) { return false; } return true; }
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);<<<<<<<<<<<<<<ADD THIS LINE session = new SessionID(); Button login = (Button) findViewById(R.id.home_btn_feature_login); Button logout = (Button) findViewById(R.id.home_btn_feature_logout);
private boolean isCorrectCompID(Message message) throws FieldNotFound { if (!checkCompID) { return true; } final String senderCompID = getSenderCompIDFromMessage(message); final String targetCompID = getTargetCompIDFromMessage(message); return sessionID.getSenderCompID().equals(targetCompID) && sessionID.getTargetCompID().equals(senderCompID); }
public int hashCode() { return toString().hashCode(); }
if (isValidationOn(service) && beginString != null && !beginString.equals(sessionID.getBeginString())) { handleException("BeginString validation is on. Cannot forward messages to a session" + " with a different BeginString"); if (!deliverToCompID.equals(sessionID.getTargetCompID())) { handleException("Cannot forward messages that do not have a valid DeliverToCompID field"); } else { return true; } catch (SessionNotFound e) { log.error("Error while sending the FIX message. Session " + sessionID.toString() + " does" + " not exist", e); return false;
public DataDictionary getDataDictionary() { if (!sessionID.isFIXT()) { // For pre-FIXT sessions, the session data dictionary is the same as the application // data dictionary. return dataDictionaryProvider.getSessionDataDictionary(sessionID.getBeginString()); } else { throw new SessionException("No default data dictionary for FIXT 1.1 and newer"); } }
private UtcTimestampPrecision getTimestampPrecision() { if (sessionID.getBeginString().compareTo(FixVersions.BEGINSTRING_FIX42) >= 0) { return timestampPrecision; } else { return UtcTimestampPrecision.SECONDS; } }
@Override public void onMessage(NewOrderSingle order, SessionID sessionID) throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue { final String broker = sessionID.getTargetCompID(); OrderEntry orderEntry = convertToOrderEntry(order, broker); acceptOrder(orderEntry); final String symbol = order.getSymbol().getValue(); orderPublisher.publish(symbol, orderEntry, OrderEntry.class); // TODO: this is going away soon when subscribe is ready on the matching engine side matchingUnit.addOrder(orderEntry); }
public String getTargetSubID() { return session.getSessionID().getTargetSubID(); }
public String getSenderSubID() { return session.getSessionID().getSenderSubID(); }
public String getTargetLocationID() { return session.getSessionID().getTargetLocationID(); }
public String getSenderLocationID() { return session.getSessionID().getSenderLocationID(); }
private void storeSection(String currentSectionId, Properties currentSection) { if (currentSectionId != null && currentSectionId.equals(SESSION_SECTION_NAME)) { final SessionID sessionId = new SessionID(currentSection.getProperty(BEGINSTRING), currentSection.getProperty(SENDERCOMPID), currentSection.getProperty(SENDERSUBID), currentSection.getProperty(SENDERLOCID), currentSection.getProperty(TARGETCOMPID), currentSection.getProperty(TARGETSUBID), currentSection.getProperty(TARGETLOCID), currentSection.getProperty(SESSION_QUALIFIER)); sections.put(sessionId, currentSection); } }
private boolean isCorrectCompID(Message message) throws FieldNotFound { if (!checkCompID) { return true; } final String senderCompID = getSenderCompIDFromMessage(message); final String targetCompID = getTargetCompIDFromMessage(message); return sessionID.getSenderCompID().equals(targetCompID) && sessionID.getTargetCompID().equals(senderCompID); }
public int hashCode() { return toString().hashCode(); }
public DataDictionary getDataDictionary() { if (!sessionID.isFIXT()) { // For pre-FIXT sessions, the session data dictionary is the same as the application // data dictionary. return dataDictionaryProvider.getSessionDataDictionary(sessionID.getBeginString()); } else { throw new SessionException("No default data dictionary for FIXT 1.1 and newer"); } }