Package com.epam.fixengine.session
Interface ExtendedFIXSession
- All Superinterfaces:
FIXSession
- All Known Implementing Classes:
AbstractFIXSession
,AcceptorFIXSession
,AutoreconnectFIXSession
,InitiatorFIXSession
Extended fix session.
-
Field Summary
Fields inherited from interface com.epam.fixengine.FIXSession
DEFAULT_SENDING_OPTIONS, SEND_ASYNC, SEND_SYNC
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears output message queue.void
disconnect
(DisconnectReason reasonType, String reasonDescription) void
forcedDisconnect
(DisconnectReason reasonType, String reason, boolean continueReading) Gracefully disconnects current session but wait for answer forcedLogoffTimeout.default Object
getAttribute
(com.epam.fixengine.session.ExtendedFIXSessionAttribute key) getAttribute
(String key) Gets session attribute value.boolean
getAttributeAsBool
(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) long
getAttributeAsLong
(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) long
Gets read bytes.long
Gets send bytes.com.epam.fixengine.encryption.Encryption
Gets session error handler.long
Gets established session timestamp.Gets extended fix session listener.Gets incoming message storage.long
Gets last received message timestamp.long
Gets time when the message is sentGets message factory.Gets internal message queue.long
Gets number of received message.long
Gets number of sent message.Gets outgoing message storage.int
Gets reject message listener.Gets session parameter instance.Gets session parameter instance.boolean
Shows statistics on or off.void
void
Marks the session shutdown as gracefully.void
reinit()
Reset session state and reinit it from stored.void
removeAttribute
(String key) Removes session attribute.void
Save session parameters to file.int
sendMessageAndGetQueueSize
(FIXFieldList message, int optionMask) Do the same thatFIXSession.sendMessage(FIXFieldList, int)
and return queue size.int
sendMessageAndGetQueueSize
(String type, FIXFieldList content, int optionMask) Do the same thatFIXSession.sendMessage(String, FIXFieldList, int)
and return queue size.boolean
sendMessageOutOfTurn
(String msgType, FIXFieldList message) Sends message out of turn.int
sendWithChangesAndGetQueueSize
(FIXFieldList content, ChangesType allowedChangesType, int options) Do the same thatFIXSession.sendWithChanges(FIXFieldList, ChangesType, int)
and return queue size.void
setAttribute
(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, boolean value) void
setAttribute
(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, long value) void
setAttribute
(com.epam.fixengine.session.ExtendedFIXSessionAttribute key, Object object) void
setAttribute
(String key, Object object) Sets session attribute.void
void
setOutOfTurnMode
(boolean mode) Sets OutOf turn mode.void
setSessionState
(SessionState sessionState) Sets session state.void
shutdown
(boolean blocking) Deprecated.void
shutdown
(DisconnectReason reason, boolean blocking) Shutdown the session with specified reason.void
subscribeForAttributeChanges
(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, com.epam.fixengine.session.ExtendedFIXSessionAttributeListener listener) void
Methods inherited from interface com.epam.fixengine.FIXSession
addInSessionLevelMessageListener, addOutSessionLevelMessageListener, addUserGlobalMessageHandler, connect, disconnect, dispose, getInSeqNum, getMessageValidator, getMessageValidator, getMessageValidator, getOutSeqNum, getSessionParameters, getSessionState, init, prepareMessage, prepareMessage, prepareMessage, prepareMessageFromString, prepareMessageFromString, reject, resetSequenceNumbers, resetSequenceNumbers, sendAsIs, sendAsIs, sendMessage, sendMessage, sendMessage, sendMessage, sendWithChanges, sendWithChanges, setErrorHandler, setFIXSessionListener, setInSeqNum, setOutSeqNum, setRejectMessageListener, setSequenceNumbers, setSlowConsumerListener
-
Method Details
-
getExtendedFIXSessionListener
ExtendedFIXSessionListener getExtendedFIXSessionListener()Gets extended fix session listener. -
reinit
Reset session state and reinit it from stored.- Throws:
IOException
-
shutdown
Deprecated.Shutdown the session.- Parameters:
blocking
- If the parameter is true, the next call of method is blocking.
-
shutdown
Shutdown the session with specified reason.- Parameters:
reason
- disconnect reasonblocking
- If the parameter is true, the next call of method is blocking.
-
disconnect
-
forcedDisconnect
Gracefully disconnects current session but wait for answer forcedLogoffTimeout. Logoff with specified reason will be sent to your counterparty. Session will wait the answer for some period, defined by forcedLogoffTimeout configuration property. Note: This method doesn't guarantee immediate shutdown, since FIX protocol require us to wait for counterparty logoff reply. Note: Use this method if you need to close session in exceptional cases and when there is a chance that counterparty newer answer.- Parameters:
reason
- the reasoncontinueReading
- if false then reading of incoming messages will be stopped. This can be used for prevent reading of messages with broken sequencing.
-
setSessionState
Sets session state.- Parameters:
sessionState
- the new session state
-
getSessionParametersInstance
SessionParameters getSessionParametersInstance()Gets session parameter instance. -
getRuntimeState
FIXSessionRuntimeState getRuntimeState()Gets session parameter instance. -
getIncomingMessageStorage
MessageStorage getIncomingMessageStorage()Gets incoming message storage.- Returns:
- message storage
-
getOutgoingMessageStorage
MessageStorage getOutgoingMessageStorage()Gets outgoing message storage.- Returns:
- message storage
-
getMessageQueue
Queue<FIXFieldListWithType> getMessageQueue()Gets internal message queue.- Returns:
- message storage
-
saveSessionParameters
Save session parameters to file.- Throws:
IOException
- if I/O error occurred
-
getMessageFactory
FIXMessageFactory getMessageFactory()Gets message factory.- Returns:
- message factory
-
getLastInMessageTimestamp
long getLastInMessageTimestamp()Gets last received message timestamp.- Returns:
- timestamp
-
getEstablished
long getEstablished()Gets established session timestamp.- Returns:
- timestamp
-
isStatisticEnabled
boolean isStatisticEnabled()Shows statistics on or off.- Returns:
- true is statistic is enabled
- See Also:
-
getBytesSent
long getBytesSent()Gets send bytes.- Returns:
- number of send bytes or -1 if statistic is disabled
-
getBytesRead
long getBytesRead()Gets read bytes.- Returns:
- number of read bytes or -1 if statistic is disabled
-
getNoOfInMessages
long getNoOfInMessages()Gets number of received message.- Returns:
- number of received message or -1 if statistic is disabled
-
getNoOfOutMessages
long getNoOfOutMessages()Gets number of sent message.- Returns:
- number of sent message or -1 if statistic is disabled
-
getLastOutMessageTimestamp
long getLastOutMessageTimestamp()Gets time when the message is sent- Returns:
- time when the message is sent or -1 if statistic is disabled
-
setAttribute
Sets session attribute.- Parameters:
key
- the attribute keyobject
- the attribute value
-
setAttribute
-
getAttribute
Gets session attribute value.- Parameters:
key
- the attribute key- Returns:
- attribute value
-
getAndRemoveAttribute
-
getAttribute
-
getAttributeAsLong
long getAttributeAsLong(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) -
setAttribute
void setAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, long value) -
setAttribute
void setAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, boolean value) -
getAttributeAsBool
boolean getAttributeAsBool(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) -
removeAttribute
Removes session attribute.- Parameters:
key
- the attribute key
-
subscribeForAttributeChanges
void subscribeForAttributeChanges(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, com.epam.fixengine.session.ExtendedFIXSessionAttributeListener listener) -
sendMessageOutOfTurn
Sends message out of turn.- Parameters:
msgType
- the message typemessage
- the message- Returns:
- true if message was send immediately, false - message was queued for later sending
-
setOutOfTurnMode
void setOutOfTurnMode(boolean mode) Sets OutOf turn mode.- Parameters:
mode
- the mode
-
sendMessageAndGetQueueSize
Do the same thatFIXSession.sendMessage(String, FIXFieldList, int)
and return queue size.- Returns:
- queue size. 0 if message was send synchronously
- See Also:
-
sendWithChangesAndGetQueueSize
int sendWithChangesAndGetQueueSize(FIXFieldList content, ChangesType allowedChangesType, int options) Do the same thatFIXSession.sendWithChanges(FIXFieldList, ChangesType, int)
and return queue size.- Returns:
- queue size. 0 if message was send synchronously
- See Also:
-
sendMessageAndGetQueueSize
Do the same thatFIXSession.sendMessage(FIXFieldList, int)
and return queue size.- Returns:
- queue size. 0 if message was send synchronously
- See Also:
-
getQueuedMessagesCount
int getQueuedMessagesCount() -
getErrorHandler
ErrorHandler getErrorHandler()Gets session error handler.- Returns:
- error handler
-
getRejectMessageListener
RejectMessageListener getRejectMessageListener()Gets reject message listener.- Returns:
- reject message listener
-
markShutdownAsGraceful
void markShutdownAsGraceful()Marks the session shutdown as gracefully. -
clearQueue
void clearQueue()Clears output message queue. Method also reject all messages from the queue. To use this feature, the user should set theRejectMessageListener
listener. TODO: @return true if session was able to reject all messages and clean queue (enableMessageRejecting option is enabled) -
getEncryption
com.epam.fixengine.encryption.Encryption getEncryption() -
getLastDisconnectReason
DisconnectReason getLastDisconnectReason() -
setFIXSessionOutOfSyncListener
-
getFIXSessionOutOfSyncListener
FIXSessionOutOfSyncListener getFIXSessionOutOfSyncListener() -
lockSending
void lockSending() -
unlockSending
void unlockSending()
-