public class Session extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Session.ErrorArgs
Error event data.
|
static interface |
Session.ErrorListener
Error event listener.
|
static class |
Session.ErrorReason
Error reason.
|
static class |
Session.FlatMessageEventArgs
Flat message related event data.
|
static class |
Session.InboundApplicationFlatMessageArgs
Inbound application-level message received from the counterparty event data.
|
static interface |
Session.InboundApplicationFlatMessageListener
Inbound application-level message received from the counterparty event listener.
|
static class |
Session.InboundApplicationMessageArgs
Inbound application-level message received from the counterparty event data.
|
static interface |
Session.InboundApplicationMessageListener
Inbound application-level message received from the counterparty event listener.
|
static class |
Session.InboundSessionFlatMessageArgs
Inbound session-level message received from the counterparty event data.
|
static interface |
Session.InboundSessionFlatMessageListener
Inbound session-level message received from the counterparty event listener.
|
static class |
Session.InboundSessionMessageArgs
Inbound session-level message received from the counterparty event data.
|
static interface |
Session.InboundSessionMessageListener
Inbound session-level message received from the counterparty event listener.
|
static class |
Session.MessageEventArgs
Message related event data.
|
static class |
Session.MessageResendingArgs
Message resend request received from the counterparty event data.
|
static interface |
Session.MessageResendingListener
Message resend request received from the counterparty event listener.
|
static class |
Session.MessageSendingArgs
Bytes is about to be sent to the wire event data.
|
static interface |
Session.MessageSendingListener
Bytes is about to be sent to the wire event listener.
|
static class |
Session.OutboundApplicationFlatMessageArgs
Outbound application-level flat message queued for sending event data.
|
static interface |
Session.OutboundApplicationFlatMessageListener
Outbound application-level flat message queued for sending event listener.
|
static class |
Session.OutboundApplicationMessageArgs
Outbound application-level message queued for sending event data.
|
static interface |
Session.OutboundApplicationMessageListener
Outbound application-level message queued for sending event listener.
|
static class |
Session.OutboundSessionMessageArgs
Outbound session-level message queued for sending event data.
|
static interface |
Session.OutboundSessionMessageListener
Outbound session-level message queued for sending event listener.
|
static class |
Session.ReceivedBytesArgs
Bytes are received from the wire event data.
|
static interface |
Session.ReceivedBytesListener
Bytes are received from the wire event listener.
|
static class |
Session.StateChangeArgs
Session state changed event data.
|
static interface |
Session.StateChangeListener
Session state changed event listener.
|
static class |
Session.WarningArgs
Warning event data.
|
static interface |
Session.WarningListener
Warning event listener.
|
static class |
Session.WarningReason
Warning reason.
|
Constructor and Description |
---|
Session(SessionId sessionId)
Creates the FIX Session.
|
Session(SessionId sessionId,
boolean keepSequenceNumbersBetweenFixConnections,
SessionStorageType storageType)
Creates the FIX Session.
|
Session(SessionId sessionId,
SessionStorageType storageType)
Creates the FIX Session.
|
Session(SessionReactor sessionReactor,
String senderCompID,
String targetCompID,
Version version)
Creates the FIX session.
|
Session(SessionReactor sessionReactor,
String senderCompID,
String targetCompID,
Version version,
boolean keepSequenceNumbersBetweenFixConnections,
String token,
boolean cleanStart,
SessionStorageType storageType)
Creates the FIX Session.
|
Session(String senderCompID,
String targetCompID,
Version version)
Creates the FIX session.
|
Session(String senderCompID,
String targetCompID,
Version version,
boolean keepSequenceNumbersBetweenFixConnections)
Creates the FIX session.
|
Session(String senderCompID,
String targetCompID,
Version version,
boolean keepSequenceNumbersBetweenFixConnections,
SessionStorageType storageType)
Creates the FIX Session.
|
Session(String senderCompID,
String targetCompID,
Version version,
boolean keepSequenceNumbersBetweenFixConnections,
String token)
Creates the FIX session.
|
Session(String senderCompID,
String targetCompID,
Version version,
boolean keepSequenceNumbersBetweenFixConnections,
String token,
boolean cleanStart)
Creates the FIX Session.
|
Session(String senderCompID,
String targetCompID,
Version version,
boolean keepSequenceNumbersBetweenFixConnections,
String token,
SessionStorageType storageType)
Creates the FIX Session.
|
Session(String senderCompID,
String targetCompID,
Version version,
SessionStorageType storageType)
Creates the FIX Session.
|
Session(String senderCompID,
String targetCompID,
Version version,
String token)
Creates the FIX session.
|
Modifier and Type | Method and Description |
---|---|
Session |
addStateChangeListener(Session.StateChangeListener listener)
Adds state change listener.
|
Session |
breakConnection()
The socket is closed.
|
void |
dispose()
Finishes session object lifecycle.
|
ConnectionMode |
getConnectionMode()
Returns session connection mode.
|
String |
getCounterpartyHost()
Returns the hostname of remote host, or the string form of the address if it doesn't have a hostname.
|
String |
getCounterpartyHostAsSpecified()
Returns the remote host name or address as specified during
logonAsInitiator(String, int) method
call. |
int |
getCounterpartyPort()
Gets the counterparty port number.
|
Session.ErrorListener |
getErrorListener()
Returns error listener.
|
int |
getHeartBtInt()
Returns the Heartbeat interval (seconds, the HeartBtInt (tag=108) field value).
|
SessionId |
getId()
Returns session id.
|
Session.InboundApplicationFlatMessageListener |
getInboundApplicationFlatMessageListener()
Returns inbound application flat message listener.
|
Session.InboundApplicationMessageListener |
getInboundApplicationMessageListener()
Returns inbound application message listener.
|
MessageFilter |
getInboundMessageLogFilter()
Returns
MessageFilter object used to filter out inbound messages from the logs. |
Session.InboundSessionFlatMessageListener |
getInboundSessionFlatMessageListener()
Returns inbound session flat message listener.
|
Session.InboundSessionMessageListener |
getInboundSessionMessageListener()
Returns inbound session message listener.
|
int |
getIncomingMessageGapQueueMaximumSize()
Returns maximum size of the incoming message gap queue.
|
long |
getInSeqNum()
Returns the expected sequence number of the next incoming message.
|
int |
getListenPort()
Returns the port to listen on for incoming FIX Connections in Acceptor mode.
|
int |
getLocalPort()
Returns the local port from which you intend to send and receive data.
|
PortRange |
getLocalPortRange()
Returns the local port range, the first available port from this range
will be used to send and receive data.
|
int |
getLogonConfirmationTimeout()
Returns number of seconds to wait for a logon response before disconnecting.
|
int |
getLogoutConfirmationTimeout()
Returns number of seconds to wait for a logout response before disconnecting.
|
Message |
getLogoutMessage()
Returns logout message.
|
int |
getMaxStorageSize()
Returns the maximum size of the storage in messages.
|
MessageMode |
getMessageMode()
Returns message mode used for processing/parsing raw messages internally.
|
Session.MessageResendingListener |
getMessageResendingListener()
Returns message resending listener.
|
Session.MessageSendingListener |
getMessageSendingListener()
Returns message sending listener.
|
Session.OutboundApplicationFlatMessageListener |
getOutboundApplicationFlatMessageListener()
Returns outbound application flat message listener.
|
Session.OutboundApplicationMessageListener |
getOutboundApplicationMessageListener()
Returns outbound application message listener.
|
List<FixMessage> |
getOutboundMessages(long beginSequenceNumber,
long endSequenceNumber)
Returns outbound messages with the specified sequence number interval.
|
long |
getOutboundQueueBytes()
Returns the total size of messages in the outgoing queue in bytes.
|
Session.OutboundSessionMessageListener |
getOutboundSessionMessageListener()
Returns outbound session message listener.
|
long |
getOutSeqNum()
Returns the expected sequence number of the next outgoing message.
|
int |
getReasonableTransmissionTime()
Returns reasonable transmission time as % from heartbeat interval value.
|
int |
getReceiveBufferSize()
Returns the size of the TCP socket buffer allocated for receiving data, in bytes.
|
Session.ReceivedBytesListener |
getReceivedBytesListener()
Returns received bytes listener.
|
long |
getReceiveSpinningTimeout()
Returns the current receive spinning timeout value (in nanoseconds).
|
long |
getResendingQueueSize()
Returns the number of sent messages that are available for resending on counterparty's Resend Request(2) message.
|
ResendRequestLogic |
getResendRequestLogic()
Returns resend request logic.
|
int |
getResendRequestMaximumRange()
Returns the maximum number of messages to be requested in one Resend Request (MsgType=2) message.
|
SessionRole |
getRole()
Returns the session role.
|
Collection<Integer> |
getScrambleLogonFields()
Returns scrambled fields in the Logon(A) message.
|
int |
getSendBufferSize()
Returns the size of the TCP socket buffer allocated for sending data, in bytes.
|
String |
getSenderCompID()
Gets the assigned value used to identify firm sending message (the SenderCompID (tag=49) field value in
outgoing messages).
|
String |
getSenderLocationID()
Returns the value of SenderLocationID (142) field that will be set in all outgoing messages.
|
String |
getSenderSubID()
Returns the value of SenderSubID (50) field that will be set in all outgoing messages.
|
TimestampFormat |
getSendingTimeFormat()
Returns the time format of SendingTime of every sent message as
Timestamp . |
long |
getSendSpinningTimeout()
Returns the current send spinning timeout value (in nanoseconds).
|
SessionId |
getSessionId()
Returns session id.
|
SessionState |
getState()
Returns session state.
|
List<Session.StateChangeListener> |
getStateChangeListeners()
Returns state change listeners.
|
SessionStorage |
getStorage()
Returns session storage.
|
String |
getStorageID()
Returns the id of the session storage.
|
String |
getTargetCompID()
Assigned value used to identify receiving firm (the TargetCompID (tag=56) field value in outgoing
messages).
|
String |
getTargetLocationID()
Returns the value of TargetLocationID (143) field that will be set in all outgoing messages.
|
String |
getTargetSubID()
Returns the value of TargetSubID (57) field that will be set in all outgoing messages.
|
boolean |
getTcpNoDelay()
Tests if TCP_NODELAY socket option is enabled.
|
String |
getTestRequestIdPattern()
Returns the pattern describing the date and time format which will be used as a TestReqID(112) field value.
|
TimestampProvider |
getTimestampProvider()
Returns the timestamp provider which is used to provide timestamp for writing messages to log and for setting
SendingTime tag.
|
String |
getToken() |
Version |
getVersion()
Returns the session FIX version.
|
Session.WarningListener |
getWarningListener()
Returns warning listener.
|
boolean |
isConsiderRejectOnResendRequestAsGapFill()
Returns whether to consider Reject(3) on Resend Request(2) as Gap Fill.
|
boolean |
isDisposed() |
boolean |
isEventArgReuse()
Returns whether to re-use event argument objects.
|
boolean |
isInboundMessageReuse()
Returns whether to use the same
FixMessage object for the incoming messages. |
boolean |
isLogBeforeSending()
Returns whether outbound messages are logged before sending.
|
boolean |
isLogInboundMessages()
Returns whether to store inbound messages in the session storage.
|
boolean |
isLogOutboundMessages()
Returns whether to store outbound messages in the session storage.
|
boolean |
isProcessLogonNextExpectedMsgSeqNum()
Returns whether to process NextExpectedMsgSeqNum(789) field in Logon(A).
|
boolean |
isRequestOnlyMissedMessages()
Returns true if the "Resend Request" message requests only missed messages, otherwise - false.
|
boolean |
isSpecifyApplIdField()
Returns whether to specify ApplVerID(1128) tag in all FIX messages when a FIX protocol version FIX 5.0 and
above is used.
|
boolean |
isSpecifyLastMsgSeqNumProcessed()
Returns the option to specify the LastMsgSeqNumProcessed (tag # 369) field on every message sent.
|
boolean |
isUpdateSendingTime()
Returns whether to update
SendingTime(52)
field in the outgoing message if it is already set.
|
boolean |
isUserSessionLevelMessageWarning()
Returns whether to warn if user sends session level message.
|
boolean |
isValidateSequenceNumbers()
Returns whether to validate incoming message sequence numbers.
|
Session |
logonAsAcceptor()
Establishes FIX Connection as Acceptor.
|
Session |
logonAsInitiator(String host,
int port)
Establishes FIX Connection as Initiator using the default heartbeat value.
|
Session |
logonAsInitiator(String host,
int port,
boolean setResetSeqNumFlag)
Establishes FIX connection as Initiator.
|
Session |
logonAsInitiator(String host,
int port,
boolean setResetSeqNumFlag,
Message customLogonMsg)
Establishes FIX connection as Initiator using the custom Logon message.
|
Session |
logonAsInitiator(String host,
int port,
int heartBtInt)
Establishes FIX connection as Initiator.
|
Session |
logonAsInitiator(String host,
int port,
int heartBtInt,
boolean setResetSeqNumFlag)
Establishes FIX connection as Initiator.
|
Session |
logonAsInitiator(String host,
int port,
int heartBtInt,
boolean setResetSeqNumFlag,
Message customLogonMsg)
Establishes FIX connection as Initiator using the custom Logon message.
|
Session |
logonAsInitiator(String host,
int port,
int heartBtInt,
Message customLogonMsg)
Establishes FIX connection as Initiator using the custom Logon message.
|
Session |
logonAsInitiator(String host,
int port,
Message customLogonMsg)
Establishes FIX connection as Initiator using the custom Logon message.
|
CompletableFuture<Void> |
logonAsInitiatorAsync(String host,
int port,
int heartBtInt,
boolean setResetSeqNumFlag,
Message customLogonMsg)
Asynchronously establishes FIX connection as Initiator using the custom Logon message.
|
Session |
logout()
Terminates the FIX connection.
|
Session |
logout(Message logoutMessage)
Terminates the FIX connection.
|
Session |
logout(String text)
Terminates the FIX connection.
|
CompletableFuture<Void> |
logoutAsync()
Asynchronously terminates the FIX connection.
|
CompletableFuture<Void> |
logoutAsync(Message logoutMessage)
Asynchronously terminates the FIX connection.
|
CompletableFuture<Void> |
logoutAsync(String text)
Asynchronously terminates the FIX connection.
|
Session |
preFill(FlatMessage flatMessage)
Pre-fills session-level fields that are constant during the session's lifetime - SenderCompId, TargetCompId,
SenderLocationId, TargetLocationID, SenderSubID, TargetSubID and removing PossDupFlag.
|
Session |
preFill(List<Message> messages)
Pre-fills session-level fields that are constant during the session's lifetime - SenderCompId, TargetCompId,
SenderLocationId, TargetLocationID, SenderSubID, TargetSubID and removing PossDupFlag.
|
Session |
preFill(Message message)
Pre-fills session-level fields that are constant during the session's lifetime - SenderCompId, TargetCompId,
SenderLocationId, TargetLocationID, SenderSubID, TargetSubID and removing PossDupFlag.
|
Session |
removeStateChangeListener(Session.StateChangeListener listener)
Removes state change listener.
|
boolean |
reportNewMessagesWhileWaitingForMissedMessages()
Returns whether to report new messages even when the message gap is detected and
the reply on the "Resend Request" message is expected.
|
Session |
resetLocalSequenceNumbers()
Resets the local sequence numbers to 1 and backups the current log files.
|
Session |
resetSeqNumViaLogonExchange()
Sends a Logon message with the ResetSeqNumFlag set.
|
Session |
send(ByteBuffer rawMsg)
Sends the raw message to the counterparty without any updating (seq.
|
Session |
send(FlatMessage message)
Sends the flat message to the counterparty.
|
Session |
send(List<Message> messages)
Sends the structured messages to the counterparty.
|
Session |
send(Message message)
Sends the structured message to the counterparty.
|
Session |
sendAsIs(FlatMessage message)
Sends the flat message to the counterparty without any fields updating (except MsgSeqNum(34)).
|
Session |
sendAsIs(Message message)
Sends the structured message to the counterparty without any fields updating (except MsgSeqNum(34)).
|
Session |
sendResendRequest(long beginSeqNumber)
Sends the Resend Request (MsgType 2) message.
|
Session |
sendTestRequest(String testReqId,
long timeoutInMilliseconds)
Sends the Test Request (1) message.
|
Session |
setConnectionMode(ConnectionMode connectionMode)
Sets session connection mode.
|
Session |
setConsiderRejectOnResendRequestAsGapFill(boolean considerRejectOnResendRequestAsGapFill)
Sets whether to consider Reject(3) on Resend Request(2) as Gap Fill.
|
Session |
setErrorListener(Session.ErrorListener listener)
Sets error listener.
|
Session |
setEventArgReuse(boolean eventArgReuse)
Sets whether to re-use event argument objects.
|
Session |
setInboundApplicationFlatMessageFactory(FlatMessageFactory messageFactory)
Sets flat message factory to use for creating inbound application flat message instance.
|
Session |
setInboundApplicationFlatMessageListener(Session.InboundApplicationFlatMessageListener listener)
Sets inbound application flat message listener.
|
Session |
setInboundApplicationMessageFactory(MessageFactory messageFactory)
Sets message factory to use for creating inbound application message instance.
|
Session |
setInboundApplicationMessageListener(Session.InboundApplicationMessageListener listener)
Sets inbound application message listener.
|
Session |
setInboundMessageLogFilter(MessageFilter inboundMessageLogFilter)
Sets
MessageFilter object used to filter out inbound messages from the logs. |
Session |
setInboundMessageReuse(boolean inboundMessageReuse)
Sets whether to use the same
FixMessage object for the incoming messages. |
Session |
setInboundSessionFlatMessageFactory(FlatMessageFactory messageFactory)
Sets flat message factory to use for creating inbound session flat message instance.
|
Session |
setInboundSessionFlatMessageListener(Session.InboundSessionFlatMessageListener listener)
Sets inbound session flat message listener.
|
Session |
setInboundSessionMessageFactory(MessageFactory messageFactory)
Sets message factory to use for creating inbound session message instance.
|
Session |
setInboundSessionMessageListener(Session.InboundSessionMessageListener listener)
Sets inbound session message listener.
|
Session |
setIncomingMessageGapQueueMaximumSize(int maxSize)
If RequestOnlyMissedMessages feature is enabled and the sequence number of an incoming FIX message
greater than expected then the resend functionality is run and this incoming message is stored
in the incoming message gap queue for further processing.
|
Session |
setInSeqNum(long seqNum)
Sets the expected sequence number of the next incoming message.
|
Session |
setListenPort(int listenPort)
Sets the port to listen on for incoming FIX Connections in Acceptor mode.
|
Session |
setLocalPortRange(PortRange localPortRange)
Sets the local port range, the first available port from this range
will be used to send and receive data.
|
Session |
setLogBeforeSending(boolean logBeforeSending)
Sets whether outbound messages are logged before sending.
|
Session |
setLogInboundMessages(boolean logIncomingMessages)
Sets whether to store inbound messages in the session storage.
|
Session |
setLogonConfirmationTimeout(int logonConfirmationTimeout)
Sets number of seconds to wait for a logon response before disconnecting.
|
Session |
setLogOutboundMessages(boolean logOutboundMessages)
Sets whether to store outbound messages in the session storage.
|
Session |
setLogoutConfirmationTimeout(int logoutConfirmationTimeout)
Sets number of seconds to wait for a logout response before disconnecting.
|
Session |
setLogoutMessage(Message logoutMessage)
Sets logout message.
|
Session |
setMaxStorageSize(int maximumSize)
Sets the maximum size of the storage in messages.
|
Session |
setMessageMode(MessageMode messageMode)
Sets message mode used for processing/parsing raw messages internally.
|
Session |
setMessageResendingListener(Session.MessageResendingListener listener)
Sets message resending listener.
|
Session |
setMessageSendingListener(Session.MessageSendingListener listener)
Sets message sending listener.
|
Session |
setNetworkInterface(SocketAddress bindAddress)
Sets the network interface bind address for establishing initiator session.
|
Session |
setOutboundApplicationFlatMessageListener(Session.OutboundApplicationFlatMessageListener listener)
Sets outbound application flat message listener.
|
Session |
setOutboundApplicationMessageListener(Session.OutboundApplicationMessageListener listener)
Sets outbound application message listener.
|
Session |
setOutboundSessionMessageListener(Session.OutboundSessionMessageListener listener)
Sets outbound session message listener.
|
Session |
setOutSeqNum(long seqNum)
Sets the sequence number of the next outgoing message.
|
Session |
setProcessLogonNextExpectedMsgSeqNum(boolean processLogonNextExpectedMsgSeqNum)
Sets whether to process NextExpectedMsgSeqNum(789) field in Logon(A).
|
Session |
setProxySettings(ProxySettings proxySettings)
Sets proxy settings for the session see
ProxySettings . |
Session |
setReasonableTransmissionTime(int reasonableTransmissionTime)
Sets reasonable transmission time as % from heartbeat interval value.
|
Session |
setReceiveBufferSize(int size)
Sets the size of the TCP socket buffer allocated for receiving data, in bytes.
|
Session |
setReceivedBytesListener(Session.ReceivedBytesListener listener)
Sets received bytes listener.
|
Session |
setReceiveSpinningTimeout(long timeout)
Sets the non-blocking receive spinning timeout (in nanoseconds) before the receiving thread enters into the
blocking wait mode.
|
Session |
setReceivingThreadAffinity(int[] cpuIndexes)
Sets the receiving thread affinity.
|
Session |
setReportNewMessagesWhileWaitingForMissedMessages(boolean report)
When the message gap is detected the "Resend Request" FIX Message is sent and
Session state is changed to WAIT_FOR_RETRANSMISSION.
|
Session |
setRequestOnlyMissedMessages(boolean request)
By default, the "Resend Request" message requests all messages begin from the first missed one.
|
Session |
setResendingQueueSize(int resendingQueueSize)
Sets the number of sent messages that are available for resending on counterparty's Resend Request(2) message.
|
Session |
setResendRequestLogic(ResendRequestLogic resendRequestLogic)
Sets resend request logic.
|
Session |
setResendRequestMaximumRange(int resendRequestMaximumRange)
Sets the maximum number of messages to be requested in one Resend Request (MsgType=2) message.
|
Session |
setScrambleLogonFields(Collection<Integer> fields)
Sets scrambled fields in the Logon(A) message, in the session storage, for security reasons.
|
Session |
setSendBufferSize(int sendBufferSize)
Sets the size of the TCP socket buffer allocated for sending data, in bytes.
|
Session |
setSenderLocationID(String senderLocationID)
Sets the value of SenderLocationID (142) field that will be set in all outgoing messages.
|
Session |
setSenderSubID(String senderSubID)
Sets the value of SenderSubID (50) field that will be set in all outgoing messages.
|
Session |
setSendingThreadAffinity(int[] cpuIndexes)
Sets the sending thread affinity.
|
Session |
setSendingTimeFormat(TimestampFormat format)
Sets the time format of SendingTime of every sent message as
Timestamp . |
Session |
setSendSpinningTimeout(long timeout)
Sets the send spinning timeout (in nanoseconds) of the
send(Message) method to wait for the
socket sending buffer availability in the spin loop mode before placing the message to the outgoing queue
(to be sent later by the sending thread). |
Session |
setSpecifyApplIdField(boolean specifyApplIdField)
Sets whether to specify ApplVerID(1128) tag in all FIX messages when a FIX protocol version FIX 5.0 and
above is used.
|
Session |
setSpecifyLastMsgSeqNumProcessed(boolean specifyLastMsgSeqNumProcessed)
Sets the option to specify the LastMsgSeqNumProcessed (tag # 369) field on every message sent.
|
Session |
setSSLContext(SSLContext sslContext)
Sets the SSL context for establishing secure initiator session.
|
Session |
setTargetLocationID(String targetLocationID)
Sets the value of TargetLocationID (143) field that will be set in all outgoing messages.
|
Session |
setTargetSubID(String targetSubID)
Sets the value of TargetSubID (57) field that will be set in all outgoing messages.
|
Session |
setTcpNoDelay(boolean on)
Enable/disable TCP_NODELAY socket option (disable/enable Nagle's algorithm).
|
Session |
setTestRequestIdPattern(String pattern)
Sets the pattern describing the date and time format which will be used as a TestReqID(112) field value.
|
Session |
setThrottlingLimit(int messagesCount,
long intervalDurationInMillis)
Sets the throttling limit parameters.
|
Session |
setThrottlingLimit(int messagesCount,
long intervalDuration,
TimeUnit intervalUnit)
Sets throttling limit parameters.
|
Session |
setTimestampProvider(TimestampProvider timestampProvider)
Sets the timestamp provider which is used to provide timestamp for writing messages to log and for setting
SendingTime tag.
|
Session |
setUpdateSendingTime(boolean updateSendingTime)
Sets whether to update
SendingTime(52)
field in the outgoing message if it is already set.
|
Session |
setUserSessionLevelMessageWarning(boolean userSessionLevelMessageWarning)
Sets whether to warn if user sends session level message.
|
Session |
setValidateSequenceNumbers(boolean validateSequenceNumbers)
Sets whether to validate incoming message sequence numbers.
|
Session |
setWarningListener(Session.WarningListener listener)
Sets warning listener.
|
Session |
throttle()
Performs throttling of a session.
|
String |
toString()
Returns a string that represents the current session.
|
String |
toStringDetailed() |
long |
tryThrottle()
Checks the throttling of a session that must be called before each send function call.
|
Session |
warmUp(Message message)
Warms up the sending path.
|
public static final int RESEND_REQUEST_MAXIMUM_RANGE_NO_LIMIT
public static final String SCRAMBLED_VALUE
public static final Session.InboundApplicationMessageListener NULL_INBOUND_APPLICATION_MESSAGE_LISTENER
public static final Session.InboundApplicationFlatMessageListener NULL_INBOUND_APPLICATION_FLATMESSAGE_LISTENER
public static final Session.InboundSessionMessageListener NULL_INBOUND_SESSION_MESSAGE_LISTENER
public static final Session.InboundSessionFlatMessageListener NULL_INBOUND_SESSION_FLATMESSAGE_LISTENER
public static final Session.OutboundApplicationMessageListener NULL_OUTBOUND_APPLICATION_MESSAGE_LISTENER
public static final Session.OutboundApplicationFlatMessageListener NULL_OUTBOUND_APPLICATION_FLATMESSAGE_LISTENER
public static final Session.OutboundSessionMessageListener NULL_OUTBOUND_SESSION_MESSAGE_LISTENER
public static final Session.MessageSendingListener NULL_MESSAGE_SENDING_LISTENER
public static final Session.ReceivedBytesListener NULL_RECEIVED_BYTES_LISTENER
public static final Session.MessageResendingListener NULL_MESSAGE_RESENDING_LISTENER
public static final Session.WarningListener NULL_WARNING_LISTENER
public static final Session.ErrorListener NULL_ERROR_LISTENER
public Session(String senderCompID, String targetCompID, Version version)
keepSequenceNumbersBetweenFixConnections
option is set true
.
cleanStart
option is set false
.
storageType
session storage type is set to`
SessionStorageType.FileBasedStorage
.senderCompID
- assigned value used to identify firm sending message
(the SenderCompID (tag=49) field value in outgoing messages)targetCompID
- assigned value used to identify receiving firm
(the TargetCompID (tag=56) field value in outgoing messages)version
- FIX versionpublic Session(String senderCompID, String targetCompID, Version version, boolean keepSequenceNumbersBetweenFixConnections)
cleanStart
option is set false
.
storageType
session storage type is set to
SessionStorageType.FileBasedStorage
.senderCompID
- assigned value used to identify firm sending message
(the SenderCompID (tag=49) field value in outgoing messages)targetCompID
- assigned value used to identify receiving firm
(the TargetCompID (tag=56) field value in outgoing messages)version
- FIX versionkeepSequenceNumbersBetweenFixConnections
- option to keep sequence numbers between FIX Connectionspublic Session(String senderCompID, String targetCompID, Version version, String token)
keepSequenceNumbersBetweenFixConnections
option is set true
.
cleanStart
option is set false
.
storageType
session storage type is set to
SessionStorageType.FileBasedStorage
.senderCompID
- assigned value used to identify firm sending message
(the SenderCompID (tag=49) field value in outgoing messages)targetCompID
- assigned value used to identify receiving firm
(the TargetCompID (tag=56) field value in outgoing messages)version
- FIX versiontoken
- session token that is used to distinguish sessions with the same SenderCompID and TargetCompIDpublic Session(String senderCompID, String targetCompID, Version version, boolean keepSequenceNumbersBetweenFixConnections, String token)
cleanStart
option is set false
.
storageType
session storage type is set to
SessionStorageType.FileBasedStorage
.senderCompID
- assigned value used to identify firm sending message
(the SenderCompID (tag=49) field value in outgoing messages)targetCompID
- assigned value used to identify receiving firm
(the TargetCompID (tag=56) field value in outgoing messages)version
- FIX versionkeepSequenceNumbersBetweenFixConnections
- option to keep sequence numbers between FIX Connectionstoken
- Session token that is used to distinguish sessions with the same SenderCompID and TargetCompIDpublic Session(String senderCompID, String targetCompID, Version version, boolean keepSequenceNumbersBetweenFixConnections, String token, boolean cleanStart)
storageType
session storage type is set to
SessionStorageType.FileBasedStorage
.senderCompID
- assigned value used to identify firm sending message
(the SenderCompID (tag=49) field value in outgoing messages)targetCompID
- assigned value used to identify receiving firm
(the TargetCompID (tag=56) field value in outgoing messages)version
- FIX versionkeepSequenceNumbersBetweenFixConnections
- option to keep sequence numbers between FIX Connectionstoken
- Session token that is used to distinguish sessions with the same SenderCompID and TargetCompIDcleanStart
- option to ignore the previous log files and start the FIX session anewpublic Session(String senderCompID, String targetCompID, Version version, SessionStorageType storageType)
keepSequenceNumbersBetweenFixConnections
option is set true
.
cleanStart
option is set false
.senderCompID
- assigned value used to identify firm sending message
(the SenderCompID (tag=49) field value in outgoing messages)targetCompID
- assigned value used to identify receiving firm
(the TargetCompID (tag=56) field value in outgoing messages)version
- FIX versionstorageType
- session storage typepublic Session(String senderCompID, String targetCompID, Version version, boolean keepSequenceNumbersBetweenFixConnections, SessionStorageType storageType)
cleanStart
option is set false
.senderCompID
- assigned value used to identify firm sending message
(the SenderCompID (tag=49) field value in outgoing messages)targetCompID
- assigned value used to identify receiving firm
(the TargetCompID (tag=56) field value in outgoing messages)version
- FIX versionkeepSequenceNumbersBetweenFixConnections
- option to keep sequence numbers between FIX ConnectionsstorageType
- session storage typepublic Session(SessionReactor sessionReactor, String senderCompID, String targetCompID, Version version)
keepSequenceNumbersBetweenFixConnections
option is set true
.
cleanStart
option is set false
.
storageType
session storage type is set to`
SessionStorageType.FileBasedStorage
.sessionReactor
- an instance of an externally managed reactor for the sessionsenderCompID
- assigned value used to identify firm sending message
(the SenderCompID (tag=49) field value in outgoing messages)targetCompID
- assigned value used to identify receiving firm
(the TargetCompID (tag=56) field value in outgoing messages)version
- FIX versionpublic Session(SessionReactor sessionReactor, String senderCompID, String targetCompID, Version version, boolean keepSequenceNumbersBetweenFixConnections, String token, boolean cleanStart, SessionStorageType storageType)
senderCompID
- assigned value used to identify firm sending message
(the SenderCompID (tag=49) field value in outgoing messages)targetCompID
- assigned value used to identify receiving firm
(the TargetCompID (tag=56) field value in outgoing messages)sessionReactor
- an instance of an externally managed reactor for the sessionversion
- FIX versionkeepSequenceNumbersBetweenFixConnections
- option to keep sequence numbers between FIX Connectionstoken
- Session token that is used to distinguish sessions with the same SenderCompID and TargetCompIDcleanStart
- option to ignore the previous log files and start the FIX session anewstorageType
- session storage typepublic Session(String senderCompID, String targetCompID, Version version, boolean keepSequenceNumbersBetweenFixConnections, String token, SessionStorageType storageType)
cleanStart
option is set false
.senderCompID
- assigned value used to identify firm sending message
(the SenderCompID (tag=49) field value in outgoing messages)targetCompID
- assigned value used to identify receiving firm
(the TargetCompID (tag=56) field value in outgoing messages)version
- FIX versionkeepSequenceNumbersBetweenFixConnections
- option to keep sequence numbers between FIX Connectionstoken
- Session token that is used to distinguish sessions with the same SenderCompID and TargetCompIDstorageType
- session storage typepublic Session(SessionId sessionId)
keepSequenceNumbersBetweenFixConnections
option is set true
.
cleanStart
option is set false
.
storageType
session storage type is set to
SessionStorageType.FileBasedStorage
.sessionId
- session id datapublic Session(SessionId sessionId, SessionStorageType storageType)
keepSequenceNumbersBetweenFixConnections
option is set true
.
cleanStart
option is set false
.sessionId
- session id datastorageType
- session storage typepublic Session(SessionId sessionId, boolean keepSequenceNumbersBetweenFixConnections, SessionStorageType storageType)
cleanStart
option is set false
.sessionId
- session id datakeepSequenceNumbersBetweenFixConnections
- option to keep sequence numbers between FIX ConnectionsstorageType
- session storage typepublic Session logonAsAcceptor()
Acceptor is the receiving party of the FIX session. It listens for the incoming connection on the pre-defined port. The acceptor has responsibility to perform first level authentication and formally declare the connection request "accepted" through transmission of an acknowledgment Logon message.
public Session logonAsInitiator(String host, int port)
Initiator establishes the telecommunications link and initiates the session via transmission of the initial Logon message.
host
- counterparty's host name or addressport
- counterparty's port numberCannotEstablishLinkException
- the telecommunication link cannot be establishedLinkErrorException
- after sending the initial Logon message the telecommunication link error is detectedFirstMessageNotLogonException
- not logon message received in response to our logonUnexpectedSequenceNumberException
- the first received message is a Logon message with wrong seq. numberConfirmationLogonMessageException
- the first received message is an invalid Logon messageTimeoutException
- after sending the initial Logon message the acknowledgment Logon message has not been
received during timeout periodEngineException
- FIX connection cannot be establishedpublic Session logonAsInitiator(String host, int port, int heartBtInt)
Initiator establishes the telecommunications link and initiates the session via transmission of the initial Logon message.
host
- counterparty's host name or addressport
- counterparty's port numberheartBtInt
- heartbeat interval (seconds)CannotEstablishLinkException
- the telecommunication link cannot be establishedLinkErrorException
- after sending the initial Logon message the telecommunication link error is detectedFirstMessageNotLogonException
- not logon message received in response to our logonUnexpectedSequenceNumberException
- the first received message is a Logon message with wrong seq. numberConfirmationLogonMessageException
- the first received message is an invalid Logon messageTimeoutException
- after sending the initial Logon message the acknowledgment Logon message has not been
received during timeout periodEngineException
- FIX connection cannot be establishedpublic Session logonAsInitiator(String host, int port, boolean setResetSeqNumFlag)
Initiator establishes the telecommunications link and initiates the session via transmission of the initial Logon message.
host
- counterparty's host name or addressport
- counterparty's port numbersetResetSeqNumFlag
- option to set the ResetSeqNumFlag(141) in the initial Logon(A) message.CannotEstablishLinkException
- the telecommunication link cannot be establishedLinkErrorException
- after sending the initial Logon message the telecommunication link error is detectedFirstMessageNotLogonException
- not logon message received in response to our logonUnexpectedSequenceNumberException
- the first received message is a Logon message with wrong seq. numberConfirmationLogonMessageException
- the first received message is an invalid Logon messageTimeoutException
- after sending the initial Logon message the acknowledgment Logon message has not been
received during timeout periodEngineException
- FIX connection cannot be establishedpublic Session logonAsInitiator(String host, int port, int heartBtInt, boolean setResetSeqNumFlag)
Initiator establishes the telecommunications link and initiates the session via transmission of the initial Logon message.
host
- counterparty's host name or addressport
- counterparty's port numberheartBtInt
- heartbeat interval (seconds)setResetSeqNumFlag
- option to set the ResetSeqNumFlag(141) in the initial Logon(A) message.CannotEstablishLinkException
- the telecommunication link cannot be establishedLinkErrorException
- after sending the initial Logon message the telecommunication link error is detectedFirstMessageNotLogonException
- not logon message received in response to our logonUnexpectedSequenceNumberException
- the first received message is a Logon message with wrong seq. numberConfirmationLogonMessageException
- the first received message is an invalid Logon messageTimeoutException
- after sending the initial Logon message the acknowledgment Logon message has not been
received during timeout periodEngineException
- FIX connection cannot be establishedpublic Session logonAsInitiator(String host, int port, Message customLogonMsg)
Initiator establishes the telecommunications link and initiates the session via transmission of the initial Logon message.
host
- counterparty's host name or addressport
- counterparty's port numbercustomLogonMsg
- custom Logon messageCannotEstablishLinkException
- the telecommunication link cannot be establishedLinkErrorException
- after sending the initial Logon message the telecommunication link error is detectedFirstMessageNotLogonException
- not logon message received in response to our logonUnexpectedSequenceNumberException
- the first received message is a Logon message with wrong seq. numberConfirmationLogonMessageException
- the first received message is an invalid Logon messageTimeoutException
- after sending the initial Logon message the acknowledgment Logon message has not been
received during timeout periodEngineException
- FIX connection cannot be establishedpublic Session logonAsInitiator(String host, int port, int heartBtInt, Message customLogonMsg)
Initiator establishes the telecommunications link and initiates the session via transmission of the initial Logon message.
host
- counterparty's host name or addressport
- counterparty's port numberheartBtInt
- heartbeat interval (seconds)customLogonMsg
- custom Logon messageCannotEstablishLinkException
- the telecommunication link cannot be establishedLinkErrorException
- after sending the initial Logon message the telecommunication link error is detectedFirstMessageNotLogonException
- not logon message received in response to our logonUnexpectedSequenceNumberException
- the first received message is a Logon message with wrong seq. numberConfirmationLogonMessageException
- the first received message is an invalid Logon messageTimeoutException
- after sending the initial Logon message the acknowledgment Logon message has not been
received during timeout periodEngineException
- FIX connection cannot be establishedpublic Session logonAsInitiator(String host, int port, boolean setResetSeqNumFlag, Message customLogonMsg)
Initiator establishes the telecommunications link and initiates the session via transmission of the initial Logon message.
host
- counterparty's host name or addressport
- counterparty's port numbersetResetSeqNumFlag
- option to set the ResetSeqNumFlag(141) in the initial Logon(A) message.customLogonMsg
- custom Logon messageCannotEstablishLinkException
- the telecommunication link cannot be establishedLinkErrorException
- after sending the initial Logon message the telecommunication link error is detectedFirstMessageNotLogonException
- not logon message received in response to our logonUnexpectedSequenceNumberException
- the first received message is a Logon message with wrong seq. numberConfirmationLogonMessageException
- the first received message is an invalid Logon messageTimeoutException
- after sending the initial Logon message the acknowledgment Logon message has not been
received during timeout periodEngineException
- FIX connection cannot be establishedpublic Session logonAsInitiator(String host, int port, int heartBtInt, boolean setResetSeqNumFlag, Message customLogonMsg)
Initiator establishes the telecommunications link and initiates the session via transmission of the initial Logon message.
host
- counterparty's host name or addressport
- counterparty's port numberheartBtInt
- heartbeat interval (seconds)setResetSeqNumFlag
- option to set the ResetSeqNumFlag(141) in the initial Logon(A) message.customLogonMsg
- custom Logon messageCannotEstablishLinkException
- the telecommunication link cannot be establishedLinkErrorException
- after sending the initial Logon message the telecommunication link error is detectedFirstMessageNotLogonException
- not logon message received in response to our logonUnexpectedSequenceNumberException
- the first received message is a Logon message with wrong seq. numberConfirmationLogonMessageException
- the first received message is an invalid Logon messageTimeoutException
- after sending the initial Logon message the acknowledgment Logon message has not been
received during timeout periodEngineException
- FIX connection cannot be establishedpublic CompletableFuture<Void> logonAsInitiatorAsync(String host, int port, int heartBtInt, boolean setResetSeqNumFlag, Message customLogonMsg)
Initiator establishes the telecommunications link and initiates the session via transmission of the initial Logon message.
The method returns immediately without waiting for the acknowledgment Logon message. Returns the CompletableFuture object that can be used to wait for the result of the asynchronous logon method.
host
- counterparty's host name or addressport
- counterparty's port numberheartBtInt
- heartbeat interval (seconds)setResetSeqNumFlag
- option to set the ResetSeqNumFlag(141) in the initial Logon(A) message.customLogonMsg
- custom Logon messageCannotEstablishLinkException
- the telecommunication link cannot be establishedLinkErrorException
- after sending the initial Logon message the telecommunication link error is detectedFirstMessageNotLogonException
- not logon message received in response to our logonUnexpectedSequenceNumberException
- the first received message is a Logon message with wrong seq. numberConfirmationLogonMessageException
- the first received message is an invalid Logon messageTimeoutException
- after sending the initial Logon message the acknowledgment Logon message has not been
received during timeout periodEngineException
- FIX connection cannot be establishedpublic Session logout()
getReasonableTransmissionTime()
properties.public Session logout(String text)
getReasonableTransmissionTime()
properties.text
- free format text string that is sent to the counterparty in the Text (tag=58) field of the
initial Logout message.public Session logout(Message logoutMessage)
getReasonableTransmissionTime()
properties.logoutMessage
- logout message to be used, if logoutMessage == null
the logout message previously
set will be used.IllegalArgumentException
- if logoutMessage type is not equal to logout type '5' or logoutMessage FIX
version is not equal to the session FIX version.setLogoutMessage(biz.onixs.fix.parser.Message)
public CompletableFuture<Void> logoutAsync()
The initial logout message is sent to the counterparty. The method blocks until the acknowledgement
logout message is received or timeout ended. Where the timeout is calculated using the heartbeat and
getReasonableTransmissionTime()
properties.
The method returns immediately without waiting for the acknowledgment Logout message. Returns the CompletableFuture object that can be used to wait for the result of the asynchronous logout method.
public CompletableFuture<Void> logoutAsync(String text)
The initial logout message is sent to the counterparty. The method blocks until the acknowledgement
logout message is received or timeout ended. Where the timeout is calculated using the heartbeat and
getReasonableTransmissionTime()
properties.
The method returns immediately without waiting for the acknowledgment Logout message. Returns the CompletableFuture object that can be used to wait for the result of the asynchronous logout method.
text
- free format text string that is sent to the counterparty in the Text (tag=58) field of the
initial Logout message.public CompletableFuture<Void> logoutAsync(Message logoutMessage)
The initial logout message is sent to the counterparty. The method blocks until the acknowledgement
logout message is received or timeout ended. Where the timeout is calculated using the heartbeat and
getReasonableTransmissionTime()
properties.
The method returns immediately without waiting for the acknowledgment Logout message. Returns the CompletableFuture object that can be used to wait for the result of the asynchronous logout method.
logoutMessage
- logout message to be used, if logoutMessage == null
the logout message previously
set will be used.IllegalArgumentException
- if logoutMessage type is not equal to logout type '5' or logoutMessage FIX
version is not equal to the session FIX version.setLogoutMessage(biz.onixs.fix.parser.Message)
public Session resetLocalSequenceNumbers()
public Session resetSeqNumViaLogonExchange()
public Session breakConnection()
SessionState.DISCONNECTED
.
Breaks the FIX connection non-gracefully (without the exchange of Logout (MsgType=5) messages).public Session warmUp(Message message)
message
- message to be used for warm upNullPointerException
- if message is nullEngineException
- if error occurspublic Session preFill(Message message)
message
- message to pre-fillNullPointerException
- if message is nullEngineException
- if error occurspublic Session preFill(List<Message> messages)
messages
- messages to pre-fillNullPointerException
- if messages is nullEngineException
- if error occurspublic Session preFill(FlatMessage flatMessage)
flatMessage
- message to pre-fillNullPointerException
- if message is nullEngineException
- if error occurspublic Session sendAsIs(Message message)
message
- message to sendNullPointerException
- if message is nullEngineException
- if error occurspublic Session sendAsIs(FlatMessage message)
message
- flat message to sendNullPointerException
- if message is nullEngineException
- if error occurspublic Session send(ByteBuffer rawMsg)
rawMsg
- message to sendNullPointerException
- if message is nullEngineException
- if error occurspublic Session send(Message message)
message
- message to sendNullPointerException
- if message is nullEngineException
- if error occurspublic Session send(FlatMessage message)
message
- flat message to sendNullPointerException
- if message is nullEngineException
- if error occurspublic Session send(List<Message> messages)
messages
- messages to sendNullPointerException
- if messages is nullIllegalArgumentException
- if messages is emptyEngineException
- if error occurspublic Session sendTestRequest(String testReqId, long timeoutInMilliseconds) throws EngineException
testReqId
- identifier included in Test Request (1) message to be returned in resulting Heartbeat (0)
message from the counterpartytimeoutInMilliseconds
- maximum interval to wait until the reply is received from the counterpartyEngineException
public Session sendResendRequest(long beginSeqNumber) throws EngineException
Note: Normally, "Resend Request" message is sent automatically. This method allows to simulate a sequence gap by sending this message manually. This can be used in some venue specific cases. This method should not be used in the normal scenarios.
beginSeqNumber
- Begin sequence number of the first requested message in the range.EngineException
public Session setThrottlingLimit(int messagesCount, long intervalDuration, TimeUnit intervalUnit)
messagesCount
- The number of messages allowed during the given interval.
This value must be greater than 0 (zero).intervalDuration
- Duration of the interval in time units specified by the intervalUnit parameter.
This value, converted to milliseconds, must be greater than 0 (zero).intervalUnit
- Time units to measure the intervalpublic Session setThrottlingLimit(int messagesCount, long intervalDurationInMillis)
messagesCount
- The number of messages allowed during the given interval.
This value must be greater than 0 (zero).intervalDurationInMillis
- Duration of the interval in milliseconds.
The interval duration must be greater than 0 (zero).public long tryThrottle()
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.
public Session throttle()
This method must be called before each call to a method that sends a single message
(i.e. - send(Message)
or send(FlatMessage)
).
If the count of messages per the interval exceeds the given limit,
the method will block until the given time interval is passed.
public SessionId getId()
public String getCounterpartyHost()
public String getCounterpartyHostAsSpecified()
logonAsInitiator(String, int)
method
call.public int getCounterpartyPort()
public Message getLogoutMessage()
public Session setLogoutMessage(Message logoutMessage)
logoutMessage
- logout messageNullPointerException
- if (logoutMessage == null)IllegalArgumentException
- if logoutMessage type is not equal to logout type '5'
or logoutMessage FIX version is not equal to the session FIX version.logout(biz.onixs.fix.parser.Message)
public Collection<Integer> getScrambleLogonFields()
public Session setScrambleLogonFields(Collection<Integer> fields)
fields
- tag numbers to be scrambled in the Logon(A) message.public int getMaxStorageSize()
public Session setMaxStorageSize(int maximumSize)
maximumSize
- maximum size of the message storagepublic boolean getTcpNoDelay()
true
if TCP_NODELAY socket option is enabled, false
otherwisepublic Session setTcpNoDelay(boolean on)
on
- true to enable TCP_NODELAY, false to disable.public boolean isUserSessionLevelMessageWarning()
public Session setUserSessionLevelMessageWarning(boolean userSessionLevelMessageWarning)
userSessionLevelMessageWarning
- whether to warn if user sends session level messagepublic boolean isRequestOnlyMissedMessages()
public Session setRequestOnlyMissedMessages(boolean request)
Note: This method can be called only when the session is disconnected.
request
- whether to request only missed messagespublic List<FixMessage> getOutboundMessages(long beginSequenceNumber, long endSequenceNumber)
beginSequenceNumber
- sequence number to begin withendSequenceNumber
- sequence number to end withIllegalArgumentException
- if (beginSeqNum < 1)public Session.InboundApplicationMessageListener getInboundApplicationMessageListener()
public Session setInboundApplicationMessageListener(Session.InboundApplicationMessageListener listener)
listener
- inbound application message listener or
NULL_INBOUND_APPLICATION_MESSAGE_LISTENER
value to reset listener to defaultpublic Session.InboundApplicationFlatMessageListener getInboundApplicationFlatMessageListener()
public Session setInboundApplicationFlatMessageListener(Session.InboundApplicationFlatMessageListener listener)
listener
- inbound application flat message listener or
NULL_INBOUND_APPLICATION_FLATMESSAGE_LISTENER
value to reset listener to defaultpublic Session.InboundSessionMessageListener getInboundSessionMessageListener()
public Session setInboundSessionMessageListener(Session.InboundSessionMessageListener listener)
listener
- inbound session message listener or NULL_INBOUND_SESSION_MESSAGE_LISTENER
value to reset listener to defaultpublic Session.InboundSessionFlatMessageListener getInboundSessionFlatMessageListener()
public Session setInboundSessionFlatMessageListener(Session.InboundSessionFlatMessageListener listener)
listener
- inbound session flat message listener or NULL_INBOUND_SESSION_FLATMESSAGE_LISTENER
value to reset listener to defaultpublic Session.OutboundApplicationMessageListener getOutboundApplicationMessageListener()
public Session setOutboundApplicationMessageListener(Session.OutboundApplicationMessageListener listener)
listener
- outbound application message listener or NULL_OUTBOUND_APPLICATION_MESSAGE_LISTENER
value to reset listener to defaultpublic Session.OutboundApplicationFlatMessageListener getOutboundApplicationFlatMessageListener()
public Session setOutboundApplicationFlatMessageListener(Session.OutboundApplicationFlatMessageListener listener)
listener
- outbound application flat message listener or
NULL_OUTBOUND_APPLICATION_FLATMESSAGE_LISTENER
value to reset listener to defaultpublic Session.OutboundSessionMessageListener getOutboundSessionMessageListener()
public Session setOutboundSessionMessageListener(Session.OutboundSessionMessageListener listener)
listener
- outbound session message listener or NULL_OUTBOUND_SESSION_MESSAGE_LISTENER
value
to reset listener to defaultpublic Session.MessageSendingListener getMessageSendingListener()
public Session setMessageSendingListener(Session.MessageSendingListener listener)
listener
- message sending listener or NULL_MESSAGE_SENDING_LISTENER
value
to reset listener to defaultpublic Session.ReceivedBytesListener getReceivedBytesListener()
public Session setReceivedBytesListener(Session.ReceivedBytesListener listener)
listener
- received bytes listener or NULL_RECEIVED_BYTES_LISTENER
value
to reset listener to defaultpublic Session.MessageResendingListener getMessageResendingListener()
public Session setMessageResendingListener(Session.MessageResendingListener listener)
listener
- message resending listener or NULL_MESSAGE_RESENDING_LISTENER
value to reset listener
to defaultpublic Session.ErrorListener getErrorListener()
public Session setErrorListener(Session.ErrorListener listener)
listener
- error listener or NULL_ERROR_LISTENER
value to reset listener to defaultpublic Session.WarningListener getWarningListener()
public Session setWarningListener(Session.WarningListener listener)
listener
- warning listener or NULL_WARNING_LISTENER
value to reset listener to defaultpublic List<Session.StateChangeListener> getStateChangeListeners()
public Session addStateChangeListener(Session.StateChangeListener listener)
listener
- state change listenerpublic Session removeStateChangeListener(Session.StateChangeListener listener)
listener
- state change listenerpublic int getHeartBtInt()
public long getInSeqNum()
public Session setInSeqNum(long seqNum)
seqNum
- sequence numberpublic TimestampFormat getSendingTimeFormat()
Timestamp
.Timestamp
.public Session setSendingTimeFormat(TimestampFormat format)
Timestamp
.format
- timestamp format to be used.public boolean isSpecifyLastMsgSeqNumProcessed()
public Session setSpecifyLastMsgSeqNumProcessed(boolean specifyLastMsgSeqNumProcessed)
specifyLastMsgSeqNumProcessed
- whether to specify the LastMsgSeqNumProcessedpublic boolean isUpdateSendingTime()
public Session setUpdateSendingTime(boolean updateSendingTime)
updateSendingTime
- whether to update SendingTime(52) fieldpublic long getOutSeqNum()
public Session setOutSeqNum(long seqNum)
seqNum
- sequence numberpublic String getSenderSubID()
public Session setSenderSubID(String senderSubID)
senderSubID
- SenderSubID (50) field value.public String getTargetSubID()
public Session setTargetSubID(String targetSubID)
targetSubID
- TargetSubID (57) field value.public String getSenderLocationID()
public Session setSenderLocationID(String senderLocationID)
senderLocationID
- SenderLocationID (142) field value.public String getTargetLocationID()
public Session setTargetLocationID(String targetLocationID)
targetLocationID
- TargetLocationID (143) field value.public SessionStorage getStorage()
public String getStorageID()
public SessionRole getRole()
public SessionId getSessionId()
public String getSenderCompID()
public String getTargetCompID()
public String getToken()
public Version getVersion()
public SessionState getState()
public boolean isLogInboundMessages()
EngineSettings.isLogInboundMessages()
.public Session setLogInboundMessages(boolean logIncomingMessages)
EngineSettings.isLogInboundMessages()
.logIncomingMessages
- whether to store inbound messages in the session storagepublic boolean isLogOutboundMessages()
EngineSettings.isLogOutboundMessages()
.public Session setLogOutboundMessages(boolean logOutboundMessages)
EngineSettings.isLogOutboundMessages()
.logOutboundMessages
- whether to store outbound messages in the session storagepublic boolean isLogBeforeSending()
EngineSettings.isLogBeforeSending()
.public Session setLogBeforeSending(boolean logBeforeSending)
EngineSettings.isLogBeforeSending()
.logBeforeSending
- whether outbound messages are logged before sending.public boolean isValidateSequenceNumbers()
public Session setValidateSequenceNumbers(boolean validateSequenceNumbers)
validateSequenceNumbers
- whether to validate incoming message sequence numberspublic boolean reportNewMessagesWhileWaitingForMissedMessages()
public Session setReportNewMessagesWhileWaitingForMissedMessages(boolean report)
Note: In this mode messages could be reported out of the original order: e.g. MsgSeqNum could be: 3 (original), 4 (original), 2 (PossDupFlag='Y'), 3 (PossDupFlag='Y'), 4 (PossDupFlag='Y') and some messages could be received two times: first time without PossDupFlag='Y' and second time - with this flag.
Default value is false.report
- whether to report new messages even when the message gap is detected
and the reply on the "Resend Request" message is expected.public TimestampProvider getTimestampProvider()
public Session setTimestampProvider(TimestampProvider timestampProvider)
timestampProvider
- timestamp providerpublic Session setSSLContext(SSLContext sslContext)
sslContext
- SSL contextpublic Session setNetworkInterface(SocketAddress bindAddress)
bindAddress
- bind addresspublic Session setInboundApplicationMessageFactory(MessageFactory messageFactory)
messageFactory
- message factorypublic Session setInboundApplicationFlatMessageFactory(FlatMessageFactory messageFactory)
messageFactory
- flat message factorypublic Session setInboundSessionMessageFactory(MessageFactory messageFactory)
messageFactory
- message factorypublic Session setInboundSessionFlatMessageFactory(FlatMessageFactory messageFactory)
messageFactory
- flat message factorypublic MessageFilter getInboundMessageLogFilter()
MessageFilter
object used to filter out inbound messages from the logs.
By default, it is NullMessageFilter
object.MessageFilter
object used to filter out inbound messages from the logs.public Session setInboundMessageLogFilter(MessageFilter inboundMessageLogFilter)
MessageFilter
object used to filter out inbound messages from the logs.inboundMessageLogFilter
- MessageFilter
object to be used.public long getOutboundQueueBytes()
public Session setReceiveBufferSize(int size)
EngineSettings.setConnectionTcpReceiveBufferSize(int)
.size
- TCP socket receive buffer size.public int getReceiveBufferSize()
EngineSettings.getConnectionTcpReceiveBufferSize()
.public Session setSendBufferSize(int sendBufferSize)
EngineSettings.setConnectionTcpSendBufferSize(int)
.sendBufferSize
- TCP socket send buffer size.public int getSendBufferSize()
EngineSettings.getConnectionTcpSendBufferSize()
.public Session setReasonableTransmissionTime(int reasonableTransmissionTime)
reasonableTransmissionTime
- reasonable transmission timepublic int getReasonableTransmissionTime()
public Session setInboundMessageReuse(boolean inboundMessageReuse)
FixMessage
object for the incoming messages.
Warning. In case of re-using mode the Message/FlatMessage objects can be operated only until control is
returned from the inbound message/flat message listener.
The default value is false.inboundMessageReuse
- use the same FixMessage object for the incoming messagespublic boolean isInboundMessageReuse()
FixMessage
object for the incoming messages.public Session setEventArgReuse(boolean eventArgReuse)
eventArgReuse
- whether to re-use event argument objectspublic boolean isEventArgReuse()
public Session setResendRequestMaximumRange(int resendRequestMaximumRange)
resendRequestMaximumRange
- maximum number of messages to be requested in one Resend Request or
RESEND_REQUEST_MAXIMUM_RANGE_NO_LIMIT
for no limitIllegalArgumentException
- if resendRequestMaximumRange < 0public int getResendRequestMaximumRange()
RESEND_REQUEST_MAXIMUM_RANGE_NO_LIMIT
for no limitpublic Session setResendingQueueSize(int resendingQueueSize)
resendingQueueSize
- number of sent messages that are available for resending on counterparty's
Resend Request(2) message.IllegalArgumentException
- if resendingQueueSize < 0public long getResendingQueueSize()
public ResendRequestLogic getResendRequestLogic()
public Session setResendRequestLogic(ResendRequestLogic resendRequestLogic)
resendRequestLogic
- resend request logicpublic int getIncomingMessageGapQueueMaximumSize()
public Session setIncomingMessageGapQueueMaximumSize(int maxSize)
maxSize
- maximum size of the incoming message gap queuepublic boolean isConsiderRejectOnResendRequestAsGapFill()
Note: The incoming sequence number will be set to the sequence number of Reject(3) message.
public Session setConsiderRejectOnResendRequestAsGapFill(boolean considerRejectOnResendRequestAsGapFill)
Note: The incoming sequence number will be set to the sequence number of Reject(3) message.
considerRejectOnResendRequestAsGapFill
- consider Reject(3) on Resend Request(2) as Gap Fill.public boolean isSpecifyApplIdField()
public Session setSpecifyApplIdField(boolean specifyApplIdField)
specifyApplIdField
- whether to specify ApplVerID(1128) tag.public PortRange getLocalPortRange()
public Session setLocalPortRange(PortRange localPortRange)
localPortRange
- the local port range, the first available port
from this range will be used to send and receive datapublic int getLocalPort()
public int getListenPort()
public Session setListenPort(int listenPort)
listenPort
- the to listen on for incoming FIX Connections in Acceptor modepublic Session setReceivingThreadAffinity(int[] cpuIndexes)
cpuIndexes
- logical processors list that a thread is allowed to run on (first logical CPU has indexed 0).public Session setSendingThreadAffinity(int[] cpuIndexes)
cpuIndexes
- logical processors list that a thread is allowed to run on (first logical CPU has indexed 0).public long getSendSpinningTimeout()
Note: By default, the value is zero and send spinning is not used.
public Session setSendSpinningTimeout(long timeout)
send(Message)
method to wait for the
socket sending buffer availability in the spin loop mode before placing the message to the outgoing queue
(to be sent later by the sending thread).timeout
- timeout in nanosecondsIllegalArgumentException
- if timeout < 0public long getReceiveSpinningTimeout()
Note: By default, the value is zero and send spinning is not used.
public Session setReceiveSpinningTimeout(long timeout)
timeout
- timeout in nanosecondsIllegalArgumentException
- if timeout < 0public MessageMode getMessageMode()
public Session setMessageMode(MessageMode messageMode)
messageMode
- message mode used for processing/parsing raw messages internally.public ConnectionMode getConnectionMode()
public Session setConnectionMode(ConnectionMode connectionMode)
connectionMode
- session connection mode.public String getTestRequestIdPattern()
Note:
Pattern format described here: DateTimeFormatter
.
public Session setTestRequestIdPattern(String pattern)
Note:
Pattern format described here: DateTimeFormatter
.
pattern
- pattern describing format of the test request id, the default format is "yyyyMMdd-HH:mm:ss".IllegalArgumentException
- if pattern is not correspond to the DateTimeFormatter
requirements.public int getLogonConfirmationTimeout()
public Session setLogonConfirmationTimeout(int logonConfirmationTimeout)
logonConfirmationTimeout
- number of seconds to wait for a logon response before disconnecting,
if it is 0 (default value) heartbeat interval will be considered.IllegalArgumentException
- if logonConfirmationTimeout < 0
public int getLogoutConfirmationTimeout()
public Session setLogoutConfirmationTimeout(int logoutConfirmationTimeout)
logoutConfirmationTimeout
- number of seconds to wait for a logout response before disconnecting,
if it is 0 (default value) heartbeat interval will be considered.IllegalArgumentException
- if logonConfirmationTimeout < 0
public boolean isProcessLogonNextExpectedMsgSeqNum()
Note: Please note that tag is introduced and valid starting FIX 4.4 version.
public Session setProcessLogonNextExpectedMsgSeqNum(boolean processLogonNextExpectedMsgSeqNum)
processLogonNextExpectedMsgSeqNum
- process flagpublic Session setProxySettings(ProxySettings proxySettings)
ProxySettings
.proxySettings
- proxy settings, or null if no proxy connection is required, by default it is nullpublic boolean isDisposed()
public void dispose()
public String toString()
public String toStringDetailed()
Copyright © 2005–2024 Onix Solutions. All rights reserved.