OnixS C++ CME iLink 3 Binary Order Entry Handler  1.9.0
API Documentation
SessionListener.h
Go to the documentation of this file.
1 /*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable OnixS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 
20 #pragma once
21 
22 #include <OnixS/CME/iLink3/ABI.h>
25 
26 #include <string>
27 
28 namespace OnixS {
29 namespace CME {
30 namespace iLink3 {
31 
33 
34 /**
35  * Session Warning Reason.
36  */
38 {
39  enum Enum
40  {
41  /// General session-related warning.
43 
44  /// Incoming message sequence gap is detected.
46 
47  /// Received the <a href="https://www.cmegroup.com/confluence/display/EPICSANDBOX/Sequence">Sequence</a> message with
48  /// the `Lapsed` value of the `KeepAliveIntervalLapsed` field.
50 
51  /// Unexpected SBE Schema version is received from CME.
53 
54  /// The value of the `PreviousUUID` field in the received
55  /// <a href="https://www.cmegroup.com/confluence/display/EPICSANDBOX/Establishment+Acknowledgment">Establishment Acknowledgment</a>
56  /// message does not match to the local value.
58 
59  /// Received an unsupported message type.
61  };
62 };
63 
64 /**
65  * Session Error Reason.
66  */
68 {
69  enum Enum
70  {
71  /// A general session-related error.
73 
74  /// First message received is not the <i>NegotiationResponse</i> or <i>EstablishmentAck</i> message.
76 
77  /// The <i>Negotiation Reject</i> message is received in reply to the <i>Negotiation</i> message.
79 
80  /// The <i>Establishment Reject</i> message is received in reply to the <i>Establish</i> message.
82 
83  /// The <i>Retransmit Reject</i> message is received in reply to the <i>Retransmit Request</i> message.
85 
86  /// The <i>Terminate</i> message is received in reply to the <i>Establish</i> message.
88 
89  /// The incoming message has a sequence number less than expected and the <i>PossDupFlag</i> is not
90  /// set, it indicates a serious error.
91  /// The incoming message has a sequence number less than expected and the <i>PossDupFlag</i> is not set, it
92  /// indicates a serious error. It is strongly recommended that the session be terminated and manual intervention
93  /// be initiated.
95 
96  /// Connection cannot be restored.
98 
99  /// Connection cannot be established.
101 
102  /// Exception during processing of an incoming message.
104 
105  /// Received an invalid incoming message.
107 
108  /// Exception was thrown from user's event handler.
110 
111  /// A response has not been received during the specified timeout.
113 
114  /// When two times the `KeepAliveInterval` has expired and no keep alive
115  /// message is received then the session is terminated ungracefully and will need to be re-established.
117 
118  /// Telecommunication link error is detected.
120 
121  /// After sending the initial Negotiate or Establish message the telecommunication link error is detected.
123 
124  /// Received an unexpected `NextSeqNo` value.
126 
127  /// The program is finishing its execution.
129 
130  /// The Exchange sent the initial Terminate message.
131  ExchangeInitiatedTerminateMessage
132  };
133 };
134 
135 /// Action to be taken when the <a href="https://www.cmegroup.com/confluence/display/EPICSANDBOX/Not+Applied">NotApplied message</a> is received from the exchange.
137  /// Action to be taken when the <a href="https://www.cmegroup.com/confluence/display/EPICSANDBOX/Not+Applied">NotApplied message</a> is received from the exchange.
138  enum Enum {
139  /// No messages are sent in reply.
141 
142  /// Send the <a href="https://www.cmegroup.com/confluence/display/EPICSANDBOX/Sequence">Sequence</a> message.
144 
145  /// The default action.
146  Default = DoNothing
147  };
148 };
149 
150 /// Session's Listener.
152 {
153 public:
154  virtual void onNegotiationResponse(const Messaging::NegotiationResponse501 & /*msg*/, Session * /*sn*/) {}
155  virtual void onNegotiationReject(const Messaging::NegotiationReject502 & /*msg*/, Session * /*sn*/) {}
156  virtual void onEstablishmentAck(const Messaging::EstablishmentAck504 & /*msg*/, Session * /*sn*/) {}
157  virtual void onEstablishmentReject(const Messaging::EstablishmentReject505 & /*/*msg*/, Session * /*sn*/) {}
158  virtual void onSequence(const Messaging::Sequence506 & /*msg*/, Session * /*sn*/) {}
159  virtual void onTerminate(const Messaging::Terminate507 & /*msg*/, Session * /*sn*/) {}
160  virtual void onRetransmitReject(const Messaging::RetransmitReject510 & /*msg*/, Session * /*sn*/) {}
161  virtual void onRetransmission(const Messaging::Retransmission509 & /*msg*/, Session * /*sn*/) {}
162  virtual void onFailover(Messaging::FTI::Enum /*faultToleranceIndicator*/, Session * /*sn*/) {}
163 
166  }
167 
168  virtual void onBusinessReject(const Messaging::BusinessReject521 & /*msg*/, Session * /*sn*/) {}
169  virtual void onExecutionReportNew(const Messaging::ExecutionReportNew522 & /*msg*/, Session * /*sn*/) {}
170  virtual void onExecutionReportModify(const Messaging::ExecutionReportModify531 & /*msg*/, Session * /*sn*/) {}
171  virtual void onExecutionReportCancel(const Messaging::ExecutionReportCancel534 & /*msg*/, Session * /*sn*/) {}
172  virtual void onExecutionReportStatus(const Messaging::ExecutionReportStatus532 & /*msg*/, Session * /*sn*/) {}
177  virtual void onExecutionReportReject(const Messaging::ExecutionReportReject523 & /*msg*/, Session * /*sn*/) {}
181  virtual void onOrderCancelReject(const Messaging::OrderCancelReject535 & /*msg*/, Session * /*sn*/) {}
184  virtual void onMassQuoteAck(const Messaging::MassQuoteAck545 & /*msg*/, Session * /*sn*/) {}
185  virtual void onRequestForQuoteAck(const Messaging::RequestForQuoteAck546 & /*msg*/, Session * /*sn*/) {}
186  virtual void onQuoteCancelAck(const Messaging::QuoteCancelAck563& /*msg*/, Session* /*sn*/) {}
187  virtual void onOrderMassActionReport(const Messaging::OrderMassActionReport562& /*msg*/, Session* /*sn*/) {}
189  virtual void onPartyDetailsListReport(const Messaging::PartyDetailsListReport538 & /*msg*/, Session * /*sn*/) {}
190 
191  /// Called when the application-level message is sent to the counterparty.
192  virtual void onOutboundApplicationMsg(const Messaging::SbeMessage& /*msg*/, Session* /*sn*/) {}
193 
194  /// Called when the session-level message is sent to the counterparty.
195  virtual void onOutboundSessionMsg(const Messaging::SbeMessage& /*msg*/, Session * /*sn*/) {}
196 
197  /// Called as soon as bytes are received from the wire.
198  virtual void onReceivedBytes(const char * /*bytes*/, size_t /*size*/, Session * /*sn*/) {}
199 
200  /// Called when the SBE message is about to be sent to the wire.
201  virtual void onMessageSending(char * /*bytes*/, size_t /*size*/, Session * /*sn*/) {}
202 
203  /// Called when the session changes its state.
204  virtual void onStateChange(SessionStateId::Enum /*newState*/, SessionStateId::Enum /*prevState*/, Session * /*sn*/) {}
205 
206  /// Called when an error condition is detected.
207  virtual void onError(SessionErrorReason::Enum /*reason*/, const std::string & /*description*/, Session * /*sn*/) {}
208 
209  /// Called when a warning condition is detected.
210  virtual void onWarning(SessionWarningReason::Enum /*reason*/, const std::string & /*description*/, Session * /*sn*/) {}
211 
212  protected:
213  virtual ~SessionListener() = 0;
214 };
215 
216 }
217 }
218 }
An iLink 3 Session.
Definition: Session.h:38
virtual void onOrderMassActionReport(const Messaging::OrderMassActionReport562 &, Session *)
virtual void onNegotiationResponse(const Messaging::NegotiationResponse501 &, Session *)
Action to be taken when the NotApplied message is received from the exchange.
virtual void onEstablishmentAck(const Messaging::EstablishmentAck504 &, Session *)
virtual void onEstablishmentReject(const Messaging::EstablishmentReject505 &, Session *)
virtual void onExecutionReportCancel(const Messaging::ExecutionReportCancel534 &, Session *)
Enum
Action to be taken when the NotApplied message is received from the exchange.
virtual void onBusinessReject(const Messaging::BusinessReject521 &, Session *)
After sending the initial Negotiate or Establish message the telecommunication link error is detected...
virtual void onExecutionReportNew(const Messaging::ExecutionReportNew522 &, Session *)
virtual void onExecutionReportTradeAddendumOutright(const Messaging::ExecutionReportTradeAddendumOutright548 &, Session *)
Received the Sequence message with the Lapsed value of the KeepAliveIntervalLapsed field...
virtual void onQuoteCancelAck(const Messaging::QuoteCancelAck563 &, Session *)
virtual void onSequence(const Messaging::Sequence506 &, Session *)
The Establishment Reject message is received in reply to the Establish message.
virtual void onExecutionReportTradeOutright(const Messaging::ExecutionReportTradeOutright525 &, Session *)
virtual void onExecutionReportTradeAddendumSpread(const Messaging::ExecutionReportTradeAddendumSpread549 &, Session *)
Exception was thrown from user&#39;s event handler.
When two times the KeepAliveInterval has expired and no keep alive message is received then the sessi...
virtual void onRequestForQuoteAck(const Messaging::RequestForQuoteAck546 &, Session *)
virtual void onExecutionReportTradeAddendumSpreadLeg(const Messaging::ExecutionReportTradeAddendumSpreadLeg550 &, Session *)
virtual void onPartyDetailsListReport(const Messaging::PartyDetailsListReport538 &, Session *)
virtual void onFailover(Messaging::FTI::Enum, Session *)
virtual void onRetransmitReject(const Messaging::RetransmitReject510 &, Session *)
virtual void onExecutionReportTradeSpreadLeg(const Messaging::ExecutionReportTradeSpreadLeg527 &, Session *)
Definition: Defines.h:40
virtual void onMassQuoteAck(const Messaging::MassQuoteAck545 &, Session *)
The Retransmit Reject message is received in reply to the Retransmit Request message.
virtual void onRetransmission(const Messaging::Retransmission509 &, Session *)
The Terminate message is received in reply to the Establish message.
virtual void onReceivedBytes(const char *, size_t, Session *)
Called as soon as bytes are received from the wire.
Telecommunication link error is detected.
#define ONIXS_ILINK3_API_DECL(typeKind, typeName)
Definition: ABI.h:29
virtual void onPartyDetailsDefinitionRequestAck(const Messaging::PartyDetailsDefinitionRequestAck519 &, Session *)
virtual void onSecurityDefinitionResponse(const Messaging::SecurityDefinitionResponse561 &, Session *)
The incoming message has a sequence number less than expected and the PossDupFlag is not set...
A response has not been received during the specified timeout.
virtual void onOrderCancelReplaceReject(const Messaging::OrderCancelReplaceReject536 &, Session *)
First message received is not the NegotiationResponse or EstablishmentAck message.
virtual void onNegotiationReject(const Messaging::NegotiationReject502 &, Session *)
virtual void onMessageSending(char *, size_t, Session *)
Called when the SBE message is about to be sent to the wire.
virtual void onExecutionReportReject(const Messaging::ExecutionReportReject523 &, Session *)
#define ONIXS_ILINK3_EXPORTED
Definition: Compiler.h:162
virtual void onTerminate(const Messaging::Terminate507 &, Session *)
The value of the PreviousUUID field in the received Establishment Acknowledgment message does not mat...
virtual void onOutboundApplicationMsg(const Messaging::SbeMessage &, Session *)
Called when the application-level message is sent to the counterparty.
virtual void onExecutionReportModify(const Messaging::ExecutionReportModify531 &, Session *)
virtual void onExecutionReportElimination(const Messaging::ExecutionReportElimination524 &, Session *)
virtual void onOrderCancelReject(const Messaging::OrderCancelReject535 &, Session *)
virtual NotAppliedAction::Enum onNotApplied(const Messaging::NotApplied513 &, Session *)
Unexpected SBE Schema version is received from CME.
virtual void onWarning(SessionWarningReason::Enum, const std::string &, Session *)
Called when a warning condition is detected.
Received an invalid incoming message.
virtual void onError(SessionErrorReason::Enum, const std::string &, Session *)
Called when an error condition is detected.
virtual void onExecutionReportTradeSpread(const Messaging::ExecutionReportTradeSpread526 &, Session *)
virtual void onOutboundSessionMsg(const Messaging::SbeMessage &, Session *)
Called when the session-level message is sent to the counterparty.
virtual void onExecutionReportStatus(const Messaging::ExecutionReportStatus532 &, Session *)
The Negotiation Reject message is received in reply to the Negotiation message.
virtual void onStateChange(SessionStateId::Enum, SessionStateId::Enum, Session *)
Called when the session changes its state.