public class MFStpBookingSessionImpl extends java.lang.Object implements CoreStpBookingSession
| Modifier and Type | Field and Description |
|---|---|
protected long |
heartbeatIntervalMs |
protected java.lang.String |
hostname |
protected java.nio.ByteBuffer |
logoutMessage |
protected long |
logoutSentToServerMs |
protected long |
maximumAllowedTimeWithoutReceivingLogoutResponseFromServerMs |
protected long |
maximumAllowedTimeWithoutReceivingMessageMs |
protected int |
port |
protected java.nio.channels.Selector |
selector |
protected com.marketfactory.mfclient.internal.SessionState |
state |
protected static int |
TWO_SECONDS |
| Constructor and Description |
|---|
MFStpBookingSessionImpl(CoreStpBookingHandler handler,
java.nio.channels.Selector selector,
java.lang.String username,
java.lang.String password,
java.lang.String hostname,
int port,
boolean relogonOnDisconnect,
long heartbeatIntervalMs,
MFProtoInputBufferStpBooking inputBuffer,
BufferProvider bufferProvider,
com.marketfactory.mfclient.internal.ChannelProvider channelProvider) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeAndReset(boolean reconnectionPossible) |
void |
confirmation(mfstp_booking.ConfirmationEncoder confirmation) |
protected void |
encodeHeartbeatMessage() |
protected void |
encodeLogonMessage(byte[] username,
byte[] password) |
protected void |
encodeLogoutMessage() |
protected void |
encodeLogoutResponse() |
mfstp_booking.ConfirmationEncoder |
getConfirmationEncoder() |
mfstp_booking.NewOrderSingleEncoder |
getNewOrderSingleEncoder() |
mfstp_booking.OrderCancelReplaceRequestEncoder |
getOrderCancelReplaceRequestEncoder() |
mfstp_booking.OrderCancelRequestEncoder |
getOrderCancelRequestEncoder() |
int |
getPort()
The port used for this session.
|
long |
getSendingTime() |
protected com.marketfactory.mfclient.internal.SessionState.State |
getState() |
mfstp_booking.TradeCaptureReportSpotForwardEncoder |
getTradeCaptureReportSpotForwardEncoder() |
mfstp_booking.TradeCaptureReportSwapEncoder |
getTradeCaptureReportSwapEncoder() |
java.lang.String |
getUsername() |
protected void |
handleMessage(int msgID) |
boolean |
isLoggedOn() |
void |
logon()
Sends a logon message with the supplied username and password.
|
void |
logon(long nextExpectedMsgSeqNum) |
void |
logout()
Initiates logout.
|
void |
logoutResponse()
The response to a logout from the server.
|
void |
newOrderSingle(mfstp_booking.NewOrderSingleEncoder newOrderSingle) |
protected void |
notifyUserOfConnection() |
protected void |
notifyUserOfDisconnection(java.lang.String message) |
void |
onConnectable() |
protected void |
onLogonResponseMessageReceived() |
protected void |
onLogoutMessageReceived() |
protected void |
onLogoutResponseMessageReceived() |
void |
onReadable() |
void |
onTimer(long now) |
void |
orderCancelReplaceRequest(mfstp_booking.OrderCancelReplaceRequestEncoder orderCancelReplaceRequest) |
void |
orderCancelRequest(mfstp_booking.OrderCancelRequestEncoder orderCancelRequest) |
void |
securityDefinitionRequest()
Requests information about the securities supported on this venue.
|
void |
start() |
void |
stop() |
void |
tradeCaptureReportSpotForward(mfstp_booking.TradeCaptureReportSpotForwardEncoder tradeCaptureReportSpotForward) |
void |
tradeCaptureReportSwap(mfstp_booking.TradeCaptureReportSwapEncoder tradeCaptureReportSwap) |
protected void |
write(MFProtoOutputBuffer buffer,
int encodedLength) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPort, getSendingTime, getUsername, isLoggedOn, logout, logoutResponseprotected static final int TWO_SECONDS
protected final java.lang.String hostname
protected final int port
protected final long heartbeatIntervalMs
protected final java.nio.channels.Selector selector
protected final java.nio.ByteBuffer logoutMessage
protected long logoutSentToServerMs
protected final com.marketfactory.mfclient.internal.SessionState state
protected final long maximumAllowedTimeWithoutReceivingMessageMs
protected final long maximumAllowedTimeWithoutReceivingLogoutResponseFromServerMs
public MFStpBookingSessionImpl(CoreStpBookingHandler handler, java.nio.channels.Selector selector, java.lang.String username, java.lang.String password, java.lang.String hostname, int port, boolean relogonOnDisconnect, long heartbeatIntervalMs, MFProtoInputBufferStpBooking inputBuffer, BufferProvider bufferProvider, com.marketfactory.mfclient.internal.ChannelProvider channelProvider)
public void start()
public void stop()
throws MFException
MFExceptionprotected void encodeLogoutResponse()
throws MFException
MFExceptionpublic void tradeCaptureReportSpotForward(mfstp_booking.TradeCaptureReportSpotForwardEncoder tradeCaptureReportSpotForward)
throws MFException
tradeCaptureReportSpotForward in interface CoreStpBookingSessionMFExceptionpublic mfstp_booking.TradeCaptureReportSpotForwardEncoder getTradeCaptureReportSpotForwardEncoder()
getTradeCaptureReportSpotForwardEncoder in interface CoreStpBookingSessionpublic void tradeCaptureReportSwap(mfstp_booking.TradeCaptureReportSwapEncoder tradeCaptureReportSwap)
throws MFException
tradeCaptureReportSwap in interface CoreStpBookingSessionMFExceptionpublic mfstp_booking.TradeCaptureReportSwapEncoder getTradeCaptureReportSwapEncoder()
getTradeCaptureReportSwapEncoder in interface CoreStpBookingSessionpublic void confirmation(mfstp_booking.ConfirmationEncoder confirmation)
throws MFException
confirmation in interface CoreStpBookingSessionMFExceptionpublic mfstp_booking.ConfirmationEncoder getConfirmationEncoder()
getConfirmationEncoder in interface CoreStpBookingSessionpublic mfstp_booking.OrderCancelRequestEncoder getOrderCancelRequestEncoder()
getOrderCancelRequestEncoder in interface CoreStpBookingSessionpublic void orderCancelRequest(mfstp_booking.OrderCancelRequestEncoder orderCancelRequest)
throws MFException
orderCancelRequest in interface CoreStpBookingSessionMFExceptionpublic mfstp_booking.OrderCancelReplaceRequestEncoder getOrderCancelReplaceRequestEncoder()
getOrderCancelReplaceRequestEncoder in interface CoreStpBookingSessionpublic void orderCancelReplaceRequest(mfstp_booking.OrderCancelReplaceRequestEncoder orderCancelReplaceRequest)
throws MFException
orderCancelReplaceRequest in interface CoreStpBookingSessionMFExceptionpublic mfstp_booking.NewOrderSingleEncoder getNewOrderSingleEncoder()
getNewOrderSingleEncoder in interface CoreStpBookingSessionpublic void newOrderSingle(mfstp_booking.NewOrderSingleEncoder newOrderSingle)
throws MFException
newOrderSingle in interface CoreStpBookingSessionMFExceptionprotected void handleMessage(int msgID)
throws MFException
MFExceptionprotected void encodeLogoutMessage()
throws MFException
MFExceptionprotected void encodeLogonMessage(byte[] username,
byte[] password)
throws MFException
MFExceptionprotected void encodeHeartbeatMessage()
throws MFException
MFExceptionprotected void notifyUserOfDisconnection(java.lang.String message)
protected void notifyUserOfConnection()
public void logon()
throws MFException
CoreSessionlogon in interface CoreSessionlogon in interface CoreStpBookingSessionMFException - If there is an error when attempting to
send this message.public void logon(long nextExpectedMsgSeqNum)
throws MFException
logon in interface CoreStpBookingSessionMFExceptionpublic void securityDefinitionRequest()
throws MFException
CoreStpBookingSessionsecurityDefinitionRequest in interface CoreStpBookingSessionMFException - If there is an error when attempting to
send this message.public java.lang.String getUsername()
getUsername in interface CoreSessionpublic int getPort()
CoreSessiongetPort in interface CoreSessionpublic void logout()
throws MFException
CoreSessionlogout in interface CoreSessionMFException - If there is an error when attempting to
send this message.public void logoutResponse()
throws MFException
CoreSessionlogoutResponse in interface CoreSessionMFException - If there is an error when attempting to
send this message.public boolean isLoggedOn()
isLoggedOn in interface CoreSessionpublic void onReadable()
throws MFException
MFExceptionpublic void onConnectable()
throws MFException
MFExceptionpublic void onTimer(long now)
throws MFException
MFExceptionpublic long getSendingTime()
getSendingTime in interface CoreSessionprotected com.marketfactory.mfclient.internal.SessionState.State getState()
protected void onLogonResponseMessageReceived()
throws MFException
MFExceptionprotected void onLogoutMessageReceived()
protected void onLogoutResponseMessageReceived()
protected void write(MFProtoOutputBuffer buffer, int encodedLength) throws MFException
MFExceptionprotected void closeAndReset(boolean reconnectionPossible)
throws MFException
MFException