OnixS Eurex ETI Handler C++ library  9.22.0
API documentation
Handler Class Reference

#include <OnixS/Eurex/Trading/Handler.h>

Public Member Functions

 Handler (const HandlerSettings &settings)
 
virtual ~Handler ()
 
void connect (const char *hostName, UInt16 port, const Logon &logon, const char *localNetworkInterface="")
 
void connect (const char *primaryHostName, UInt16 primaryPort, const char *secondaryHostName, UInt16 secondaryPort, const Logon &logon, const char *localNetworkInterface="")
 
void disconnect ()
 
void disconnectAsync ()
 
UInt32 send (Message &)
 
size_t tryThrottle ()
 
void registerErrorListener (ErrorListener *listener)
 
void registerWarningListener (WarningListener *listener)
 
void registerHandlerStateListener (HandlerStateListener *listener)
 
void registerSessionListener (SessionListener *listener)
 
void registerConnectionStateListener (ConnectionStateListener *listener)
 
void registerAdminListener (AdminListener *listener)
 
void registerStrategyCreationListener (StrategyCreationListener *listener)
 
void registerOrderHandlingListener (OrderHandlingListener *listener)
 
void registerQuoteAndCrossRequestListener (QuoteAndCrossRequestListener *listener)
 
void registerQuoteHandlingListener (QuoteHandlingListener *listener)
 
void registerInfoListener (InfoListener *listener)
 
void registerTESListener (TESListener *listener)
 
void registerSRQSListener (SRQSListener *listener)
 
HandlerState::Enum state () const
 
void log (LogLevel::Enum logLevel, const char *logMessage, size_t length)
 
void log (LogLevel::Enum logLevel, const char *logMessage)
 
void log (LogLevel::Enum logLevel, const std::string &str)
 
const std::string & licenseExpirationDate () const
 

Static Public Member Functions

static std::string encryptPassword (const std::string &password, const std::string &pubKeyPath)
 
static const std::string & version ()
 

Detailed Description

Definition at line 47 of file Handler.h.

Constructor & Destructor Documentation

Handler ( const HandlerSettings settings)

Performs instance initialization.

Parameters
settingsdefines values for various options which affect handler behavior like enabling logging during execution of the handler.
virtual ~Handler ( )
virtual

Finalizes the Handler.

Member Function Documentation

void connect ( const char *  hostName,
UInt16  port,
const Logon logon,
const char *  localNetworkInterface = "" 
)

Establishes the connection.

Note
Blocks until the logon reply is received.
Should be called only when Handler is disconnected.
Parameters
hostNameHostname to connect to.
portPort number to connect to.
logonInitial logon message parameters.
localNetworkInterfaceLocal network interface.
Exceptions
std::exceptionCannot set the local network interface.
std::exceptionCannot connect to hostname on port.
std::exceptionCannot configure size of receive buffer for the socket.
std::exceptionCannot configure size of send buffer for the socket.
OperationExceptionInvalid argument is given.
void connect ( const char *  primaryHostName,
UInt16  primaryPort,
const char *  secondaryHostName,
UInt16  secondaryPort,
const Logon logon,
const char *  localNetworkInterface = "" 
)

Establishes the connection.

Note
Blocks until the logon reply is received.
Should be called only when Handler is disconnected.
Parameters
primaryHostNamePrimary hostname to connect to.
primaryPortPrimary port number to connect to.
secondaryHostNameSecondary hostname to connect to.
secondaryPortSecondary port number to connect to.
logonInitial logon message parameters.
localNetworkInterfaceLocal network interface.
Exceptions
std::exceptionCannot set the local network interface.
std::exceptionCannot connect to hostname on port.
std::exceptionCannot configure size of receive buffer for the socket.
std::exceptionCannot configure size of send buffer for the socket.
OperationExceptionInvalid argument is given.
void disconnect ( )

Force session disconnect.

Note
Blocks until the Session Logout procedure is finished.
void disconnectAsync ( )

Async force session disconnect.

static std::string encryptPassword ( const std::string &  password,
const std::string &  pubKeyPath 
)
static

Encrypts the given password using the given key.

Parameters
passwordPassword to encrypt.
pubKeyPathPath to the RSA public key file.
Returns
Encrypted and Base64-encoded password.
const std::string& licenseExpirationDate ( ) const

Returns the license expiration date.

Date format is YYYYMMDD.

void log ( LogLevel::Enum  logLevel,
const char *  logMessage,
size_t  length 
)

Logs the given user-level message to the handler log.

void log ( LogLevel::Enum  logLevel,
const char *  logMessage 
)

Logs the given user-level message to the handler log.

void log ( LogLevel::Enum  logLevel,
const std::string &  str 
)

Logs the given user-level message to the handler log.

void registerAdminListener ( AdminListener listener)

Assigns listener for administrative events. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerConnectionStateListener ( ConnectionStateListener listener)

Assigns listener for connection state change events occurred while executing handler. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerErrorListener ( ErrorListener listener)

Assigns listener for errors occurred while executing handler. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected
void registerHandlerStateListener ( HandlerStateListener listener)

Assigns listener for state change events occurred while executing handler. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerInfoListener ( InfoListener listener)

Assigns listener for other events. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerOrderHandlingListener ( OrderHandlingListener listener)

Assigns listener for order handling events. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerQuoteAndCrossRequestListener ( QuoteAndCrossRequestListener listener)

Assigns listener for quote and cross request events. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerQuoteHandlingListener ( QuoteHandlingListener listener)

Assigns listener for quote handling events. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerSessionListener ( SessionListener listener)

Assigns listener for session events occurred while executing handler. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerSRQSListener ( SRQSListener listener)

Assigns listener for SRQS events. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerStrategyCreationListener ( StrategyCreationListener listener)

Assigns listener for strategy creation events. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerTESListener ( TESListener listener)

Assigns listener for TES events. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected.
void registerWarningListener ( WarningListener listener)

Assigns listener for warnings occurred while executing handler. It's permissible to change the listener multiple times during handler's life-time, but only when handler is in disconnected state.

Exceptions
OperationExceptionif handler not disconnected
UInt32 send ( Message )

Send message

Returns
MsgSeqNum
Exceptions
OperationExceptionAttempt to send data before connection creation
std::exceptionwith system dependent message if sending has been failed
HandlerState::Enum state ( ) const

Returns handler state.

size_t tryThrottle ( )

Checks the throttling of a session that must be called before each send function call.

If the count of messages per time unit exceeds the throttling limit, the function returns the delay (in milliseconds) until the sending becomes possible. Otherwise, it returns 0.

Note
This call is thread-safe.
static const std::string& version ( )
static

Returns Handler's version.


The documentation for this class was generated from the following file: