Public Member Functions

Engine::Application Class Reference

Generic application interface. More...

#include <B2BITS_Application.h>

Inheritance diagram for Engine::Application:

List of all members.

Public Member Functions

virtual void onAfterMessageIsReceived (char const *msg, size_t msgSize, const Session &sn)
 Faired just after message is received from socket.
virtual void onBeforeMessageIsSent (int msgSeqNum, const Session &sn, size_t msgCount)
 Faired before message is sent to socket.
virtual void onHeartbeatWithTestReqIDEvent (const HeartbeatWithTestReqIDEvent &event, const Session &sn)=0
 This call-back method is called when a Heartbeat message (MsgType = 0) with the TestReqID field (tag = 112) has been received.
virtual void onInvalidResendRequestEvent (const ResendRequestEvent &event, const Session &sn)
 This call-back method is called when a ill-formed Resend Request (MsgType = 2) has been received.
virtual void onLogonEvent (const LogonEvent *event, const Session &sn)=0
 This call-back method is called to notify that the Logon message has been received from the counterpart.
virtual void onLogoutEvent (const LogoutEvent *event, const Session &sn)=0
 This call-back method is called to notify that the Logout message has been received from the counterpart or the session was disconnected.
virtual void onMsgRejectEvent (const MsgRejectEvent *event, const Session &sn)=0
 This call-back method is called when a message have to be rejected.
virtual void onNewStateEvent (const NewStateEvent &event, const Session &sn)=0
 This call-back method is called when the session has changed its state.
virtual void onReconnectTryEvent (int remainTries, const Session &sn)
 This call-back method is called each time session trys to reconnect.
virtual bool onResend (const FIXMessage &msg, const Session &sn)=0
 This call-back method is called when an outgoing message is about to be resent as a reply to the incoming ResendRequest message.
virtual void onResendRequestEvent (const ResendRequestEvent &event, const Session &sn)=0
 This call-back method is called when a Resend Request (MsgType = 2) has been received.
virtual bool onResendRequestLoop (const ResendRequestEvent &event, const Session &sn)
 This call-back method is called when DuplicateResendRequestLimit ResendRequest messages are received.
virtual void onSequenceGapEvent (const SequenceGapEvent *event, const Session &sn)=0
 This call-back method is called when a message gap is detected in incoming messages.
virtual void onSessionLevelRejectEvent (const SessionLevelRejectEvent *event, const Session &sn)=0
 This call-back method is called when a session-level Reject message (MsgType = 3) is received.
virtual bool onSessionLevelRejectWithSeqNumTooHigh (const FIXMessage &msg, const Session &sn)
 Faired when Session Level Reject message is received with the sequence number too high.
virtual void onSwitchConnectionEvent (const SwitchConnectionEvent &event, const Session &sn)
 This call-back method is called when the session is switching to another connection.
virtual void onUnableToRouteMessage (const UnableToRouteMessageEvent &event, const Session &sn)=0
 This call-back method is called when the message has to be routed to the session, which does not exist.
virtual void onUnexpectedMessageEvent (const UnexpectedMessageEvent *apEvent, const Session &aSn)
 This call-back method is called to notify about recevied unexpected message.
virtual void onValidateLogonEvent (ValidateLogonEvent *apEvent, const Session &aSn)
 This call-back method is called to verify remote party.
virtual bool process (const FIXMessage &msg, const Session &sn)=0
 A call-back method to process incoming messages.
virtual ~Application ()
 Destructor.

Detailed Description

Generic application interface.

Processes the incoming messages. All user's applications must be inherited from this class.

Definition at line 62 of file B2BITS_Application.h.


Constructor & Destructor Documentation

virtual Engine::Application::~Application (  ) [inline, virtual]

Destructor.

Definition at line 67 of file B2BITS_Application.h.


Member Function Documentation

virtual void Engine::Application::onAfterMessageIsReceived ( char const *  msg,
size_t  msgSize,
const Session sn 
) [inline, virtual]

Faired just after message is received from socket.

Parameters:
[in]snReference to FIX session related to the event.
[in]msgPointer to the buffer with message.
[in]msgSizeSize of the message buffer.

Definition at line 242 of file B2BITS_Application.h.

virtual void Engine::Application::onBeforeMessageIsSent ( int  msgSeqNum,
const Session sn,
size_t  msgCount 
) [inline, virtual]

Faired before message is sent to socket.

Designed specifically for benchmarks.

Parameters:
[in]msgSeqNumSequence number of the sent message.
[in]snReference to FIX session related to the event.
[in]msgCountMessages count to send

Definition at line 234 of file B2BITS_Application.h.

virtual void Engine::Application::onHeartbeatWithTestReqIDEvent ( const HeartbeatWithTestReqIDEvent event,
const Session sn 
) [pure virtual]

This call-back method is called when a Heartbeat message (MsgType = 0) with the TestReqID field (tag = 112) has been received.

Usually such a message is sent in reply to a Test Request (MsgType = 1) message.

Parameters:
eventInformation about occured event.
snThe corresponding FIX session.

Implemented in Engine::AdminApplication.

virtual void Engine::Application::onInvalidResendRequestEvent ( const ResendRequestEvent event,
const Session sn 
) [inline, virtual]

This call-back method is called when a ill-formed Resend Request (MsgType = 2) has been received.

Parameters:
eventInformation about occured event.
snThe corresponding FIX session.

Definition at line 171 of file B2BITS_Application.h.

virtual void Engine::Application::onLogonEvent ( const LogonEvent event,
const Session sn 
) [pure virtual]

This call-back method is called to notify that the Logon message has been received from the counterpart.

If exception is raised inside this event, incoming connection will be closed. Exception text will be stored to the engine.log file.

Parameters:
eventEvent information.
snThe corresponding FIX session.

Implemented in Engine::AdminApplication.

virtual void Engine::Application::onLogoutEvent ( const LogoutEvent event,
const Session sn 
) [pure virtual]

This call-back method is called to notify that the Logout message has been received from the counterpart or the session was disconnected.

Parameters:
eventInformation about occured event.
snThe corresponding FIX session.

Implemented in Engine::AdminApplication.

virtual void Engine::Application::onMsgRejectEvent ( const MsgRejectEvent event,
const Session sn 
) [pure virtual]

This call-back method is called when a message have to be rejected.

Parameters:
event- object that incapsulates rejected message
sn- session object that rejects message

Implemented in Engine::AdminApplication.

virtual void Engine::Application::onNewStateEvent ( const NewStateEvent event,
const Session sn 
) [pure virtual]

This call-back method is called when the session has changed its state.

Parameters:
eventInformation about occured event.
snThe corresponding FIX session.

Implemented in Engine::AdminApplication.

virtual void Engine::Application::onReconnectTryEvent ( int  remainTries,
const Session sn 
) [inline, virtual]

This call-back method is called each time session trys to reconnect.

Parameters:
remainTriesThe remain reconnect tries count.
snThe corresponding FIX session.

Definition at line 189 of file B2BITS_Application.h.

virtual bool Engine::Application::onResend ( const FIXMessage msg,
const Session sn 
) [pure virtual]

This call-back method is called when an outgoing message is about to be resent as a reply to the incoming ResendRequest message.

If the method returns 'true' then the Engine resends the message to counterpart, otherwise it sends the SequenceReset Gap Fill message.

Parameters:
msgOutgoing message.
snFIX session.
Returns:
true if the message should be resent, otherwise false.

Implemented in Engine::AdminApplication.

virtual void Engine::Application::onResendRequestEvent ( const ResendRequestEvent event,
const Session sn 
) [pure virtual]

This call-back method is called when a Resend Request (MsgType = 2) has been received.

Parameters:
eventInformation about occured event.
snThe corresponding FIX session.

Implemented in Engine::AdminApplication.

virtual bool Engine::Application::onResendRequestLoop ( const ResendRequestEvent event,
const Session sn 
) [inline, virtual]

This call-back method is called when DuplicateResendRequestLimit ResendRequest messages are received.

Parameters:
eventInformation about occured event.
snThe corresponding FIX session.
Returns:
To reset DuplicateResendRequestLimit counter return true; false otherwise.

Definition at line 181 of file B2BITS_Application.h.

virtual void Engine::Application::onSequenceGapEvent ( const SequenceGapEvent event,
const Session sn 
) [pure virtual]

This call-back method is called when a message gap is detected in incoming messages.

Parameters:
eventInformation about occured event.
snThe corresponding FIX session.

Implemented in Engine::AdminApplication.

virtual void Engine::Application::onSessionLevelRejectEvent ( const SessionLevelRejectEvent event,
const Session sn 
) [pure virtual]

This call-back method is called when a session-level Reject message (MsgType = 3) is received.

Parameters:
eventInformation about occured event.
snThe corresponding FIX session.

Implemented in Engine::AdminApplication.

virtual bool Engine::Application::onSessionLevelRejectWithSeqNumTooHigh ( const FIXMessage msg,
const Session sn 
) [inline, virtual]

Faired when Session Level Reject message is received with the sequence number too high.

Note:
It can occur when remote site sends reject on Resend Request. In this case user can reset incoming/outgoing sequences and restart the session.
Returns:
true if message is processed; false [default] to send resend request message.

Definition at line 252 of file B2BITS_Application.h.

virtual void Engine::Application::onSwitchConnectionEvent ( const SwitchConnectionEvent event,
const Session sn 
) [inline, virtual]

This call-back method is called when the session is switching to another connection.

Parameters:
eventInformation about occured event.
snThe corresponding FIX session.

Definition at line 205 of file B2BITS_Application.h.

virtual void Engine::Application::onUnableToRouteMessage ( const UnableToRouteMessageEvent event,
const Session sn 
) [pure virtual]

This call-back method is called when the message has to be routed to the session, which does not exist.

Parameters:
eventInformation about occured event.
snThe corresponding FIX session.

Implemented in Engine::AdminApplication.

virtual void Engine::Application::onUnexpectedMessageEvent ( const UnexpectedMessageEvent apEvent,
const Session aSn 
) [inline, virtual]

This call-back method is called to notify about recevied unexpected message.

For example - when first message in session is not a Logon.

Parameters:
eventInformation about occured event.
snThe corresponding FIX session.

Reimplemented in Engine::AdminApplication.

Definition at line 122 of file B2BITS_Application.h.

virtual void Engine::Application::onValidateLogonEvent ( ValidateLogonEvent apEvent,
const Session aSn 
) [inline, virtual]

This call-back method is called to verify remote party.

  • To accept connection do nothing.
  • To reject connection pass reject text to the ValidateLogonEvent::logonRejectReason_. Logout message with passed text will be sent back to remote party.
  • To reject connection without Logout message, raise exception. Text of the exception will be stored to the engine.log file.
Parameters:
eventEvent information.
snThe corresponding FIX session.

Definition at line 104 of file B2BITS_Application.h.

virtual bool Engine::Application::process ( const FIXMessage msg,
const Session sn 
) [pure virtual]

A call-back method to process incoming messages.

If the application can not process the given message, the FIX Engine will try to deliver it later according to "Delayed Processing Algorithm".

Warning:
This method should complete as quickly as possible. Do not perform time-consuming tasks inside it.
Parameters:
msgthe incoming message.
snThe corresponding FIX session.
Returns:
true if the application can process the given message, otherwise false.

Implemented in Engine::AdminApplication.