/** * Return the settings for a session as a Properties object. * * @param sessionID * @return the Properties object with the session settings * @throws ConfigError * @see java.util.Properties */ public Properties getSessionProperties(SessionID sessionID) throws ConfigError { return getSessionProperties(sessionID, false); }
/** * Return the settings for a session as a Properties object. * * @param sessionID * @return the Properties object with the session settings * @throws ConfigError * @see java.util.Properties */ public Properties getSessionProperties(SessionID sessionID) throws ConfigError { return getSessionProperties(sessionID, false); }
/** * Return the settings for a session as a Properties object. * * @param sessionID * @return the Properties object with the session settings * @throws ConfigError * @see java.util.Properties */ public Properties getSessionProperties(SessionID sessionID) throws ConfigError { return getSessionProperties(sessionID, false); }
/** * Returns the defaults for the session-level settings. * * @return the default properties * @throws ConfigError */ public Properties getDefaultProperties() { try { return getSessionProperties(DEFAULT_SESSION_ID); } catch (final ConfigError e) { // shouldn't happen return new Properties(); } }
/** * Returns the defaults for the session-level settings. * * @return the default properties * @throws ConfigError */ public Properties getDefaultProperties() { try { return getSessionProperties(DEFAULT_SESSION_ID); } catch (final ConfigError e) { // shouldn't happen return new Properties(); } }
/** * Returns the defaults for the session-level settings. * * @return the default properties * @throws ConfigError */ public Properties getDefaultProperties() { try { return getSessionProperties(DEFAULT_SESSION_ID); } catch (final ConfigError e) { // shouldn't happen return new Properties(); } }
public SessionSettingsAdmin(SessionID sessionID, SessionSettings settings) throws ConfigError { this.sessionID = sessionID; Properties p = new Properties(); p.putAll(settings.getDefaultProperties()); p.putAll(settings.getSessionProperties(sessionID)); this.settings = p; }
public SessionSettingsAdmin(SessionID sessionID, SessionSettings settings) throws ConfigError { this.sessionID = sessionID; Properties p = new Properties(); p.putAll(settings.getDefaultProperties()); p.putAll(settings.getSessionProperties(sessionID)); this.settings = p; }
public SessionSettingsAdmin(SessionID sessionID, SessionSettings settings) throws ConfigError { this.sessionID = sessionID; Properties p = new Properties(); p.putAll(settings.getDefaultProperties()); p.putAll(settings.getSessionProperties(sessionID)); this.settings = p; }
public Dictionary get(SessionID sessionID) throws ConfigError { return new Dictionary(null, getSessionProperties(sessionID)); }
public Dictionary get(SessionID sessionID) throws ConfigError { return new Dictionary(null, getSessionProperties(sessionID)); }
public Dictionary get(SessionID sessionID) throws ConfigError { return new Dictionary(null, getSessionProperties(sessionID)); }
/** * Get a settings string. * * @param sessionID the session ID * @param key the settings key * @return the string value for the setting * @throws ConfigError configuration error, probably a missing setting. */ public String getString(SessionID sessionID, String key) throws ConfigError { final String value = interpolate(getSessionProperties(sessionID).getProperty(key)); if (value == null) { throw new ConfigError(key + " not defined"); } return value; }
/** * Get a settings string. * * @param sessionID the session ID * @param key the settings key * @return the string value for the setting * @throws ConfigError configuration error, probably a missing setting. */ public String getString(SessionID sessionID, String key) throws ConfigError { final String value = interpolate(getSessionProperties(sessionID).getProperty(key)); if (value == null) { throw new ConfigError(key + " not defined"); } return value; }
/** * Get a settings string. * * @param sessionID the session ID * @param key the settings key * @return the string value for the setting * @throws ConfigError configuration error, probably a missing setting. * @throws FieldConvertError error during field type conversion. */ public String getString(SessionID sessionID, String key) throws ConfigError, FieldConvertError { final String value = interpolate(getSessionProperties(sessionID).getProperty(key)); if (value == null) { throw new ConfigError(key + " not defined"); } return value; }
public void toString(PrintWriter writer) { try { writeSection("[DEFAULT]", writer, getDefaultProperties()); final Iterator<SessionID> s = sectionIterator(); while (s.hasNext()) { try { writeSection("[SESSION]", writer, getSessionProperties(s.next())); } catch (final ConfigError e) { log.error("Invalid session", e); } } } finally { writer.flush(); } }
public void toString(PrintWriter writer) { try { writeSection("[DEFAULT]", writer, getDefaultProperties()); final Iterator<SessionID> s = sectionIterator(); while (s.hasNext()) { try { writeSection("[SESSION]", writer, getSessionProperties(s.next())); } catch (final ConfigError e) { log.error("Invalid session", e); } } } finally { writer.flush(); } }
public void toString(PrintWriter writer) { try { writeSection("[DEFAULT]", writer, getDefaultProperties()); final Iterator<SessionID> s = sectionIterator(); while (s.hasNext()) { try { writeSection("[SESSION]", writer, getSessionProperties(s.next())); } catch (final ConfigError e) { log.error("Invalid session", e); } } } finally { writer.flush(); } }
public synchronized Session getSession(SessionID sessionID, SessionConnector sessionConnector) { Session s = Session.lookupSession(sessionID); if (s == null) { try { SessionID templateID = lookupTemplateID(sessionID); if (templateID == null) { throw new ConfigError("Unable to find a session template for " + sessionID); } SessionSettings dynamicSettings = new SessionSettings(); copySettings(dynamicSettings, settings.getDefaultProperties()); copySettings(dynamicSettings, settings.getSessionProperties(templateID)); dynamicSettings.setString(BEGINSTRING, sessionID.getBeginString()); dynamicSettings.setString(SENDERCOMPID, sessionID.getSenderCompID()); optionallySetValue(dynamicSettings, SENDERSUBID, sessionID.getSenderSubID()); optionallySetValue(dynamicSettings, SENDERLOCID, sessionID.getSenderLocationID()); dynamicSettings.setString(TARGETCOMPID, sessionID.getTargetCompID()); optionallySetValue(dynamicSettings, TARGETSUBID, sessionID.getTargetSubID()); optionallySetValue(dynamicSettings, TARGETLOCID, sessionID.getTargetLocationID()); s = sessionFactory.create(sessionID, dynamicSettings); if (sessionConnector != null) { sessionConnector.addDynamicSession(s); } } catch (ConfigError e) { throw new QFJException(e); } } return s; }
public synchronized Session getSession(SessionID sessionID, SessionConnector sessionConnector) { Session s = Session.lookupSession(sessionID); if (s == null) { try { SessionID templateID = lookupTemplateID(sessionID); if (templateID == null) { throw new ConfigError("Unable to find a session template for " + sessionID); } SessionSettings dynamicSettings = new SessionSettings(); copySettings(dynamicSettings, settings.getDefaultProperties()); copySettings(dynamicSettings, settings.getSessionProperties(templateID)); dynamicSettings.setString(BEGINSTRING, sessionID.getBeginString()); dynamicSettings.setString(SENDERCOMPID, sessionID.getSenderCompID()); optionallySetValue(dynamicSettings, SENDERSUBID, sessionID.getSenderSubID()); optionallySetValue(dynamicSettings, SENDERLOCID, sessionID.getSenderLocationID()); dynamicSettings.setString(TARGETCOMPID, sessionID.getTargetCompID()); optionallySetValue(dynamicSettings, TARGETSUBID, sessionID.getTargetSubID()); optionallySetValue(dynamicSettings, TARGETLOCID, sessionID.getTargetLocationID()); s = sessionFactory.create(sessionID, dynamicSettings); if (sessionConnector != null) { sessionConnector.addDynamicSession(s); } } catch (ConfigError e) { throw new QFJException(e); } } return s; }