SessionSettings.h
Go to the documentation of this file.
/* -*- C++ -*- */
/****************************************************************************
** Copyright (c) 2001-2014
**
** This file is part of the QuickFIX FIX Engine
**
** This file may be distributed under the terms of the quickfixengine.org
** license as defined by quickfixengine.org and appearing in the file
** LICENSE included in the packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.quickfixengine.org/LICENSE for licensing information.
**
** Contact ask@quickfixengine.org if any conditions of this licensing are
** not clear to you.
**
****************************************************************************/
#ifndef FIX_SESSIONSETTINGS_H
#define FIX_SESSIONSETTINGS_H
#ifdef _MSC_VER
#pragma warning( disable : 4503 4355 4786 4290 )
#endif
#include "Dictionary.h"
#include "SessionID.h"
#include "Exceptions.h"
#include <map>
#include <set>
namespace FIX
{
const char BEGINSTRING[] = "BeginString";
const char SENDERCOMPID[] = "SenderCompID";
const char TARGETCOMPID[] = "TargetCompID";
const char SESSION_QUALIFIER[] = "SessionQualifier";
const char DEFAULT_APPLVERID[] = "DefaultApplVerID";
const char CONNECTION_TYPE[] = "ConnectionType";
const char USE_DATA_DICTIONARY[] = "UseDataDictionary";
const char SEND_RESETSEQNUMFLAG[] = "SendResetSeqNumFlag";
const char SEND_REDUNDANT_RESENDREQUESTS[] = "SendRedundantResendRequests";
const char DATA_DICTIONARY[] = "DataDictionary";
const char TRANSPORT_DATA_DICTIONARY[] = "TransportDataDictionary";
const char APP_DATA_DICTIONARY[] = "AppDataDictionary";
const char USE_LOCAL_TIME[] = "UseLocalTime";
const char START_TIME[] = "StartTime";
const char END_TIME[] = "EndTime";
const char START_DAY[] = "StartDay";
const char END_DAY[] = "EndDay";
const char LOGON_TIME[] = "LogonTime";
const char LOGOUT_TIME[] = "LogoutTime";
const char LOGON_DAY[] = "LogonDay";
const char LOGOUT_DAY[] = "LogoutDay";
const char CHECK_COMPID[] = "CheckCompID";
const char CHECK_LATENCY[] = "CheckLatency";
const char MAX_LATENCY[] = "MaxLatency";
const char HEARTBTINT[] = "HeartBtInt";
const char SOCKET_ACCEPT_PORT[] = "SocketAcceptPort";
const char SOCKET_REUSE_ADDRESS[] = "SocketReuseAddress";
const char SOCKET_CONNECT_HOST[] = "SocketConnectHost";
const char SOCKET_CONNECT_PORT[] = "SocketConnectPort";
const char SOCKET_NODELAY[] = "SocketNodelay";
const char SOCKET_SEND_BUFFER_SIZE[] = "SendBufferSize";
const char SOCKET_RECEIVE_BUFFER_SIZE[] = "ReceiveBufferSize";
const char RECONNECT_INTERVAL[] = "ReconnectInterval";
const char VALIDATE_LENGTH_AND_CHECKSUM[] = "ValidateLengthAndChecksum";
const char VALIDATE_FIELDS_OUT_OF_ORDER[] = "ValidateFieldsOutOfOrder";
const char VALIDATE_FIELDS_HAVE_VALUES[] = "ValidateFieldsHaveValues";
const char VALIDATE_USER_DEFINED_FIELDS[] = "ValidateUserDefinedFields";
const char LOGON_TIMEOUT[] = "LogonTimeout";
const char LOGOUT_TIMEOUT[] = "LogoutTimeout";
const char FILE_STORE_PATH[] = "FileStorePath";
const char MYSQL_STORE_USECONNECTIONPOOL[] = "MySQLStoreUseConnectionPool";
const char MYSQL_STORE_DATABASE[] = "MySQLStoreDatabase";
const char MYSQL_STORE_USER[] = "MySQLStoreUser";
const char MYSQL_STORE_PASSWORD[] = "MySQLStorePassword";
const char MYSQL_STORE_HOST[] = "MySQLStoreHost";
const char MYSQL_STORE_PORT[] = "MySQLStorePort";
const char POSTGRESQL_STORE_USECONNECTIONPOOL[] = "PostgreSQLStoreUseConnectionPool";
const char POSTGRESQL_STORE_DATABASE[] = "PostgreSQLStoreDatabase";
const char POSTGRESQL_STORE_USER[] = "PostgreSQLStoreUser";
const char POSTGRESQL_STORE_PASSWORD[] = "PostgreSQLStorePassword";
const char POSTGRESQL_STORE_HOST[] = "PostgreSQLStoreHost";
const char POSTGRESQL_STORE_PORT[] = "PostgreSQLStorePort";
const char ODBC_STORE_USER[] = "OdbcStoreUser";
const char ODBC_STORE_PASSWORD[] = "OdbcStorePassword";
const char ODBC_STORE_CONNECTION_STRING[] = "OdbcStoreConnectionString";
const char FILE_LOG_PATH[] = "FileLogPath";
const char FILE_LOG_BACKUP_PATH[] = "FileLogBackupPath";
const char SCREEN_LOG_SHOW_INCOMING[] = "ScreenLogShowIncoming";
const char SCREEN_LOG_SHOW_OUTGOING[] = "ScreenLogShowOutgoing";
const char SCREEN_LOG_SHOW_EVENTS[] = "ScreenLogShowEvents";
const char MYSQL_LOG_USECONNECTIONPOOL[] = "MySQLLogUseConnectionPool";
const char MYSQL_LOG_DATABASE[] = "MySQLLogDatabase";
const char MYSQL_LOG_USER[] = "MySQLLogUser";
const char MYSQL_LOG_PASSWORD[] = "MySQLLogPassword";
const char MYSQL_LOG_HOST[] = "MySQLLogHost";
const char MYSQL_LOG_PORT[] = "MySQLLogPort";
const char MYSQL_LOG_INCOMING_TABLE[] = "MySQLLogIncomingTable";
const char MYSQL_LOG_OUTGOING_TABLE[] = "MySQLLogOutgoingTable";
const char MYSQL_LOG_EVENT_TABLE[] = "MySQLLogEventTable";
const char POSTGRESQL_LOG_USECONNECTIONPOOL[] = "PostgreSQLLogUseConnectionPool";
const char POSTGRESQL_LOG_DATABASE[] = "PostgreSQLLogDatabase";
const char POSTGRESQL_LOG_USER[] = "PostgreSQLLogUser";
const char POSTGRESQL_LOG_PASSWORD[] = "PostgreSQLLogPassword";
const char POSTGRESQL_LOG_HOST[] = "PostgreSQLLogHost";
const char POSTGRESQL_LOG_PORT[] = "PostgreSQLLogPort";
const char POSTGRESQL_LOG_INCOMING_TABLE[] = "PostgreSQLLogIncomingTable";
const char POSTGRESQL_LOG_OUTGOING_TABLE[] = "PostgreSQLLogOutgoingTable";
const char POSTGRESQL_LOG_EVENT_TABLE[] = "PostgreSQLLogEventTable";
const char ODBC_LOG_USER[] = "OdbcLogUser";
const char ODBC_LOG_PASSWORD[] = "OdbcLogPassword";
const char ODBC_LOG_CONNECTION_STRING[] = "OdbcLogConnectionString";
const char ODBC_LOG_INCOMING_TABLE[] = "OdbcLogIncomingTable";
const char ODBC_LOG_OUTGOING_TABLE[] = "OdbcLogOutgoingTable";
const char ODBC_LOG_EVENT_TABLE[] = "OdbcLogEventTable";
const char RESET_ON_LOGON[] = "ResetOnLogon";
const char RESET_ON_LOGOUT[] = "ResetOnLogout";
const char RESET_ON_DISCONNECT[] = "ResetOnDisconnect";
const char REFRESH_ON_LOGON[] = "RefreshOnLogon";
const char MILLISECONDS_IN_TIMESTAMP[] = "MillisecondsInTimeStamp";
const char HTTP_ACCEPT_PORT[] = "HttpAcceptPort";
const char PERSIST_MESSAGES[] = "PersistMessages";
class SessionSettings
{
public:
SessionSettings() {}
SessionSettings( std::istream& stream ) throw( ConfigError );
SessionSettings( const std::string& file ) throw( ConfigError );
const bool has( const SessionID& ) const;
const Dictionary& get( const SessionID& ) const throw( ConfigError );
void set( const SessionID&, Dictionary ) throw( ConfigError );
const Dictionary& get() const { return m_defaults; }
void set( const Dictionary& defaults ) throw( ConfigError );
size_t size() const { return m_settings.size(); }
typedef std::map < SessionID, Dictionary > Dictionaries;
std::set < SessionID > getSessions() const;
private:
void validate( const Dictionary& ) const throw( ConfigError );
Dictionaries m_settings;
Dictionary m_defaults;
friend std::ostream& operator<<( std::ostream&, const SessionSettings& );
};
std::istream& operator>>( std::istream&, SessionSettings& )
throw( ConfigError );
std::ostream& operator<<( std::ostream&, const SessionSettings& );
}
#endif //FIX_SESSIONSETTINGS_H
FIX::MYSQL_LOG_PORT
const char MYSQL_LOG_PORT[]
Definition: SessionSettings.h:102
FIX::POSTGRESQL_LOG_INCOMING_TABLE
const char POSTGRESQL_LOG_INCOMING_TABLE[]
Definition: SessionSettings.h:112
FIX::SessionSettings::Dictionaries
std::map< SessionID, Dictionary > Dictionaries
Definition: SessionSettings.h:153
FIX::LOGON_TIMEOUT
const char LOGON_TIMEOUT[]
Definition: SessionSettings.h:74
FIX::MYSQL_STORE_PORT
const char MYSQL_STORE_PORT[]
Definition: SessionSettings.h:82
FIX::ODBC_STORE_CONNECTION_STRING
const char ODBC_STORE_CONNECTION_STRING[]
Definition: SessionSettings.h:91
FIX::MYSQL_STORE_PASSWORD
const char MYSQL_STORE_PASSWORD[]
Definition: SessionSettings.h:80
FIX::MYSQL_STORE_USECONNECTIONPOOL
const char MYSQL_STORE_USECONNECTIONPOOL[]
Definition: SessionSettings.h:77
FIX::RESET_ON_LOGON
const char RESET_ON_LOGON[]
Definition: SessionSettings.h:121
FIX::RESET_ON_DISCONNECT
const char RESET_ON_DISCONNECT[]
Definition: SessionSettings.h:123
FIX::ODBC_LOG_EVENT_TABLE
const char ODBC_LOG_EVENT_TABLE[]
Definition: SessionSettings.h:120
FIX::LOGOUT_DAY
const char LOGOUT_DAY[]
Definition: SessionSettings.h:57
FIX::RESET_ON_LOGOUT
const char RESET_ON_LOGOUT[]
Definition: SessionSettings.h:122
FIX::POSTGRESQL_LOG_EVENT_TABLE
const char POSTGRESQL_LOG_EVENT_TABLE[]
Definition: SessionSettings.h:114
FIX::CONNECTION_TYPE
const char CONNECTION_TYPE[]
Definition: SessionSettings.h:42
FIX::LOGOUT_TIME
const char LOGOUT_TIME[]
Definition: SessionSettings.h:55
FIX::VALIDATE_FIELDS_HAVE_VALUES
const char VALIDATE_FIELDS_HAVE_VALUES[]
Definition: SessionSettings.h:72
FIX::MAX_LATENCY
const char MAX_LATENCY[]
Definition: SessionSettings.h:60
FIX::POSTGRESQL_LOG_PASSWORD
const char POSTGRESQL_LOG_PASSWORD[]
Definition: SessionSettings.h:109
FIX::SessionSettings::m_defaults
Dictionary m_defaults
Definition: SessionSettings.h:160
FIX::DEFAULT_APPLVERID
const char DEFAULT_APPLVERID[]
Definition: SessionSettings.h:41
FIX::RECONNECT_INTERVAL
const char RECONNECT_INTERVAL[]
Definition: SessionSettings.h:69
FIX::POSTGRESQL_STORE_USER
const char POSTGRESQL_STORE_USER[]
Definition: SessionSettings.h:85
FIX::SOCKET_NODELAY
const char SOCKET_NODELAY[]
Definition: SessionSettings.h:66
FIX::SOCKET_ACCEPT_PORT
const char SOCKET_ACCEPT_PORT[]
Definition: SessionSettings.h:62
FIX::SEND_REDUNDANT_RESENDREQUESTS
const char SEND_REDUNDANT_RESENDREQUESTS[]
Definition: SessionSettings.h:45
FIX::ODBC_LOG_PASSWORD
const char ODBC_LOG_PASSWORD[]
Definition: SessionSettings.h:116
FIX::SOCKET_CONNECT_HOST
const char SOCKET_CONNECT_HOST[]
Definition: SessionSettings.h:64
FIX::SESSION_QUALIFIER
const char SESSION_QUALIFIER[]
Definition: SessionSettings.h:40
FIX::POSTGRESQL_LOG_DATABASE
const char POSTGRESQL_LOG_DATABASE[]
Definition: SessionSettings.h:107
FIX::BEGINSTRING
const char BEGINSTRING[]
Definition: SessionSettings.h:37
FIX::SOCKET_SEND_BUFFER_SIZE
const char SOCKET_SEND_BUFFER_SIZE[]
Definition: SessionSettings.h:67
FIX::POSTGRESQL_LOG_USER
const char POSTGRESQL_LOG_USER[]
Definition: SessionSettings.h:108
FIX::VALIDATE_FIELDS_OUT_OF_ORDER
const char VALIDATE_FIELDS_OUT_OF_ORDER[]
Definition: SessionSettings.h:71
SessionID.h
FIX::SessionSettings::has
const bool has(const SessionID &) const
Check if session setings are present.
Definition: SessionSettings.cpp:120
FIX::POSTGRESQL_STORE_HOST
const char POSTGRESQL_STORE_HOST[]
Definition: SessionSettings.h:87
FIX::LOGON_TIME
const char LOGON_TIME[]
Definition: SessionSettings.h:54
FIX::POSTGRESQL_LOG_PORT
const char POSTGRESQL_LOG_PORT[]
Definition: SessionSettings.h:111
FIX::MYSQL_LOG_DATABASE
const char MYSQL_LOG_DATABASE[]
Definition: SessionSettings.h:98
FIX::TARGETCOMPID
const char TARGETCOMPID[]
Definition: SessionSettings.h:39
FIX::SessionSettings::getSessions
std::set< SessionID > getSessions() const
Definition: SessionSettings.cpp:158
FIX::END_TIME
const char END_TIME[]
Definition: SessionSettings.h:51
FIX::MYSQL_LOG_INCOMING_TABLE
const char MYSQL_LOG_INCOMING_TABLE[]
Definition: SessionSettings.h:103
FIX::SOCKET_CONNECT_PORT
const char SOCKET_CONNECT_PORT[]
Definition: SessionSettings.h:65
FIX::VALIDATE_USER_DEFINED_FIELDS
const char VALIDATE_USER_DEFINED_FIELDS[]
Definition: SessionSettings.h:73
FIX::SOCKET_RECEIVE_BUFFER_SIZE
const char SOCKET_RECEIVE_BUFFER_SIZE[]
Definition: SessionSettings.h:68
FIX::FILE_LOG_BACKUP_PATH
const char FILE_LOG_BACKUP_PATH[]
Definition: SessionSettings.h:93
FIX::FILE_STORE_PATH
const char FILE_STORE_PATH[]
Definition: SessionSettings.h:76
FIX::POSTGRESQL_LOG_USECONNECTIONPOOL
const char POSTGRESQL_LOG_USECONNECTIONPOOL[]
Definition: SessionSettings.h:106
FIX::POSTGRESQL_STORE_PORT
const char POSTGRESQL_STORE_PORT[]
Definition: SessionSettings.h:88
FIX::SessionSettings::SessionSettings
SessionSettings()
Definition: SessionSettings.h:133
FIX::END_DAY
const char END_DAY[]
Definition: SessionSettings.h:53
FIX::TRANSPORT_DATA_DICTIONARY
const char TRANSPORT_DATA_DICTIONARY[]
Definition: SessionSettings.h:47
FIX::SCREEN_LOG_SHOW_OUTGOING
const char SCREEN_LOG_SHOW_OUTGOING[]
Definition: SessionSettings.h:95
FIX
Definition: Acceptor.cpp:34
FIX::MYSQL_LOG_USECONNECTIONPOOL
const char MYSQL_LOG_USECONNECTIONPOOL[]
Definition: SessionSettings.h:97
FIX::SessionSettings::validate
void validate(const Dictionary &) const
Definition: SessionSettings.cpp:167
FIX::START_DAY
const char START_DAY[]
Definition: SessionSettings.h:52
FIX::ConfigError
Application is not configured correctly
Definition: Exceptions.h:87
FIX::POSTGRESQL_STORE_DATABASE
const char POSTGRESQL_STORE_DATABASE[]
Definition: SessionSettings.h:84
FIX::SessionSettings
Container for setting dictionaries mapped to sessions.
Definition: SessionSettings.h:130
FIX::ODBC_STORE_PASSWORD
const char ODBC_STORE_PASSWORD[]
Definition: SessionSettings.h:90
FIX::MYSQL_LOG_OUTGOING_TABLE
const char MYSQL_LOG_OUTGOING_TABLE[]
Definition: SessionSettings.h:104
FIX::CHECK_COMPID
const char CHECK_COMPID[]
Definition: SessionSettings.h:58
FIX::MYSQL_STORE_DATABASE
const char MYSQL_STORE_DATABASE[]
Definition: SessionSettings.h:78
FIX::POSTGRESQL_LOG_HOST
const char POSTGRESQL_LOG_HOST[]
Definition: SessionSettings.h:110
FIX::ODBC_STORE_USER
const char ODBC_STORE_USER[]
Definition: SessionSettings.h:89
FIX::MYSQL_LOG_USER
const char MYSQL_LOG_USER[]
Definition: SessionSettings.h:99
FIX::VALIDATE_LENGTH_AND_CHECKSUM
const char VALIDATE_LENGTH_AND_CHECKSUM[]
Definition: SessionSettings.h:70
FIX::MYSQL_LOG_HOST
const char MYSQL_LOG_HOST[]
Definition: SessionSettings.h:101
FIX::LOGOUT_TIMEOUT
const char LOGOUT_TIMEOUT[]
Definition: SessionSettings.h:75
FIX::ODBC_LOG_USER
const char ODBC_LOG_USER[]
Definition: SessionSettings.h:115
FIX::SCREEN_LOG_SHOW_EVENTS
const char SCREEN_LOG_SHOW_EVENTS[]
Definition: SessionSettings.h:96
FIX::SCREEN_LOG_SHOW_INCOMING
const char SCREEN_LOG_SHOW_INCOMING[]
Definition: SessionSettings.h:94
FIX::START_TIME
const char START_TIME[]
Definition: SessionSettings.h:50
FIX::SENDERCOMPID
const char SENDERCOMPID[]
Definition: SessionSettings.h:38
FIX::ODBC_LOG_OUTGOING_TABLE
const char ODBC_LOG_OUTGOING_TABLE[]
Definition: SessionSettings.h:119
FIX::LOGON_DAY
const char LOGON_DAY[]
Definition: SessionSettings.h:56
FIX::MILLISECONDS_IN_TIMESTAMP
const char MILLISECONDS_IN_TIMESTAMP[]
Definition: SessionSettings.h:125
FIX::MYSQL_LOG_EVENT_TABLE
const char MYSQL_LOG_EVENT_TABLE[]
Definition: SessionSettings.h:105
FIX::DATA_DICTIONARY
const char DATA_DICTIONARY[]
Definition: SessionSettings.h:46
FIX::SessionSettings::m_settings
Dictionaries m_settings
Definition: SessionSettings.h:159
FIX::USE_DATA_DICTIONARY
const char USE_DATA_DICTIONARY[]
Definition: SessionSettings.h:43
FIX::MYSQL_STORE_HOST
const char MYSQL_STORE_HOST[]
Definition: SessionSettings.h:81
FIX::POSTGRESQL_STORE_USECONNECTIONPOOL
const char POSTGRESQL_STORE_USECONNECTIONPOOL[]
Definition: SessionSettings.h:83
FIX::Dictionary
For storage and retrieval of key/value pairs.
Definition: Dictionary.h:36
FIX::MYSQL_LOG_PASSWORD
const char MYSQL_LOG_PASSWORD[]
Definition: SessionSettings.h:100
FIX::SOCKET_REUSE_ADDRESS
const char SOCKET_REUSE_ADDRESS[]
Definition: SessionSettings.h:63
Dictionary.h
FIX::FILE_LOG_PATH
const char FILE_LOG_PATH[]
Definition: SessionSettings.h:92
FIX::SessionSettings::size
size_t size() const
Number of session settings.
Definition: SessionSettings.h:151
FIX::USE_LOCAL_TIME
const char USE_LOCAL_TIME[]
Definition: SessionSettings.h:49
FIX::SessionID
Unique session id consists of BeginString, SenderCompID and TargetCompID.
Definition: SessionID.h:30
FIX::ODBC_LOG_CONNECTION_STRING
const char ODBC_LOG_CONNECTION_STRING[]
Definition: SessionSettings.h:117
FIX::PERSIST_MESSAGES
const char PERSIST_MESSAGES[]
Definition: SessionSettings.h:127
FIX::HEARTBTINT
const char HEARTBTINT[]
Definition: SessionSettings.h:61
FIX::POSTGRESQL_STORE_PASSWORD
const char POSTGRESQL_STORE_PASSWORD[]
Definition: SessionSettings.h:86
FIX::MYSQL_STORE_USER
const char MYSQL_STORE_USER[]
Definition: SessionSettings.h:79
FIX::HTTP_ACCEPT_PORT
const char HTTP_ACCEPT_PORT[]
Definition: SessionSettings.h:126
FIX::POSTGRESQL_LOG_OUTGOING_TABLE
const char POSTGRESQL_LOG_OUTGOING_TABLE[]
Definition: SessionSettings.h:113
FIX::CHECK_LATENCY
const char CHECK_LATENCY[]
Definition: SessionSettings.h:59
Exceptions.h
FIX::SEND_RESETSEQNUMFLAG
const char SEND_RESETSEQNUMFLAG[]
Definition: SessionSettings.h:44
FIX::APP_DATA_DICTIONARY
const char APP_DATA_DICTIONARY[]
Definition: SessionSettings.h:48
FIX::REFRESH_ON_LOGON
const char REFRESH_ON_LOGON[]
Definition: SessionSettings.h:124
FIX::ODBC_LOG_INCOMING_TABLE
const char ODBC_LOG_INCOMING_TABLE[]
Definition: SessionSettings.h:118