SessionSettings { public Iterator<SessionID> sectionIterator() { final HashSet<SessionID> nondefaultSessions = new HashSet<>(sections.keySet()); nondefaultSessions.remove(DEFAULT_SESSION_ID); return nondefaultSessions.iterator(); } SessionSettings();  SessionSettings(Properties variableValues);  SessionSettings(String filename, Properties variableValues);  SessionSettings(String filename);  SessionSettings(InputStream stream);  SessionSettings(InputStream stream, Properties variableValues); String getString(String key); String getString(SessionID sessionID, String key); Properties getSessionProperties(SessionID sessionID, boolean includeDefaults); Properties getSessionProperties(SessionID sessionID); Properties getDefaultProperties(); long getLong(String key); long getLong(SessionID sessionID, String key); int getInt(String key); int getInt(SessionID sessionID, String key); double getDouble(String key); double getDouble(SessionID sessionID, String key); boolean getBool(String key); boolean getBool(SessionID sessionID, String key); void setString(SessionID sessionID, String key, String value); void setLong(SessionID sessionID, String key, long value); void setDouble(SessionID sessionID, String key, double value); void setBool(SessionID sessionID, String key, boolean value); Iterator<SessionID> sectionIterator(); boolean isSetting(String key); boolean isSetting(SessionID sessionID, String key); void removeSetting(SessionID sessionID, String key); void setVariableValues(Properties variableValues); void set(Map<Object, Object> defaults); void setBool(String key, boolean value); void setDouble(String key, double value); void setLong(String key, long value); void setString(String key, String value); int size(); Dictionary get(SessionID sessionID); void set(SessionID sessionID, Dictionary dictionary); Dictionary get(); void set(Dictionary dictionary); void toString(PrintWriter writer); void toStream(OutputStream out); @Override String toString(); static int[] parseSettingReconnectInterval(String raw); static Set<InetAddress> parseRemoteAddresses(String raw); static final String BEGINSTRING; static final String SENDERCOMPID; static final String SENDERSUBID; static final String SENDERLOCID; static final String TARGETCOMPID; static final String TARGETSUBID; static final String TARGETLOCID; static final String SESSION_QUALIFIER; }
@Test public void testExtendedSettings() throws ConfigError { String settingsString = ""; settingsString += "[SESSION]\n"; settingsString += "BeginString=FIX.4.2\n"; settingsString += "SenderCompID=Company\n"; settingsString += "SenderSubID=FixedIncome\n"; settingsString += "SenderLocationID=HongKong\n"; settingsString += "TargetCompID=CLIENT1\n"; settingsString += "TargetSubID=HedgeFund\n"; settingsString += "TargetLocationID=NYC\n"; final SessionSettings settings = new SessionSettings(new ByteArrayInputStream( settingsString.getBytes())); final SessionID id = settings.sectionIterator().next(); assertEquals("Company", id.getSenderCompID()); assertEquals("FixedIncome", id.getSenderSubID()); assertEquals("HongKong", id.getSenderLocationID()); assertEquals("CLIENT1", id.getTargetCompID()); assertEquals("HedgeFund", id.getTargetSubID()); assertEquals("NYC", id.getTargetLocationID()); }
@Test public void testSessionKeyIterator() throws Exception { final SessionSettings settings = setUpSession(); final Iterator<SessionID> itr = settings.sectionIterator(); while (itr.hasNext()) { final SessionID id = itr.next(); assertEquals("FIX", id.getBeginString().substring(0, 3)); assertEquals("", id.getSessionQualifier()); } }