#include <B2BITS_Session.h>
Inheritance diagram for Engine::Session:
Collaboration diagram for Engine::Session:Public Types | |
| enum | ActiveConnection { PRIMARY_CONNECTION = 0, BACKUP_CONNECTION, RESTORE_CONNECTION } |
Active connection to use. More... | |
| enum | Role { NA, INITIATOR, ACCEPTOR } |
Defines role of session. More... | |
| enum | State { ESTABLISHED, INITIAL, NON_GRACEFULLY_TERMINATED, RECONNECT, CORRECTLY_TERMINATED, WAIT_FOR_CONFIRM_LOGON, WAIT_FOR_CONFIRM_LOGOUT, WAIT_FOR_FIRST_LOGON, SWITCH_CONNECTION, WAIT_FOR_FIRST_HELLO, WAIT_FOR_CONFIRM_HELLO } |
Possible states of Session. More... | |
Public Member Functions | |
| virtual void | attachStateObserver (SessionStateObserver *observer)=0 |
| virtual void | closeMessageStorage ()=0 |
| Close message storage. | |
| virtual void | connect (int HBI, const std::string &host, int port, EncryptMethod encryption=Engine::NONE, const SessionBackupParameters *backupConn=NULL, ActiveConnection activeConn=PRIMARY_CONNECTION)=0 |
| Establishes the FIX session as Initiator. | |
| virtual void | connect (const FixTcpParameters &protocolConfig, const FixTcpBackupParameters *backupConn=NULL)=0 |
| Establishes the FIX session over FIX_TCP underlying protocol. | |
| virtual void | connect (const FixT11TcpParameters &protocolConfig, const FixT11TcpBackupParameters *backupConn=NULL)=0 |
| Establishes the FIX session over FIXT11_TCP underlying protocol. | |
| virtual void | connect (EncryptMethod encryption=Engine::NONE)=0 |
| Establishes the FIX session as Acceptor. | |
| virtual void | connect (int HBI, const FIXMessage &customLogonMsg, const std::string &host, int port, EncryptMethod encryption=Engine::NONE, const SessionBackupParameters *backupConn=NULL, ActiveConnection activeConn=PRIMARY_CONNECTION)=0 |
| Establishes the FIX session as Initiator using the custom Logon message. | |
| virtual void | detachStateObserver ()=0 |
| virtual void | disconnect (const std::string &logoutText, bool forcefullyMarkAsTerminated=false)=0 |
| Initiates disconnect of the session with the given logout text. | |
| virtual void | disconnect (bool forcefullyMarkAsTerminated=false)=0 |
| Initiates disconnect of the session. | |
| virtual void | disconnectNonGracefully ()=0 |
| Closes the telecommunication link and switches the session into the NON_GRACEFULLY_TERMINATED state. | |
| virtual void | disconnectSync (bool forcefullyMarkAsTerminated=false) |
| Initiates synchronous disconnect of the session. | |
| virtual void | disconnectSync (const std::string &logoutText, bool forcefullyMarkAsTerminated=false) |
| Initiates synchronous disconnect of the session with the given logout text. | |
| virtual ActiveConnection | getActiveConnectionType () const =0 |
| Returns current connection type. | |
| virtual std::auto_ptr < SessionExtraParameters > | getActiveParameters () const =0 |
| Returns string representation of active session parameters. | |
| virtual std::auto_ptr < SessionBackupParameters > | getBackupParameters () const =0 |
| Returns string representation of backup session parameters. | |
| virtual Engine::EncryptMethod | getEncryptionMethod () const =0 |
| Returns the encryption method. | |
| virtual int | getHBI () const =0 |
| Returns Heartbeat interval (HeartBtInt) in seconds. | |
| virtual const std::string * | getId () const =0 |
| Returns the session's ID in the format 'SenderCompID 0x01 TargetCompId'. | |
| virtual int | getInSeqNum () const =0 |
| Returns the incoming sequence numbers for this FIX session (the expected MsgSeqNum of the next incoming message). | |
| virtual const std::string * | getMsgStorageName () const =0 |
| virtual int | getOutSeqNum () const =0 |
| Returns the outgoing sequence numbers for this FIX session (MsgSeqNum of the next outgoing message). | |
| virtual std::auto_ptr < SessionExtraParameters > | getPrimaryParameters () const =0 |
| Returns string representation of primary session parameters. | |
| virtual void | getReceivedMessages (std::vector< FIXMessage * > *pMessages, const MsgFilter &msgFilter) const =0 |
| Retrieves messages received by the session. | |
| virtual const System::InetAddress & | getRemoteAddress () const =0 |
| Returns the remote FIX Engine's IP Address. | |
| virtual const std::string * | getRemoteHost ()=0 |
| Returns the remote FIX Engine's host name. | |
| virtual IPAddr | getRemoteHostIP () const |
| Returns the remote FIX Engine's IP Address. | |
| virtual int | getRemotePort ()=0 |
| Returns the remote FIX Engine's port number. | |
| virtual Role | getRole () const =0 |
| Returns session's role. | |
| virtual const std::string * | getSender () const =0 |
| Returns SenderCompID. | |
| virtual SessionEx * | getSessionEx () |
| virtual State | getState () const =0 |
| Returns session's state;. | |
| virtual const char * | getStateAsString ()=0 |
| Returns current session's state as string;. | |
| virtual MessageStorageType | getStorageType () const =0 |
| Returns a session storage type. | |
| virtual const std::string * | getTarget () const =0 |
| Returns TargetCompID. | |
| virtual UnderlyingProtocol | getUnderlyingProtocol () const =0 |
| Returns type of the underlying protocol. | |
| virtual FIXVersion | getVer () const =0 |
| Returns the FIX protocol version. | |
| virtual void | inflate (FIXMessage *pMsg, int msgSeqNumSize, PutMessageOptions const *options=NULL) const =0 |
| Sets static session level fields in the message and reserves space for volatile session level fields. | |
| virtual bool | isTCPBuffer () const =0 |
| virtual FIXMessage * | locateSentMessage (int seqNum) const =0 |
| virtual FIXMessage * | newSkel (const char *msgType, Engine::FIXVersion app_ver=Engine::NA) const =0 |
| Creates instance of the message withe same protocol as session is. | |
| virtual size_t | outgoingQueueSize () const =0 |
| Returns size of the outgoing message queue. | |
| virtual void | ping (const std::string &testReqID="")=0 |
| Sends Test Request message. | |
| virtual ProtocolID | protocolID () const =0 |
| Returns unique protocol identifier of the session. | |
| virtual void | put (PreparedMessage *pMsg)=0 |
| Sends the given message to the remote FIX engine. | |
| virtual void | put (const std::string &msgHeader, const std::string &msgBody)=0 |
| Sends the given message to the remote FIX engine. | |
| virtual void | put (FIXMessage *pMsg, PutMessageOptions const *options=NULL)=0 |
| Sends the given message to the remote FIX engine. | |
| virtual Application * | registerApplication (Application *pNewApplication, unsigned int delay=300, int maxTries=-1)=0 |
| Registers Application. | |
| virtual void | resetMessageStorage ()=0 |
| Reset messages storage, so nothing will be send on ResendRequest. | |
| virtual void | resetSeqNum ()=0 |
| Sends the Logon message with the ResetSeqNumFlag flat that indicates both sides of a FIX session should reset sequence numbers. | |
| virtual void | setEnableMessageRejecting (bool enable)=0 |
| Forcedly sets the value of the Enable Message Rejecting. | |
| virtual void | setForcedReconnect (bool enable)=0 |
| Forcedly sets the value of the Forced Reconnect. | |
| virtual void | setInSeqNum (int seqNum)=0 |
| Forcedly sets the value of the incoming sequence number (the expected MsgSeqNum of the next incoming message). | |
| virtual void | setIntradayLogoutToleranceMode (bool enable)=0 |
| Forcedly sets the value of the Intraday Logout Tolerance Mode. | |
| virtual void | setOutSeqNum (int seqNum)=0 |
| Forcedly sets the value of the outgoing sequence number (MsgSeqNum of the next outgoing message). | |
| virtual void | setSenderLocationID (const std::string &id)=0 |
| Forcedly sets the value of the Sender Location ID. | |
| virtual void | setSenderSubID (const std::string &id)=0 |
| Forcedly sets the value of the Sender Sub ID. | |
| virtual void | setTargetLocationID (const std::string &id)=0 |
| Forcedly sets the value of the Target Location ID. | |
| virtual void | setTargetSubID (const std::string &id)=0 |
| Forcedly sets the value of the Target Sub ID. | |
| virtual bool | setTCPBuffer (bool enable)=0 |
| Enables or disables TCP buffer. | |
| virtual void | switchConnection ()=0 |
| Switch session to the another connection. | |
Static Public Member Functions | |
| static const char * | connState2string (ActiveConnection aState) |
| Returns the string representation of the given connection state value. | |
| static const char * | state2string (State state) |
| Returns the string representation of the given state value. | |
Protected Member Functions | |
| Session () | |
| Constructor. | |
| virtual | ~Session () |
| Destructor. | |
Friends | |
| class | SessionDataProvider |
Basic Session.
Definition at line 108 of file B2BITS_Session.h.
Active connection to use.
Definition at line 121 of file B2BITS_Session.h.
Defines role of session.
Definition at line 449 of file B2BITS_Session.h.
Possible states of Session.
Definition at line 289 of file B2BITS_Session.h.
| Engine::Session::Session | ( | ) | [inline, protected] |
Constructor.
Definition at line 542 of file B2BITS_Session.h.
| virtual Engine::Session::~Session | ( | ) | [inline, protected, virtual] |
Destructor.
Definition at line 549 of file B2BITS_Session.h.
| virtual void Engine::Session::attachStateObserver | ( | SessionStateObserver * | observer ) | [pure virtual] |
| virtual void Engine::Session::closeMessageStorage | ( | ) | [pure virtual] |
Close message storage.
Method forcidly closes storage if session is in the NGT/CT state.
| virtual void Engine::Session::connect | ( | int | HBI, |
| const std::string & | host, | ||
| int | port, | ||
| EncryptMethod | encryption = Engine::NONE, |
||
| const SessionBackupParameters * | backupConn = NULL, |
||
| ActiveConnection | activeConn = PRIMARY_CONNECTION |
||
| ) | [pure virtual] |
Establishes the FIX session as Initiator.
| HBI | Heartbeat interval (seconds) |
| host | remote FIX engine's host name or address. |
| port | remote FIX engine's port. |
| encryption | Encrypt method. |
| backupConn | - parameters of the backup connection |
| activeConn | - specifies which connection will be used, by default primary connection |
| virtual void Engine::Session::connect | ( | const FixTcpParameters & | protocolConfig, |
| const FixTcpBackupParameters * | backupConn = NULL |
||
| ) | [pure virtual] |
Establishes the FIX session over FIX_TCP underlying protocol.
| protocolConfig | - set of the FIX_TCP protocol parameters. |
| backupConn | - parameters of the backup connection |
| virtual void Engine::Session::connect | ( | const FixT11TcpParameters & | protocolConfig, |
| const FixT11TcpBackupParameters * | backupConn = NULL |
||
| ) | [pure virtual] |
Establishes the FIX session over FIXT11_TCP underlying protocol.
| protocolConfig | - set of the FIXT11_TCP protocol parameters. |
| backupConn | - parameters of the backup connection |
| virtual void Engine::Session::connect | ( | EncryptMethod | encryption = Engine::NONE ) |
[pure virtual] |
Establishes the FIX session as Acceptor.
| encryption | Encrypt method. |
| virtual void Engine::Session::connect | ( | int | HBI, |
| const FIXMessage & | customLogonMsg, | ||
| const std::string & | host, | ||
| int | port, | ||
| EncryptMethod | encryption = Engine::NONE, |
||
| const SessionBackupParameters * | backupConn = NULL, |
||
| ActiveConnection | activeConn = PRIMARY_CONNECTION |
||
| ) | [pure virtual] |
Establishes the FIX session as Initiator using the custom Logon message.
| HBI | Heartbeat interval (in seconds) |
| customLogonMsg | the custom Logon message. |
| host | remote FIX engine's host name or address. |
| port | remote FIX engine's port. |
| encryption | Encrypt method. |
| backupConn | - parameters of the backup connection |
| activeConn | - specifies which connection will be used, by default primary connection |
| static const char* Engine::Session::connState2string | ( | ActiveConnection | aState ) | [static] |
Returns the string representation of the given connection state value.
| virtual void Engine::Session::detachStateObserver | ( | ) | [pure virtual] |
| virtual void Engine::Session::disconnect | ( | const std::string & | logoutText, |
| bool | forcefullyMarkAsTerminated = false |
||
| ) | [pure virtual] |
Initiates disconnect of the session with the given logout text.
| forcefullyMarkAsTerminated | if true then the session will be marked as correctly terminated and persistant |
| logoutText | Reason of disconnecting information about it will not be used during the subsequent connections. |
| virtual void Engine::Session::disconnect | ( | bool | forcefullyMarkAsTerminated = false ) |
[pure virtual] |
Initiates disconnect of the session.
| forcefullyMarkAsTerminated | if true then the session will be marked as correctly terminated and persistant information about it will not be used during the subsequent connections. |
| virtual void Engine::Session::disconnectNonGracefully | ( | ) | [pure virtual] |
Closes the telecommunication link and switches the session into the NON_GRACEFULLY_TERMINATED state.
| virtual void Engine::Session::disconnectSync | ( | bool | forcefullyMarkAsTerminated = false ) |
[virtual] |
Initiates synchronous disconnect of the session.
| forcefullyMarkAsTerminated | if true then the session will be marked as correctly terminated and persistant information about it will not be used during the subsequent connections. |
| virtual void Engine::Session::disconnectSync | ( | const std::string & | logoutText, |
| bool | forcefullyMarkAsTerminated = false |
||
| ) | [virtual] |
Initiates synchronous disconnect of the session with the given logout text.
| forcefullyMarkAsTerminated | if true then the session will be marked as correctly terminated and persistant |
| logoutText | Reason of disconnecting information about it will not be used during the subsequent connections. |
| virtual ActiveConnection Engine::Session::getActiveConnectionType | ( | ) | const [pure virtual] |
Returns current connection type.
| virtual std::auto_ptr<SessionExtraParameters> Engine::Session::getActiveParameters | ( | ) | const [pure virtual] |
Returns string representation of active session parameters.
| virtual std::auto_ptr<SessionBackupParameters> Engine::Session::getBackupParameters | ( | ) | const [pure virtual] |
Returns string representation of backup session parameters.
| virtual Engine::EncryptMethod Engine::Session::getEncryptionMethod | ( | ) | const [pure virtual] |
Returns the encryption method.
| virtual int Engine::Session::getHBI | ( | ) | const [pure virtual] |
Returns Heartbeat interval (HeartBtInt) in seconds.
| virtual const std::string* Engine::Session::getId | ( | ) | const [pure virtual] |
Returns the session's ID in the format 'SenderCompID 0x01 TargetCompId'.
| virtual int Engine::Session::getInSeqNum | ( | ) | const [pure virtual] |
Returns the incoming sequence numbers for this FIX session (the expected MsgSeqNum of the next incoming message).
| virtual const std::string* Engine::Session::getMsgStorageName | ( | ) | const [pure virtual] |
| virtual int Engine::Session::getOutSeqNum | ( | ) | const [pure virtual] |
Returns the outgoing sequence numbers for this FIX session (MsgSeqNum of the next outgoing message).
| virtual std::auto_ptr<SessionExtraParameters> Engine::Session::getPrimaryParameters | ( | ) | const [pure virtual] |
Returns string representation of primary session parameters.
| virtual void Engine::Session::getReceivedMessages | ( | std::vector< FIXMessage * > * | pMessages, |
| const MsgFilter & | msgFilter | ||
| ) | const [pure virtual] |
Retrieves messages received by the session.
| pMessages | List of messages. |
| msgFilter | specifies selection criteria. |
| virtual const System::InetAddress& Engine::Session::getRemoteAddress | ( | ) | const [pure virtual] |
Returns the remote FIX Engine's IP Address.
| Utils::Exception | if no data is available |
| virtual const std::string* Engine::Session::getRemoteHost | ( | ) | [pure virtual] |
Returns the remote FIX Engine's host name.
| Utils::Exception | if no data is available |
| virtual IPAddr Engine::Session::getRemoteHostIP | ( | ) | const [virtual] |
Returns the remote FIX Engine's IP Address.
| Utils::Exception | if no data is available |
| virtual int Engine::Session::getRemotePort | ( | ) | [pure virtual] |
Returns the remote FIX Engine's port number.
| virtual Role Engine::Session::getRole | ( | ) | const [pure virtual] |
Returns session's role.
| virtual const std::string* Engine::Session::getSender | ( | ) | const [pure virtual] |
Returns SenderCompID.
| virtual SessionEx* Engine::Session::getSessionEx | ( | ) | [virtual] |
| virtual State Engine::Session::getState | ( | ) | const [pure virtual] |
Returns session's state;.
| virtual const char* Engine::Session::getStateAsString | ( | ) | [pure virtual] |
Returns current session's state as string;.
| virtual MessageStorageType Engine::Session::getStorageType | ( | ) | const [pure virtual] |
Returns a session storage type.
| virtual const std::string* Engine::Session::getTarget | ( | ) | const [pure virtual] |
Returns TargetCompID.
| virtual UnderlyingProtocol Engine::Session::getUnderlyingProtocol | ( | ) | const [pure virtual] |
Returns type of the underlying protocol.
| virtual FIXVersion Engine::Session::getVer | ( | ) | const [pure virtual] |
Returns the FIX protocol version.
| virtual void Engine::Session::inflate | ( | FIXMessage * | pMsg, |
| int | msgSeqNumSize, | ||
| PutMessageOptions const * | options = NULL |
||
| ) | const [pure virtual] |
Sets static session level fields in the message and reserves space for volatile session level fields.
| [out] | pMsg | Pointer to the FIXMessage to store field values |
| [in] | msgSeqNumSize | Number of characters for MsgSeqNum field to reserve. |
| [in] | options | Extra parameters. |
| virtual bool Engine::Session::isTCPBuffer | ( | ) | const [pure virtual] |
| virtual FIXMessage* Engine::Session::locateSentMessage | ( | int | seqNum ) | const [pure virtual] |
| virtual FIXMessage* Engine::Session::newSkel | ( | const char * | msgType, |
| Engine::FIXVersion | app_ver = Engine::NA |
||
| ) | const [pure virtual] |
Creates instance of the message withe same protocol as session is.
| virtual size_t Engine::Session::outgoingQueueSize | ( | ) | const [pure virtual] |
Returns size of the outgoing message queue.
| virtual void Engine::Session::ping | ( | const std::string & | testReqID = "" ) |
[pure virtual] |
Sends Test Request message.
| testReqID | The TestReqID field (tag = 112) - Identifier included in Test Request message to be returned in resulting Heartbeat message. If empty then a timestamp string will be used as the value. |
| virtual ProtocolID Engine::Session::protocolID | ( | ) | const [pure virtual] |
Returns unique protocol identifier of the session.
| virtual void Engine::Session::put | ( | PreparedMessage * | pMsg ) | [pure virtual] |
Sends the given message to the remote FIX engine.
| virtual void Engine::Session::put | ( | const std::string & | msgHeader, |
| const std::string & | msgBody | ||
| ) | [pure virtual] |
Sends the given message to the remote FIX engine.
| msgHeader | the message header in the native FIX format. |
| msgBody | the message body in the native FIX format. |
| virtual void Engine::Session::put | ( | FIXMessage * | pMsg, |
| PutMessageOptions const * | options = NULL |
||
| ) | [pure virtual] |
Sends the given message to the remote FIX engine.
| virtual Application* Engine::Session::registerApplication | ( | Application * | pNewApplication, |
| unsigned int | delay = 300, |
||
| int | maxTries = -1 |
||
| ) | [pure virtual] |
Registers Application.
When any application callback executed - new Application coudn't be registered immediately. Session will tries to register new application during delay*triesAmount period.
| pNewApplication | Instance of class derived from Application that handles session's events. |
| delay | - the time delay in microseconds when session tries to registrate new application |
| maxTries | - the amount of attempts during session tries to registrate new application. '-1' means INFINITE attempt. |
| virtual void Engine::Session::resetMessageStorage | ( | ) | [pure virtual] |
Reset messages storage, so nothing will be send on ResendRequest.
| virtual void Engine::Session::resetSeqNum | ( | ) | [pure virtual] |
Sends the Logon message with the ResetSeqNumFlag flat that indicates both sides of a FIX session should reset sequence numbers.
| virtual void Engine::Session::setEnableMessageRejecting | ( | bool | enable ) | [pure virtual] |
Forcedly sets the value of the Enable Message Rejecting.
| virtual void Engine::Session::setForcedReconnect | ( | bool | enable ) | [pure virtual] |
Forcedly sets the value of the Forced Reconnect.
| virtual void Engine::Session::setInSeqNum | ( | int | seqNum ) | [pure virtual] |
Forcedly sets the value of the incoming sequence number (the expected MsgSeqNum of the next incoming message).
| virtual void Engine::Session::setIntradayLogoutToleranceMode | ( | bool | enable ) | [pure virtual] |
Forcedly sets the value of the Intraday Logout Tolerance Mode.
| virtual void Engine::Session::setOutSeqNum | ( | int | seqNum ) | [pure virtual] |
Forcedly sets the value of the outgoing sequence number (MsgSeqNum of the next outgoing message).
| virtual void Engine::Session::setSenderLocationID | ( | const std::string & | id ) | [pure virtual] |
Forcedly sets the value of the Sender Location ID.
| virtual void Engine::Session::setSenderSubID | ( | const std::string & | id ) | [pure virtual] |
Forcedly sets the value of the Sender Sub ID.
| virtual void Engine::Session::setTargetLocationID | ( | const std::string & | id ) | [pure virtual] |
Forcedly sets the value of the Target Location ID.
| virtual void Engine::Session::setTargetSubID | ( | const std::string & | id ) | [pure virtual] |
Forcedly sets the value of the Target Sub ID.
| virtual bool Engine::Session::setTCPBuffer | ( | bool | enable ) | [pure virtual] |
Enables or disables TCP buffer.
| enable | - when true, TCP buffer will be enabled. |
| static const char* Engine::Session::state2string | ( | State | state ) | [static] |
Returns the string representation of the given state value.
| virtual void Engine::Session::switchConnection | ( | ) | [pure virtual] |
Switch session to the another connection.
When current is a primary - switch to the backup. When current is a backup - switch to the primary.
friend class SessionDataProvider [friend] |
Definition at line 109 of file B2BITS_Session.h.
1.7.2