Class AbstractFIXSession
- All Implemented Interfaces:
FIXSession,ExtendedFIXSession,com.epam.fixengine.session.SessionStateListenSupport
- Direct Known Subclasses:
AcceptorFIXSession,InitiatorFIXSession
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.epam.fixengine.session.util.ConfigurationAdaptorprotected booleanprotected final HandlerChainprotected final FIXMessageFactoryprotected com.epam.fixengine.configuration.SendingModeprotected Queue<FIXFieldListWithType>protected FIXSessionRuntimeStateprotected com.epam.fixengine.session.util.MutableIntegerprotected final com.epam.fixengine.session.SessionSequenceManagerprotected final Objectprotected SessionParametersprotected com.epam.fixengine.session.util.TestReqIDTimestampprotected FIXTransportFields inherited from interface com.epam.fixengine.FIXSession
DEFAULT_SENDING_OPTIONS, SEND_ASYNC, SEND_SYNC -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFIXSession(FIXMessageFactory messageFactory, SessionParameters sessionParameters, HandlerChain fixSessionListener) Creates theAbstractFIXSession. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd listeners to receive session level incoming messages.voidaddOutSessionLevelMessageListener(com.epam.fixengine.session.TypedFIXMessageListener listener) voidaddSessionStateListener(com.epam.fixengine.session.FIXSessionStateListener stateListener) voidaddUserGlobalMessageHandler(com.epam.fixengine.session.messagehandler.AbstractUserGlobalMessageHandler userMessageHandler) voidvoidThe method checks if TR send or received.voidvoidClears output message queue.abstract voidconnect()Connects to remote counterparty, if initiator or accepts incoming connection if acceptor.voiddisconnect(DisconnectReason reasonType, String reasonDescription) protected voiddisconnect(DisconnectReason reasonType, String reasonDescription, boolean isGracefull, boolean isForced) protected voiddisconnect(DisconnectReason reasonType, String reasonDescription, boolean isGracefull, boolean isForced, boolean continueReading) protected voiddisconnect(DisconnectReason reasonType, String reasonDescription, boolean isGracefull, boolean isForced, boolean continueReading, boolean sendLogout) voiddisconnect(String reason) Disconnect the session.protected voidDisconnect the session if test request doesn't received.voiddispose()Disposes current session, removes its reference from GlobalSessionManager and frees all allocated resources.booleanvoidforcedDisconnect(DisconnectReason reasonType, String reasonDescription, boolean continueReading) Gracefully disconnects current session but wait for answer forcedLogoffTimeout.getAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute key) getAttribute(String key) Gets session attribute value.booleangetAttributeAsBool(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) longgetAttributeAsLong(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) longGets read bytes.longGets send bytes.protected com.epam.fixengine.session.util.ConfigurationAdaptorcom.epam.fixengine.encryption.EncryptionGets session error handler.longGets established session timestamp.Gets extended fix session listener.Gets incoming message storage.longlongGets last received message timestamp.longGets time when the message is sentGets message factory.protected HandlerChainGets chain of message handlers.Gets internal message queue.Returns message validator.getMessageValidator(String newAppVersion) Returns message validator by appVersion.getMessageValidator(String newAppVersion, FIXVersion baseFixVersion) Returns message validator by appVersion.longGets number of received message.longGets number of sent message.Gets outgoing message storage.longintGets reject message listener.Gets session parameter instance.com.epam.fixengine.session.SessionSequenceManagerThe returned value is cloned.Gets session parameter instance.Returns session state.Gets storage factoryinthashCode()voidinit()Initialize FIX session.protected voidInitialize session internal.protected FIXSessionRuntimeStateinitSessionRuntimeState(SessionParameters sessionParameters) booleanprotected booleanbooleanShows statistics on or off.voidvoidMarks the session shutdown as gracefully.protected voidprotected voidInitializes the resources and sends a logon message.prepareMessage(FIXFieldList message, MessageStructure structure) Builds FIXFieldList object from FIXFieldList object.prepareMessage(FIXFieldList message, String type, MessageStructure structure) Builds FIXFieldList object from FIXFieldList object.prepareMessage(String msgType, MessageStructure userStructure) Builds FIXFieldList object with specified type, message structure and prefilled header informationprepareMessageFromString(byte[] message, MessageStructure structure) Builds FIXFieldList object from String object.prepareMessageFromString(byte[] message, String type, MessageStructure structure) Builds FIXFieldList object from String object.voidreinit()Reset session state and reinit it from stored.abstract voidReject incoming connection for acceptor.voidremoveAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) voidremoveAttribute(String key) Removes session attribute.voidremoveLongAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) voidremoveSessionStateListener(com.epam.fixengine.session.FIXSessionStateListener stateListener) protected voidvoidAllows user to reset sequences numbers by sending logon with 141=Y.voidresetSequenceNumbers(boolean checkGapFillBefore) Allows user to reset sequences numbers by sending logon with 141=Y.protected voidprotected voidRestore the session if test request is received.voidSave session parameters to file.booleansendAsIs(FIXFieldList message) Convenient method to send out FIX message based on the message type and message content.booleansendAsIs(FIXFieldList message, int options) Convenient method to send out FIX message based on the message type and message content.booleansendMessage(FIXFieldList message) Convenient method to send out user built FIX message.booleansendMessage(FIXFieldList message, int optionMask) Convenient method to send out user built FIX message.booleansendMessage(String type, FIXFieldList content) Convenient method to send out FIX message based on the message type and message content.booleansendMessage(String type, FIXFieldList content, int optionMask) Convenient method to send out FIX message based on the message type and message content.intsendMessageAndGetQueueSize(FIXFieldList message, int optionMask) Do the same thatFIXSession.sendMessage(FIXFieldList, int)and return queue size.intsendMessageAndGetQueueSize(String type, FIXFieldList content, int optionMask) Do the same thatFIXSession.sendMessage(String, FIXFieldList, int)and return queue size.booleansendMessageOutOfTurn(String type, FIXFieldList message) Sends message out of turn.protected voidSend test request.booleansendWithChanges(FIXFieldList content, ChangesType allowedChangesType) Convenient method to send out FIX message based on the message type and message content.booleansendWithChanges(FIXFieldList content, ChangesType allowedChangesType, int options) Convenient method to send out FIX message based on the message type and message content.intsendWithChangesAndGetQueueSize(FIXFieldList content, ChangesType allowedChangesType) intsendWithChangesAndGetQueueSize(FIXFieldList content, ChangesType allowedChangesType, int options) Do the same thatFIXSession.sendWithChanges(FIXFieldList, ChangesType, int)and return queue size.voidsetAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, boolean value) voidsetAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, long value) voidsetAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute key, Object object) voidsetAttribute(String key, Object value) Sets session attribute.voidsetErrorHandler(ErrorHandler handler) Sets error handler.voidsetFIXSessionListener(FIXSessionListener listener) Sets FIXSession listener to monitor session status and receive incoming messages.voidvoidsetInSeqNum(long inSeqNum) protected voidvoidsetOutOfTurnMode(boolean mode) Sets OutOf turn mode.voidsetOutSeqNum(long outSeqNum) protected voidsetPreLogoffSessionState(boolean forced, boolean continueReading) voidSets reject listener.voidsetSequenceNumbers(long inSeqNum, long outSeqNum) Allows user to change sequences numbers for disconnected sessions.voidsetSessionState(SessionState sessionState) Sets session state.voidsetSlowConsumerListener(FIXSessionSlowConsumerListener slowConsumerListener) Sets slow consumer message listener.voidshutdown(boolean blocking) Deprecated.see AbstractFIXSession#shutdown(DisconnectReason reason, boolean blocking)voidshutdown(DisconnectReason reason, boolean blocking) Shutdown the session.protected voidvoidsubscribeForAttributeChanges(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, com.epam.fixengine.session.ExtendedFIXSessionAttributeListener listener) toString()voidMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.epam.fixengine.session.ExtendedFIXSession
getAndRemoveAttribute
-
Field Details
-
transport
-
queue
-
listener
-
sessionParameters
-
runtimeState
-
messageFactory
-
graceful
protected boolean graceful -
sequenceManager
protected final com.epam.fixengine.session.SessionSequenceManager sequenceManager -
testRequestTime
protected com.epam.fixengine.session.util.TestReqIDTimestamp testRequestTime -
sentTRNum
protected com.epam.fixengine.session.util.MutableInteger sentTRNum -
sessionLock
-
configuration
protected final com.epam.fixengine.session.util.ConfigurationAdaptor configuration -
preferredSendingMode
protected com.epam.fixengine.configuration.SendingMode preferredSendingMode
-
-
Constructor Details
-
AbstractFIXSession
protected AbstractFIXSession(FIXMessageFactory messageFactory, SessionParameters sessionParameters, HandlerChain fixSessionListener) Creates theAbstractFIXSession.
-
-
Method Details
-
getConfiguration
protected com.epam.fixengine.session.util.ConfigurationAdaptor getConfiguration() -
initSessionRuntimeState
-
getSequenceManager
public com.epam.fixengine.session.SessionSequenceManager getSequenceManager() -
getExtendedFIXSessionListener
Description copied from interface:ExtendedFIXSessionGets extended fix session listener.- Specified by:
getExtendedFIXSessionListenerin interfaceExtendedFIXSession- See Also:
-
getStorageFactory
Gets storage factory -
getRejectMessageListener
Description copied from interface:ExtendedFIXSessionGets reject message listener.- Specified by:
getRejectMessageListenerin interfaceExtendedFIXSession- Returns:
- reject message listener
- See Also:
-
getErrorHandler
Description copied from interface:ExtendedFIXSessionGets session error handler.- Specified by:
getErrorHandlerin interfaceExtendedFIXSession- Returns:
- error handler
- See Also:
-
setErrorHandler
Description copied from interface:FIXSessionSets error handler.- Specified by:
setErrorHandlerin interfaceFIXSession- Parameters:
handler- the error handler- See Also:
-
setRejectMessageListener
Description copied from interface:FIXSessionSets reject listener.- Specified by:
setRejectMessageListenerin interfaceFIXSession- Parameters:
listener- the reject message listener- See Also:
-
setFIXSessionOutOfSyncListener
- Specified by:
setFIXSessionOutOfSyncListenerin interfaceExtendedFIXSession
-
getFIXSessionOutOfSyncListener
- Specified by:
getFIXSessionOutOfSyncListenerin interfaceExtendedFIXSession
-
getSlowConsumerListener
-
setSlowConsumerListener
Description copied from interface:FIXSessionSets slow consumer message listener.- Specified by:
setSlowConsumerListenerin interfaceFIXSession- Parameters:
slowConsumerListener- slow consumer listener- See Also:
-
markShutdownAsGraceful
public void markShutdownAsGraceful()Description copied from interface:ExtendedFIXSessionMarks the session shutdown as gracefully.- Specified by:
markShutdownAsGracefulin interfaceExtendedFIXSession
-
clearQueue
public void clearQueue()Description copied from interface:ExtendedFIXSessionClears output message queue. Method also reject all messages from the queue. To use this feature, the user should set theRejectMessageListenerlistener. TODO: @return true if session was able to reject all messages and clean queue (enableMessageRejecting option is enabled)- Specified by:
clearQueuein interfaceExtendedFIXSession- See Also:
-
getQueuedMessagesCount
public int getQueuedMessagesCount()- Specified by:
getQueuedMessagesCountin interfaceExtendedFIXSession
-
lockSending
public void lockSending()- Specified by:
lockSendingin interfaceExtendedFIXSession
-
unlockSending
public void unlockSending()- Specified by:
unlockSendingin interfaceExtendedFIXSession
-
setOutOfTurnMode
public void setOutOfTurnMode(boolean mode) Description copied from interface:ExtendedFIXSessionSets OutOf turn mode.- Specified by:
setOutOfTurnModein interfaceExtendedFIXSession- Parameters:
mode- the mode
-
resetSequenceNumbers
Description copied from interface:FIXSessionAllows user to reset sequences numbers by sending logon with 141=Y. Notice: Only supported for FIX versions 4.1 and above. Notice: The logon message will be send only when session is in connected state.- Specified by:
resetSequenceNumbersin interfaceFIXSession- Throws:
IOException- See Also:
-
resetSequenceNumbers
Description copied from interface:FIXSessionAllows user to reset sequences numbers by sending logon with 141=Y. Notice: Only supported for FIX versions 4.1 and above. Notice: The logon message will be send only when session is in connected state.- Specified by:
resetSequenceNumbersin interfaceFIXSession- Parameters:
checkGapFillBefore- - the flag indicates if needed to check the seq num.If true the TR will be sent before introday logon otherwise only intraday logon will be sent.
- Throws:
IOException- See Also:
-
setSequenceNumbers
Description copied from interface:FIXSessionAllows user to change sequences numbers for disconnected sessions.- Specified by:
setSequenceNumbersin interfaceFIXSession- Parameters:
inSeqNum- new incoming sequence number. If new value is < 0, then this parameter will be ignored.outSeqNum- new outgoing sequence number. If new value is < 0, then this parameter will be ignored.- Throws:
IOException
-
setFIXSessionListener
Description copied from interface:FIXSessionSets FIXSession listener to monitor session status and receive incoming messages.- Specified by:
setFIXSessionListenerin interfaceFIXSession- Parameters:
listener- the user specified listener- See Also:
-
addInSessionLevelMessageListener
Description copied from interface:FIXSessionAdd listeners to receive session level incoming messages. FIX session level message type:- 'A' - Logon
- '0' - Heartbeat
- '1' - Test Request
- '2' - Resend Request
- '3' - Reject
- '4' - Sequence Reset
- '5' - Logout
- Specified by:
addInSessionLevelMessageListenerin interfaceFIXSession- Parameters:
listener- the user specified listener- See Also:
-
addOutSessionLevelMessageListener
public void addOutSessionLevelMessageListener(com.epam.fixengine.session.TypedFIXMessageListener listener) - Specified by:
addOutSessionLevelMessageListenerin interfaceFIXSession
-
addUserGlobalMessageHandler
public void addUserGlobalMessageHandler(com.epam.fixengine.session.messagehandler.AbstractUserGlobalMessageHandler userMessageHandler) - Specified by:
addUserGlobalMessageHandlerin interfaceFIXSession
-
getOutgoingMessageStorage
Description copied from interface:ExtendedFIXSessionGets outgoing message storage.- Specified by:
getOutgoingMessageStoragein interfaceExtendedFIXSession- Returns:
- message storage
- See Also:
-
getIncomingMessageStorage
Description copied from interface:ExtendedFIXSessionGets incoming message storage.- Specified by:
getIncomingMessageStoragein interfaceExtendedFIXSession- Returns:
- message storage
- See Also:
-
getMessageQueue
Description copied from interface:ExtendedFIXSessionGets internal message queue.- Specified by:
getMessageQueuein interfaceExtendedFIXSession- Returns:
- message storage
- See Also:
-
saveSessionParameters
Description copied from interface:ExtendedFIXSessionSave session parameters to file.- Specified by:
saveSessionParametersin interfaceExtendedFIXSession- Throws:
IOException- if I/O error occurred- See Also:
-
connect
Description copied from interface:FIXSessionConnects to remote counterparty, if initiator or accepts incoming connection if acceptor.- Specified by:
connectin interfaceFIXSession- Throws:
IOException- I/O exception if error occurred- See Also:
-
reject
Description copied from interface:FIXSessionReject incoming connection for acceptor. Not applicable for initiator.- Specified by:
rejectin interfaceFIXSession- Throws:
IOException- I/O exception if error occurred- See Also:
-
getSessionParametersInstance
Description copied from interface:ExtendedFIXSessionGets session parameter instance.- Specified by:
getSessionParametersInstancein interfaceExtendedFIXSession- See Also:
-
getMessageFactory
Description copied from interface:ExtendedFIXSessionGets message factory.- Specified by:
getMessageFactoryin interfaceExtendedFIXSession- Returns:
- message factory
- See Also:
-
getSessionParameters
The returned value is cloned.- Specified by:
getSessionParametersin interfaceFIXSession- Returns:
- SessionParameters - session parameters
- See Also:
-
getSessionState
Description copied from interface:FIXSessionReturns session state.- Specified by:
getSessionStatein interfaceFIXSession- Returns:
- SessionState - session state
- See Also:
-
setSessionState
Description copied from interface:ExtendedFIXSessionSets session state.- Specified by:
setSessionStatein interfaceExtendedFIXSession- Parameters:
sessionState- the new session state- See Also:
-
getRuntimeState
Description copied from interface:ExtendedFIXSessionGets session parameter instance.- Specified by:
getRuntimeStatein interfaceExtendedFIXSession
-
isStatisticEnabled
public boolean isStatisticEnabled()Description copied from interface:ExtendedFIXSessionShows statistics on or off.- Specified by:
isStatisticEnabledin interfaceExtendedFIXSession- Returns:
- true is statistic is enabled
- See Also:
-
isHbtControlInPumper
public boolean isHbtControlInPumper() -
getBytesRead
public long getBytesRead()Description copied from interface:ExtendedFIXSessionGets read bytes.- Specified by:
getBytesReadin interfaceExtendedFIXSession- Returns:
- number of read bytes or -1 if statistic is disabled
- See Also:
-
getEstablished
public long getEstablished()Description copied from interface:ExtendedFIXSessionGets established session timestamp.- Specified by:
getEstablishedin interfaceExtendedFIXSession- Returns:
- timestamp
- See Also:
-
getBytesSent
public long getBytesSent()Description copied from interface:ExtendedFIXSessionGets send bytes.- Specified by:
getBytesSentin interfaceExtendedFIXSession- Returns:
- number of send bytes or -1 if statistic is disabled
- See Also:
-
getNoOfInMessages
public long getNoOfInMessages()Description copied from interface:ExtendedFIXSessionGets number of received message.- Specified by:
getNoOfInMessagesin interfaceExtendedFIXSession- Returns:
- number of received message or -1 if statistic is disabled
- See Also:
-
getNoOfOutMessages
public long getNoOfOutMessages()Description copied from interface:ExtendedFIXSessionGets number of sent message.- Specified by:
getNoOfOutMessagesin interfaceExtendedFIXSession- Returns:
- number of sent message or -1 if statistic is disabled
- See Also:
-
getLastInMessageTimestamp
public long getLastInMessageTimestamp()Description copied from interface:ExtendedFIXSessionGets last received message timestamp.- Specified by:
getLastInMessageTimestampin interfaceExtendedFIXSession- Returns:
- timestamp
- See Also:
-
getLastOutMessageTimestamp
public long getLastOutMessageTimestamp()Description copied from interface:ExtendedFIXSessionGets time when the message is sent- Specified by:
getLastOutMessageTimestampin interfaceExtendedFIXSession- Returns:
- time when the message is sent or -1 if statistic is disabled
- See Also:
-
getMessageHandlers
Gets chain of message handlers. -
onDisconnect
protected void onDisconnect() -
init
Description copied from interface:FIXSessionInitialize FIX session. This allows to put messages to session. These messages will be send after connect.- Specified by:
initin interfaceFIXSession- Throws:
IOException- I/O exception if error occurred
-
reinit
Description copied from interface:ExtendedFIXSessionReset session state and reinit it from stored.- Specified by:
reinitin interfaceExtendedFIXSession- Throws:
IOException
-
resetInitialization
protected void resetInitialization() -
prepareForConnect
Initializes the resources and sends a logon message.- Throws:
IOException- - if I/O error occurred.
-
isResetSeqNumFlagRequiredForInitLogon
protected boolean isResetSeqNumFlagRequiredForInitLogon() -
initSessionInternal
Initialize session internal.The method is created all session object: in/out storage and pumper/reader, etc.
- Throws:
IOException
-
startSession
- Throws:
IOException
-
disconnect
Disconnect the session.The method sends the logof message, if response is not received during the HBI, shutdown the session.
- Specified by:
disconnectin interfaceFIXSession- Parameters:
reason- the reason, if parameter is not null, the logof message will be send with 58=reason.- See Also:
-
disconnect
- Specified by:
disconnectin interfaceExtendedFIXSession
-
forcedDisconnect
public void forcedDisconnect(DisconnectReason reasonType, String reasonDescription, boolean continueReading) Description copied from interface:ExtendedFIXSessionGracefully 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.- Specified by:
forcedDisconnectin interfaceExtendedFIXSessionreasonDescription- the reasoncontinueReading- if false then reading of incoming messages will be stopped. This can be used for prevent reading of messages with broken sequencing.
-
disconnect
protected void disconnect(DisconnectReason reasonType, String reasonDescription, boolean isGracefull, boolean isForced) -
disconnect
protected void disconnect(DisconnectReason reasonType, String reasonDescription, boolean isGracefull, boolean isForced, boolean continueReading) -
disconnect
protected void disconnect(DisconnectReason reasonType, String reasonDescription, boolean isGracefull, boolean isForced, boolean continueReading, boolean sendLogout) -
shutdown
Deprecated.see AbstractFIXSession#shutdown(DisconnectReason reason, boolean blocking)Description copied from interface:ExtendedFIXSessionShutdown the session.- Specified by:
shutdownin interfaceExtendedFIXSession- Parameters:
blocking- If the parameter is true, the next call of method is blocking.
-
shutdown
Shutdown the session. If the parameterblockingis true, the next call of method is blocking.- Specified by:
shutdownin interfaceExtendedFIXSession- Parameters:
blocking- the blocking parameterreason- disconnect reason
-
setPreLogoffSessionState
protected void setPreLogoffSessionState(boolean forced, boolean continueReading) -
sendMessage
Description copied from interface:FIXSessionConvenient method to send out FIX message based on the message type and message content. Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless. If themsgTypeis null, Engine sends the message as is; If themsgTypeis "", Engine updates body length, sequence number, sending time and checksum fields; Otherwise Engine wraps thecontent.If session is disposed no more messages should be send by session.
- Specified by:
sendMessagein interfaceFIXSession- Parameters:
type- the message type (Tag 35 content)content- the message contentoptionMask-FIXSession.SEND_SYNCorFIXSession.SEND_ASYNC- Returns:
- true if message was send immediately, false - message was queued for later sending
- See Also:
-
sendMessageAndGetQueueSize
Description copied from interface:ExtendedFIXSessionDo the same thatFIXSession.sendMessage(String, FIXFieldList, int)and return queue size.- Specified by:
sendMessageAndGetQueueSizein interfaceExtendedFIXSession- Returns:
- queue size. 0 if message was send synchronously
- See Also:
-
sendMessage
Description copied from interface:FIXSessionConvenient method to send out FIX message based on the message type and message content. Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless. If themsgTypeis null, Engine sends the message as is; If themsgTypeis "", Engine updates body length, sequence number, sending time and checksum fields; Otherwise Engine wraps thecontent.If session is disposed no more messages should be send by session.
- Specified by:
sendMessagein interfaceFIXSession- Parameters:
type- the message type (Tag 35 content)content- the message content- Returns:
- true if message was send immediately, false - message was queued for later sending
-
sendAsIs
Description copied from interface:FIXSessionConvenient method to send out FIX message based on the message type and message content. Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless. The Engine sends the message as is.If session is disposed no more messages should be send by session.
- Specified by:
sendAsIsin interfaceFIXSession- Parameters:
message- the message contentoptions-FIXSession.SEND_SYNCorFIXSession.SEND_ASYNC- Returns:
- true if message was send immediately, false - message was queued for later sending
-
sendAsIs
Description copied from interface:FIXSessionConvenient method to send out FIX message based on the message type and message content. Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless. The Engine sends the message as is.If session is disposed no more messages should be send by session.
- Specified by:
sendAsIsin interfaceFIXSession- Parameters:
message- the message content- Returns:
- true if message was send immediately, false - message was queued for later sending
-
sendWithChanges
Description copied from interface:FIXSessionConvenient method to send out FIX message based on the message type and message content. Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless. The Engine sends the message as is.If session is disposed no more messages should be send by session.
- Specified by:
sendWithChangesin interfaceFIXSession- Parameters:
content- the message contentallowedChangesType- the parameter takes the next values:options-FIXSession.SEND_SYNCorFIXSession.SEND_ASYNC- Returns:
- true if message was send immediately, false - message was queued for later sending
- See Also:
-
sendWithChangesAndGetQueueSize
public int sendWithChangesAndGetQueueSize(FIXFieldList content, ChangesType allowedChangesType, int options) Description copied from interface:ExtendedFIXSessionDo the same thatFIXSession.sendWithChanges(FIXFieldList, ChangesType, int)and return queue size.- Specified by:
sendWithChangesAndGetQueueSizein interfaceExtendedFIXSession- Returns:
- queue size. 0 if message was send synchronously
- See Also:
-
sendWithChanges
Description copied from interface:FIXSessionConvenient method to send out FIX message based on the message type and message content. Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless. The Engine sends the message as is.If session is disposed no more messages should be send by session.
- Specified by:
sendWithChangesin interfaceFIXSession- Parameters:
content- the message contentallowedChangesType- the parameter takes the next values:- Returns:
- true if message was send immediately, false - message was queued for later sending
- See Also:
-
sendWithChangesAndGetQueueSize
-
prepareMessage
public FIXFieldList prepareMessage(FIXFieldList message, MessageStructure structure) throws PreparedMessageException Description copied from interface:FIXSessionBuilds FIXFieldList object from FIXFieldList object.- Specified by:
prepareMessagein interfaceFIXSession- Parameters:
message- FIXFieldList objectstructure- message structure- Returns:
- FIXFieldList object
- Throws:
PreparedMessageException- exception- See Also:
-
prepareMessage
public FIXFieldList prepareMessage(FIXFieldList message, String type, MessageStructure structure) throws PreparedMessageException Description copied from interface:FIXSessionBuilds FIXFieldList object from FIXFieldList object.- Specified by:
prepareMessagein interfaceFIXSession- Parameters:
message- FIXFieldList objecttype- type of the messagestructure- message structure- Returns:
- FIXFieldList object
- Throws:
PreparedMessageException- exception- See Also:
-
prepareMessage
public FIXFieldList prepareMessage(String msgType, MessageStructure userStructure) throws PreparedMessageException Description copied from interface:FIXSessionBuilds FIXFieldList object with specified type, message structure and prefilled header information- Specified by:
prepareMessagein interfaceFIXSession- Parameters:
msgType- message typeuserStructure- message structure- Returns:
- FIXFieldList object
- Throws:
PreparedMessageException- See Also:
-
prepareMessageFromString
public FIXFieldList prepareMessageFromString(byte[] message, MessageStructure structure) throws PreparedMessageException Description copied from interface:FIXSessionBuilds FIXFieldList object from String object.- Specified by:
prepareMessageFromStringin interfaceFIXSession- Parameters:
message- message stringstructure- message structure object- Returns:
- FIXFieldList object
- Throws:
PreparedMessageException- exception- See Also:
-
prepareMessageFromString
public FIXFieldList prepareMessageFromString(byte[] message, String type, MessageStructure structure) throws PreparedMessageException Description copied from interface:FIXSessionBuilds FIXFieldList object from String object.- Specified by:
prepareMessageFromStringin interfaceFIXSession- Parameters:
message- message stringtype- message typestructure- message structure object- Returns:
- FIXFieldList object
- Throws:
PreparedMessageException- exception- See Also:
-
sendMessage
Description copied from interface:FIXSessionConvenient method to send out user built FIX message. Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless. The Engine updates the footer and header in themessage.If session is disposed no more messages should be send by session.
- Specified by:
sendMessagein interfaceFIXSession- Parameters:
message- the message- Returns:
- true if message was send immediately, false - message was queued for later sending
- See Also:
-
sendMessage
Description copied from interface:FIXSessionConvenient method to send out user built FIX message. Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless. The Engine updates the footer and header in themessage.If session is disposed no more messages should be send by session.
- Specified by:
sendMessagein interfaceFIXSession- Parameters:
message- the messageoptionMask-FIXSession.SEND_SYNCorFIXSession.SEND_ASYNC- Returns:
- true if message was send immediately, false - message was queued for later sending
-
sendMessageAndGetQueueSize
Description copied from interface:ExtendedFIXSessionDo the same thatFIXSession.sendMessage(FIXFieldList, int)and return queue size.- Specified by:
sendMessageAndGetQueueSizein interfaceExtendedFIXSession- Returns:
- queue size. 0 if message was send synchronously
- See Also:
-
sendMessageOutOfTurn
Description copied from interface:ExtendedFIXSessionSends message out of turn.- Specified by:
sendMessageOutOfTurnin interfaceExtendedFIXSession- Parameters:
type- the message typemessage- the message- Returns:
- true if message was send immediately, false - message was queued for later sending
- See Also:
-
getMessageValidator
Description copied from interface:FIXSessionReturns message validator.- Specified by:
getMessageValidatorin interfaceFIXSession- Returns:
- message validator for current session
- See Also:
-
dispose
public void dispose()Description copied from interface:FIXSessionDisposes current session, removes its reference from GlobalSessionManager and frees all allocated resources. Normally should be called after disconnect(). However it is possible to call this method for active session without previous disconnect() that will abnormally terminate fix session by closing fix connection (without logon exchange). This is useful to terminate stuck sessions if standard FIX logoff procedure doesn't work.- Specified by:
disposein interfaceFIXSession- See Also:
-
sendTestRequest
protected void sendTestRequest()Send test request. -
checkHasSessionSendOrReceivedTestRequest
public void checkHasSessionSendOrReceivedTestRequest()The method checks if TR send or received.If session is not received any messages during HB interval the HB will be send and If no response received session will be disconnected;
This is helper method for session task.
-
checkSessionInactiveAndSendHbt
public void checkSessionInactiveAndSendHbt() -
disconnectTestRequestIsLost
protected void disconnectTestRequestIsLost()Disconnect the session if test request doesn't received. -
restoreSessionAfterReceivedTestRequest
protected void restoreSessionAfterReceivedTestRequest()Restore the session if test request is received. -
resetTestRequestFlags
protected void resetTestRequestFlags() -
setAttribute
public void setAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, long value) - Specified by:
setAttributein interfaceExtendedFIXSession
-
removeAttribute
public void removeAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) -
removeLongAttribute
public void removeLongAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) -
getAttributeAsLong
public long getAttributeAsLong(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) - Specified by:
getAttributeAsLongin interfaceExtendedFIXSession
-
setAttribute
public void setAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, boolean value) - Specified by:
setAttributein interfaceExtendedFIXSession
-
getAttributeAsBool
public boolean getAttributeAsBool(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) - Specified by:
getAttributeAsBoolin interfaceExtendedFIXSession
-
setAttribute
Description copied from interface:ExtendedFIXSessionSets session attribute.- Specified by:
setAttributein interfaceExtendedFIXSession- Parameters:
key- the attribute keyvalue- the attribute value- See Also:
-
setAttribute
- Specified by:
setAttributein interfaceExtendedFIXSession
-
getAttribute
Description copied from interface:ExtendedFIXSessionGets session attribute value.- Specified by:
getAttributein interfaceExtendedFIXSession- Parameters:
key- the attribute key- Returns:
- attribute value
- See Also:
-
getAttribute
- Specified by:
getAttributein interfaceExtendedFIXSession
-
removeAttribute
Description copied from interface:ExtendedFIXSessionRemoves session attribute.- Specified by:
removeAttributein interfaceExtendedFIXSession- Parameters:
key- the attribute key- See Also:
-
subscribeForAttributeChanges
public void subscribeForAttributeChanges(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, com.epam.fixengine.session.ExtendedFIXSessionAttributeListener listener) - Specified by:
subscribeForAttributeChangesin interfaceExtendedFIXSession
-
addSessionStateListener
public void addSessionStateListener(com.epam.fixengine.session.FIXSessionStateListener stateListener) - Specified by:
addSessionStateListenerin interfacecom.epam.fixengine.session.SessionStateListenSupport
-
removeSessionStateListener
public void removeSessionStateListener(com.epam.fixengine.session.FIXSessionStateListener stateListener) - Specified by:
removeSessionStateListenerin interfacecom.epam.fixengine.session.SessionStateListenSupport
-
toString
-
equals
-
hashCode
public int hashCode() -
getEncryption
public com.epam.fixengine.encryption.Encryption getEncryption()- Specified by:
getEncryptionin interfaceExtendedFIXSession
-
setLastDisconnectReason
-
getLastDisconnectReason
- Specified by:
getLastDisconnectReasonin interfaceExtendedFIXSession
-
backupStorages
- Throws:
IOException
-
setInSeqNum
- Specified by:
setInSeqNumin interfaceFIXSession- Throws:
IOException
-
setOutSeqNum
- Specified by:
setOutSeqNumin interfaceFIXSession- Throws:
IOException
-
getInSeqNum
public long getInSeqNum()- Specified by:
getInSeqNumin interfaceFIXSession
-
getOutSeqNum
public long getOutSeqNum()- Specified by:
getOutSeqNumin interfaceFIXSession
-
getMessageValidator
Description copied from interface:FIXSessionReturns message validator by appVersion.- Specified by:
getMessageValidatorin interfaceFIXSession- Returns:
- message validator by appVersion
-
getMessageValidator
Description copied from interface:FIXSessionReturns message validator by appVersion. Validates for compliance with the basic version- Specified by:
getMessageValidatorin interfaceFIXSession- Parameters:
newAppVersion- - appVersion from messagebaseFixVersion- - base version for appVersion from message/session- Returns:
- message validator by appVersion
-