Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions

Engine::AdminApplication Class Reference

Administrative application interface. More...

#include <B2BITS_AdminApplication.h>

Inheritance diagram for Engine::AdminApplication:
Collaboration diagram for Engine::AdminApplication:

List of all members.

Classes

struct  Context
 Context within session calls AdminApplication event handlers. More...

Public Types

enum  SessionAction { SSN_NEW = 0, SSN_DELETED, SSN_UPDATED }
 

Posiable session actions.

More...
typedef std::map< std::string,
Session * > 
SESSIONS_CONTAINER
 Type for the administrative sessions container.

Public Member Functions

 AdminApplication ()
void bindApplication (AdminApplication *appl)
 Binds session from embedded AdminApplication.
void bindSession (Session *pSession)
 Binds session with AdminApplication.
void subscriptionListNotify (SessionAction status, Session *changedSsn, const SessionContext &reciverSsnInfo)
 Handle notification on sessions creation or deleting.
void terminate ()
 Terminates all administrative sessions.
virtual ~AdminApplication ()

Protected Types

typedef std::map< std::string,
std::string > 
CommandTable
 Type is used to get description of available commands.

Protected Member Functions

void executeAverageReceivedStat (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the AverageReceivedStat command.
void executeAverageSentStat (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the AverageSentStat command.
void executeAverageValidateStat (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the AverageValidateStat command.
void executeChangeSeqNum (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the ChangeSeqNum command.
void executeCreateAcceptor (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the CreateAcceptor command.
void executeCreateInitiator (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the CeateInitiator command.
void executeDelete (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the Delete command.
void executeDeleteAll (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the DeleteAll command.
void executeGeneralSessionsStat (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the GeneralSessionStat command.
void executeHeartbeat (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the HeartBeat command.
void executeHelp (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the help command.
void executeProceedStat (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the Proceed command.
void executeReceivedStat (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the ReceivedStat command.
void executeResetSeqNum (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the ResetSeqNum command.
void executeSendMessage (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the SendMessage command.
void executeSentStat (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the SentStat command.
void executeSessionList (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the SessionList command.
void executeSessionParams (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the SessionParams command.
void executeSessionsSnapshot (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the SessionsSnapshot command.
void executeSessionStat (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the SessionStat command.
void executeSessionStatus (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the SessionStatus command.
void executeTestRequest (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the TestRequest command.
void executeToBackup (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the ToBackup command.
void executeToPrimary (const xercesc_2_8::DOMNode *element, const Context &context)
 Process the ToPrimary cpmmand.
virtual void getAvailableCommands (CommandTable *commands) const
 Returns description of commands.
bool getChildNodeValue (const xercesc_2_8::DOMNode *element, const XMLCh *name, std::string *value) const
 Method locates child node and returns it's value.
bool getChildNodeValueBool (const xercesc_2_8::DOMNode *element, const XMLCh *name, bool *value, std::string *) const
 Method locates child node and returns boolearn value.
bool getChildNodeValueInt (const xercesc_2_8::DOMNode *element, const XMLCh *name, int *value, std::string *) const
 Method locates child node and returns integer value.
bool getChildNodeValues (const xercesc_2_8::DOMNode *element, const XMLCh *name, std::list< std::string > &values) const
 Method locates child nodes and returns values.
bool getChildNodeValues (const xercesc_2_8::DOMNode *parentNode, const XMLCh *subnodeName, const XMLCh *paramName, std::list< std::string > &values) const
 Method locates child nodes and returns values.
virtual void OnBindAdminSession (const Session *)
 Method is called when application is binded with new session.
virtual bool onCreateAcceptorEvent (Session &, FIXMessage &)
 This call-back method is called when executing a CreateAcceptor command.
virtual bool onCreateInitiatorEvent (Session &, FIXMessage &)
 This call-back method is called when executing a CreateInitiator command.
virtual void onHeartbeatWithTestReqIDEvent (const HeartbeatWithTestReqIDEvent &, const Session &)
 This call-back method is called when a Heartbeat message (MsgType = 0) with the TestReqID field (tag = 112) has been received.
virtual void onLogonEvent (const LogonEvent *event, const Session &sn)
 This call-back method is called to notify that the Logon message has been received from the counterpart.
virtual void onLogoutEvent (const LogoutEvent *, const Session &)
 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 *, const Session &)
 This call-back method is called when a message have to be rejected.
virtual void onNewStateEvent (const NewStateEvent &, const Session &)
 This call-back method is called when the session has changed its state.
virtual bool onResend (const FIXMessage &, const Session &)
 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 &, const Session &)
 This call-back method is called when a Resend Request (MsgType = 2) has been received.
virtual void onSequenceGapEvent (const SequenceGapEvent *, const Session &)
 This call-back method is called when a message gap is detected in incoming messages.
virtual void onSessionLevelRejectEvent (const SessionLevelRejectEvent *, const Session &)
 This call-back method is called when a session-level Reject message (MsgType = 3) is received.
virtual void onUnableToRouteMessage (const UnableToRouteMessageEvent &, const Session &)
 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 *, const Session &)
 This call-back method is called to notify about recevied unexpected message.
virtual bool process (const std::string &action, const xercesc_2_8::DOMNode *element, const Context &context)
 Processes action.
virtual bool process (const FIXMessage &msg, const Session &sn)
 A call-back method to process incoming messages.
void sendReject (const Session &sn, const FIXMessage &msg, const std::string &text)
 Sends Reject message into the session.
void sendResponse (const std::string &resultCode, const std::string &description, const std::string &additionalData, const Context &context) const
 Sends response message to client in format: <?xml version="1.0"?> <Response resultcode="[resultCode]"> [description] [additionalData] </Response>
void sendResponse (const xercesc_2_8::DOMDocument *response, const Context &context) const
 Sends response message to client.
virtual void sendResponse (const std::string &response, const Context &context) const
 Sends response message to client.
void sendResponse (const std::string &response, const std::string &targetID, const FIXMessage &msg, const XMLCh *requestId) const
 Sends response message to client.

Detailed Description

Administrative application interface.

Definition at line 141 of file B2BITS_AdminApplication.h.


Member Typedef Documentation

typedef std::map<std::string, std::string> Engine::AdminApplication::CommandTable [protected]

Type is used to get description of available commands.

Parameters:
keycommand name
valuecommand description in XML format: <[Command name]> [command description] <Parameter> <Name>[parameter name (required)]</Name> [parameter description (required)] <IsRequired>[true/false (required)]</IsRequired> <DefaultValue>[default value]</DefaultValue> </Parameter> ... </[Command name]>

Definition at line 160 of file B2BITS_AdminApplication.h.

typedef std::map<std::string, Session*> Engine::AdminApplication::SESSIONS_CONTAINER

Type for the administrative sessions container.

Definition at line 195 of file B2BITS_AdminApplication.h.


Member Enumeration Documentation

Posiable session actions.

Enumerator:
SSN_NEW 
SSN_DELETED 
SSN_UPDATED 

Definition at line 200 of file B2BITS_AdminApplication.h.


Constructor & Destructor Documentation

Engine::AdminApplication::AdminApplication (  )
virtual Engine::AdminApplication::~AdminApplication (  ) [virtual]

Member Function Documentation

void Engine::AdminApplication::bindApplication ( AdminApplication appl )

Binds session from embedded AdminApplication.

Used for custom admin applications only

void Engine::AdminApplication::bindSession ( Session pSession )

Binds session with AdminApplication.

Application takes reference to the session

void Engine::AdminApplication::executeAverageReceivedStat ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the AverageReceivedStat command.

void Engine::AdminApplication::executeAverageSentStat ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the AverageSentStat command.

void Engine::AdminApplication::executeAverageValidateStat ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the AverageValidateStat command.

void Engine::AdminApplication::executeChangeSeqNum ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the ChangeSeqNum command.

void Engine::AdminApplication::executeCreateAcceptor ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the CreateAcceptor command.

void Engine::AdminApplication::executeCreateInitiator ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the CeateInitiator command.

void Engine::AdminApplication::executeDelete ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the Delete command.

void Engine::AdminApplication::executeDeleteAll ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the DeleteAll command.

void Engine::AdminApplication::executeGeneralSessionsStat ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the GeneralSessionStat command.

void Engine::AdminApplication::executeHeartbeat ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the HeartBeat command.

void Engine::AdminApplication::executeHelp ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the help command.

void Engine::AdminApplication::executeProceedStat ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the Proceed command.

void Engine::AdminApplication::executeReceivedStat ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the ReceivedStat command.

void Engine::AdminApplication::executeResetSeqNum ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the ResetSeqNum command.

void Engine::AdminApplication::executeSendMessage ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the SendMessage command.

void Engine::AdminApplication::executeSentStat ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the SentStat command.

void Engine::AdminApplication::executeSessionList ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the SessionList command.

void Engine::AdminApplication::executeSessionParams ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the SessionParams command.

void Engine::AdminApplication::executeSessionsSnapshot ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the SessionsSnapshot command.

void Engine::AdminApplication::executeSessionStat ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the SessionStat command.

void Engine::AdminApplication::executeSessionStatus ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the SessionStatus command.

void Engine::AdminApplication::executeTestRequest ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the TestRequest command.

void Engine::AdminApplication::executeToBackup ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the ToBackup command.

void Engine::AdminApplication::executeToPrimary ( const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected]

Process the ToPrimary cpmmand.

virtual void Engine::AdminApplication::getAvailableCommands ( CommandTable commands ) const [protected, virtual]

Returns description of commands.

Derived class can modify list of commands at its discretion.

bool Engine::AdminApplication::getChildNodeValue ( const xercesc_2_8::DOMNode *  element,
const XMLCh name,
std::string *  value 
) const [protected]

Method locates child node and returns it's value.

bool Engine::AdminApplication::getChildNodeValueBool ( const xercesc_2_8::DOMNode *  element,
const XMLCh name,
bool *  value,
std::string *   
) const [protected]

Method locates child node and returns boolearn value.

bool Engine::AdminApplication::getChildNodeValueInt ( const xercesc_2_8::DOMNode *  element,
const XMLCh name,
int *  value,
std::string *   
) const [protected]

Method locates child node and returns integer value.

bool Engine::AdminApplication::getChildNodeValues ( const xercesc_2_8::DOMNode *  parentNode,
const XMLCh subnodeName,
const XMLCh paramName,
std::list< std::string > &  values 
) const [protected]

Method locates child nodes and returns values.

bool Engine::AdminApplication::getChildNodeValues ( const xercesc_2_8::DOMNode *  element,
const XMLCh name,
std::list< std::string > &  values 
) const [protected]

Method locates child nodes and returns values.

virtual void Engine::AdminApplication::OnBindAdminSession ( const Session  ) [inline, protected, virtual]

Method is called when application is binded with new session.

Definition at line 285 of file B2BITS_AdminApplication.h.

virtual bool Engine::AdminApplication::onCreateAcceptorEvent ( Session ,
FIXMessage  
) [inline, protected, virtual]

This call-back method is called when executing a CreateAcceptor command.

Parameters:
snFIX session.
logonMsgthe incoming Logon message.
Returns:
true if session sould be created, otherwise false.

Definition at line 395 of file B2BITS_AdminApplication.h.

virtual bool Engine::AdminApplication::onCreateInitiatorEvent ( Session ,
FIXMessage  
) [inline, protected, virtual]

This call-back method is called when executing a CreateInitiator command.

Parameters:
snFIX session.
logonMsgthe incoming Logon message.
Returns:
true if session sould be created, otherwise false.

Definition at line 404 of file B2BITS_AdminApplication.h.

virtual void Engine::AdminApplication::onHeartbeatWithTestReqIDEvent ( const HeartbeatWithTestReqIDEvent ,
const Session  
) [inline, protected, 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.

Implements Engine::Application.

Definition at line 349 of file B2BITS_AdminApplication.h.

virtual void Engine::AdminApplication::onLogonEvent ( const LogonEvent event,
const Session sn 
) [protected, virtual]

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

Parameters:
eventEvent information.
snThe corresponding FIX session.

Implements Engine::Application.

virtual void Engine::AdminApplication::onLogoutEvent ( const LogoutEvent ,
const Session  
) [protected, 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.

Implements Engine::Application.

virtual void Engine::AdminApplication::onMsgRejectEvent ( const MsgRejectEvent ,
const Session  
) [inline, protected, 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

Implements Engine::Application.

Definition at line 338 of file B2BITS_AdminApplication.h.

virtual void Engine::AdminApplication::onNewStateEvent ( const NewStateEvent ,
const Session  
) [inline, protected, virtual]

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

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

Implements Engine::Application.

Definition at line 365 of file B2BITS_AdminApplication.h.

virtual bool Engine::AdminApplication::onResend ( const FIXMessage ,
const Session  
) [inline, protected, 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.

Implements Engine::Application.

Definition at line 386 of file B2BITS_AdminApplication.h.

virtual void Engine::AdminApplication::onResendRequestEvent ( const ResendRequestEvent ,
const Session  
) [inline, protected, 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.

Implements Engine::Application.

Definition at line 357 of file B2BITS_AdminApplication.h.

virtual void Engine::AdminApplication::onSequenceGapEvent ( const SequenceGapEvent ,
const Session  
) [inline, protected, 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.

Implements Engine::Application.

Definition at line 324 of file B2BITS_AdminApplication.h.

virtual void Engine::AdminApplication::onSessionLevelRejectEvent ( const SessionLevelRejectEvent ,
const Session  
) [inline, protected, 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.

Implements Engine::Application.

Definition at line 332 of file B2BITS_AdminApplication.h.

virtual void Engine::AdminApplication::onUnableToRouteMessage ( const UnableToRouteMessageEvent ,
const Session  
) [inline, protected, 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.

Implements Engine::Application.

Definition at line 373 of file B2BITS_AdminApplication.h.

virtual void Engine::AdminApplication::onUnexpectedMessageEvent ( const UnexpectedMessageEvent ,
const Session  
) [inline, protected, 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 from Engine::Application.

Definition at line 316 of file B2BITS_AdminApplication.h.

virtual bool Engine::AdminApplication::process ( const FIXMessage msg,
const Session sn 
) [protected, 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.

Implements Engine::Application.

virtual bool Engine::AdminApplication::process ( const std::string &  action,
const xercesc_2_8::DOMNode *  element,
const Context context 
) [protected, virtual]

Processes action.

Parameters:
actionname.
elementxml element of action.
Returns:
true if action was identify and succesfully executed.
void Engine::AdminApplication::sendReject ( const Session sn,
const FIXMessage msg,
const std::string &  text 
) [protected]

Sends Reject message into the session.

void Engine::AdminApplication::sendResponse ( const std::string &  resultCode,
const std::string &  description,
const std::string &  additionalData,
const Context context 
) const [protected]

Sends response message to client in format: <?xml version="1.0"?> <Response resultcode="[resultCode]"> [description] [additionalData] </Response>

void Engine::AdminApplication::sendResponse ( const xercesc_2_8::DOMDocument *  response,
const Context context 
) const [protected]

Sends response message to client.

Parameters:
responseresponse body.
virtual void Engine::AdminApplication::sendResponse ( const std::string &  response,
const Context context 
) const [protected, virtual]

Sends response message to client.

Parameters:
responseresponse body.
void Engine::AdminApplication::sendResponse ( const std::string &  response,
const std::string &  targetID,
const FIXMessage msg,
const XMLCh requestId 
) const [protected]

Sends response message to client.

Parameters:
responseResponse body.
targetIDAdmin session's TargetCompID.
msgAdmin session's TargetCompID.
requestIdCommand request ID.
msgThe incoming message.
void Engine::AdminApplication::subscriptionListNotify ( SessionAction  status,
Session changedSsn,
const SessionContext reciverSsnInfo 
)

Handle notification on sessions creation or deleting.

void Engine::AdminApplication::terminate (  )

Terminates all administrative sessions.