public interface MFClient
Create sessions using this class. They will be automatically registered with this MFClient.
Port calculation:
MFFactory.createMFClient(int)) then you can
provide AUTO_CALCULATE_PORT_VALUE as the port parameter when creating a session (either
trading or market data) and the port will be calculated automatically.
MFFactory.createMFClient() then you must
provide a port to the trading session (if any). If you do, then subsequent market data sessions can use the
AUTO_CALCULATE_PORT_VALUE as the port parameter and the port will be calculated using
the trading session's port.
| Modifier and Type | Field and Description |
|---|---|
static int |
AUTO_CALCULATE_PORT_VALUE |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isMarketDataSessionRegistered(long venueID)
Returns whether or not there is a registered market data session
for a venueID.
|
boolean |
isRunning()
If this MFClient instance is running.
|
boolean |
isStopped()
Returns true if this MFClient is stopped either due to an exception or the stop method being invoked.
|
MFMarketDataSession |
newTcpMarketDataPriceDepthBookSession(MFPriceDepthBookHandler handler,
java.lang.String venueName,
long venueID,
java.lang.String username,
java.lang.String password,
java.lang.String hostname,
int port,
boolean autoRelogon)
Creates and registers a
MFMarketDataSession for connecting to a particular
venue gateway over TCP. |
MFMarketDataSession |
newTcpMarketDataSession(MFMarketDataHandler handler,
java.lang.String venueName,
long venueID,
java.lang.String username,
java.lang.String password,
java.lang.String hostname,
int port,
boolean autoRelogon)
Creates and registers a
MFMarketDataSession for connecting to a particular
venue gateway over TCP. |
MFStpBookingSession |
newTcpStpBookingSession(MFStpBookingHandler handler,
java.lang.String username,
java.lang.String password,
java.lang.String hostname,
int port,
boolean autoRelogon)
Creates and registers a
MFStpBookingSession for connecting to a particular
venue gateway over TCP. |
MFTradeDateRolloverSession |
newTcpTradeDateRolloverSession(MFTradeDateRolloverHandler handler,
java.lang.String username,
java.lang.String password,
java.lang.String hostname,
int port,
boolean autoRelogon) |
MFTradingSession |
newTcpTradingSession(MFTradingHandler handler,
java.lang.String username,
java.lang.String password,
java.lang.String hostname,
int port,
boolean autoRelogon)
Creates and registers a session for connecting to the trading gateway
over TCP.
|
void |
run()
Runs the event loop.
|
void |
stop()
Stops the event loop and closes open sockets.
|
static final int AUTO_CALCULATE_PORT_VALUE
void run() throws MFException
stop(), the MFClient is dead and
cannot be reused.
Note: Only one thread should call this method. If another thread calls this method an MFException will be thrown.
Note: run() cannot be called after this MFClient is stop()ed. An exception will be thrown.
MFExceptionboolean isRunning()
run() should not be called if it is.run() has been called and is still executingvoid stop() throws MFException
This can be called from an external thread or internally from a handler.
MFException - if there was an problem shutting downboolean isStopped()
MFTradingSession newTcpTradingSession(MFTradingHandler handler, java.lang.String username, java.lang.String password, java.lang.String hostname, int port, boolean autoRelogon) throws MFException
You can only register a single trading session on an MFClient
See the port rules in the class documentation
autoRelogon - automatically relogons when a disconnection occurs.MFExceptionMFMarketDataSession newTcpMarketDataSession(MFMarketDataHandler handler, java.lang.String venueName, long venueID, java.lang.String username, java.lang.String password, java.lang.String hostname, int port, boolean autoRelogon) throws MFException
MFMarketDataSession for connecting to a particular
venue gateway over TCP.
See the port rules in the class documentation
autoRelogon - automatically relogons when a disconnection occurs.MFExceptionMFMarketDataSession newTcpMarketDataPriceDepthBookSession(MFPriceDepthBookHandler handler, java.lang.String venueName, long venueID, java.lang.String username, java.lang.String password, java.lang.String hostname, int port, boolean autoRelogon) throws MFException
MFMarketDataSession for connecting to a particular
venue gateway over TCP.
Provides market data updates as a PriceDepthBook through the provided MFPriceDepthBookHandler
See the port rules in the class documentation
autoRelogon - automatically relogons when a disconnection occurs.MFExceptionMFTradeDateRolloverSession newTcpTradeDateRolloverSession(MFTradeDateRolloverHandler handler, java.lang.String username, java.lang.String password, java.lang.String hostname, int port, boolean autoRelogon) throws MFException
MFExceptionMFStpBookingSession newTcpStpBookingSession(MFStpBookingHandler handler, java.lang.String username, java.lang.String password, java.lang.String hostname, int port, boolean autoRelogon) throws MFException
MFStpBookingSession for connecting to a particular
venue gateway over TCP.
See the port rules in the class documentationautoRelogon - automatically relogons when a disconnection occurs.MFExceptionboolean isMarketDataSessionRegistered(long venueID)
venueID - id of the venue to check