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

Generated on Sat Mar 29 2014 15:13:32 for QuickFIX by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2001