public abstract class AbstractFIXSession extends Object implements ExtendedFIXSession, com.epam.fixengine.session.SessionStateListenSupport
Modifier and Type | Class and Description |
---|---|
class |
AbstractFIXSession.ConsumingControlTransportWrapper |
Modifier and Type | Field and Description |
---|---|
protected com.epam.fixengine.session.util.ConfigurationAdaptor |
configuration |
protected static boolean |
DEBUG_ENABLED |
protected boolean |
graceful |
protected HandlerChain |
listener |
protected static Log |
log |
protected FIXMessageFactory |
messageFactory |
protected com.epam.fixengine.configuration.SendingMode |
preferredSendingMode |
protected Queue<FIXFieldListWithType> |
queue |
protected FIXSessionRuntimeState |
runtimeState |
protected MutableInteger |
sentTRNum |
protected com.epam.fixengine.session.SessionSequenceManager |
sequenceManager |
protected Object |
sessionLock |
protected SessionParameters |
sessionParameters |
protected TestReqIDTimestamp |
testRequestTime |
protected static boolean |
TRACE_ENABLED |
protected FIXTransport |
transport |
DEFAULT_SENDING_OPTIONS, SEND_ASYNC, SEND_SYNC
Constructor and Description |
---|
AbstractFIXSession(FIXMessageFactory messageFactory,
SessionParameters sessionParameters,
HandlerChain fixSessionListener)
Creates the
AbstractFIXSession . |
Modifier and Type | Method and Description |
---|---|
void |
addInSessionLevelMessageListener(FIXMessageListener listener)
Add listeners to receive session level incoming messages.
|
void |
addOutSessionLevelMessageListener(com.epam.fixengine.session.TypedFIXMessageListener listener) |
void |
addSessionStateListener(com.epam.fixengine.session.FIXSessionStateListener stateListener) |
void |
addUserGlobalMessageHandler(com.epam.fixengine.session.messagehandler.AbstractUserGlobalMessageHandler userMessageHandler) |
void |
backupStorages() |
void |
checkHasSessionSendOrReceivedTestRequest()
The method checks if TR send or received.
|
void |
checkSessionInactiveAndSendHbt() |
void |
clearQueue()
Clears output message queue.
|
abstract void |
connect()
Connects to remote counterparty,
if initiator or accepts incoming connection if acceptor.
|
void |
disconnect(DisconnectReason reasonType,
String reasonDescription) |
protected void |
disconnect(DisconnectReason reasonType,
String reasonDescription,
boolean isGracefull,
boolean isForced) |
protected void |
disconnect(DisconnectReason reasonType,
String reasonDescription,
boolean isGracefull,
boolean isForced,
boolean continueReading) |
protected void |
disconnect(DisconnectReason reasonType,
String reasonDescription,
boolean isGracefull,
boolean isForced,
boolean continueReading,
boolean sendLogout) |
void |
disconnect(String reason)
Disconnect the session.
|
protected void |
disconnectTestRequestIsLost()
Disconnect the session if test request doesn't received.
|
void |
dispose()
Disposes current session, removes its reference from GlobalSessionManager
and frees all allocated resources.
|
boolean |
equals(Object o) |
void |
forcedDisconnect(DisconnectReason reasonType,
String reasonDescription,
boolean continueReading)
Gracefully disconnects current session but wait for answer forcedLogoffTimeout.
|
Object |
getAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute key) |
Object |
getAttribute(String key)
Gets session attribute value.
|
boolean |
getAttributeAsBool(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) |
long |
getAttributeAsLong(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) |
long |
getBytesRead()
Gets read bytes.
|
long |
getBytesSent()
Gets send bytes.
|
protected com.epam.fixengine.session.util.ConfigurationAdaptor |
getConfiguration() |
com.epam.fixengine.encryption.Encryption |
getEncryption() |
ErrorHandler |
getErrorHandler()
Gets session error handler.
|
long |
getEstablished()
Gets established session timestamp.
|
ExtendedFIXSessionListener |
getExtendedFIXSessionListener()
Gets extended fix session listener.
|
FIXSessionOutOfSyncListener |
getFIXSessionOutOfSyncListener() |
MessageStorage |
getIncomingMessageStorage()
Gets incoming message storage.
|
long |
getInSeqNum() |
DisconnectReason |
getLastDisconnectReason() |
long |
getLastInMessageTimestamp()
Gets last received message timestamp.
|
long |
getLastOutMessageTimestamp()
Gets time when the message is sent
|
FIXMessageFactory |
getMessageFactory()
Gets message factory.
|
protected HandlerChain |
getMessageHandlers()
Gets chain of message handlers.
|
Queue<FIXFieldListWithType> |
getMessageQueue()
Gets internal message queue.
|
MessageValidator |
getMessageValidator()
Returns message validator.
|
long |
getNoOfInMessages()
Gets number of received message.
|
long |
getNoOfOutMessages()
Gets number of sent message.
|
MessageStorage |
getOutgoingMessageStorage()
Gets outgoing message storage.
|
long |
getOutSeqNum() |
int |
getQueuedMessagesCount() |
RejectMessageListener |
getRejectMessageListener()
Gets reject message listener.
|
FIXSessionRuntimeState |
getRuntimeState()
Gets session parameter instance.
|
com.epam.fixengine.session.SessionSequenceManager |
getSequenceManager() |
SessionParameters |
getSessionParameters()
The returned value is cloned.
|
SessionParameters |
getSessionParametersInstance()
Gets session parameter instance.
|
SessionState |
getSessionState()
Returns session state.
|
FIXSessionSlowConsumerListener |
getSlowConsumerListener() |
StorageFactory |
getStorageFactory()
Gets storage factory
|
int |
hashCode() |
void |
init()
Initialize FIX session.
|
protected void |
initSessionInternal()
Initialize session internal.
|
protected FIXSessionRuntimeState |
initSessionRuntimeState(SessionParameters sessionParameters) |
boolean |
isHbtControlInPumper() |
protected boolean |
isResetSeqNumFlagRequiredForInitLogon() |
boolean |
isStatisticEnabled()
Shows statistics on or off.
|
void |
lockSending() |
void |
markShutdownAsGraceful()
Marks the session shutdown as gracefully.
|
protected void |
onDisconnect() |
protected void |
prepareForConnect()
Initializes the resources and sends a logon message.
|
FIXFieldList |
prepareMessage(FIXFieldList message,
MessageStructure structure)
Builds FIXFieldList object from FIXFieldList object.
|
FIXFieldList |
prepareMessage(FIXFieldList message,
String type,
MessageStructure structure)
Builds FIXFieldList object from FIXFieldList object.
|
FIXFieldList |
prepareMessage(String msgType,
MessageStructure userStructure)
Builds FIXFieldList object with specified type, message structure and prefilled header information
|
FIXFieldList |
prepareMessageFromString(byte[] message,
MessageStructure structure)
Builds FIXFieldList object from String object.
|
FIXFieldList |
prepareMessageFromString(byte[] message,
String type,
MessageStructure structure)
Builds FIXFieldList object from String object.
|
void |
reinit()
Reset session state and reinit it from stored.
|
abstract void |
reject(String reason)
Reject incoming connection for acceptor.
|
void |
removeAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) |
void |
removeAttribute(String key)
Removes session attribute.
|
void |
removeLongAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr) |
void |
removeSessionStateListener(com.epam.fixengine.session.FIXSessionStateListener stateListener) |
protected void |
resetInitialization() |
void |
resetSequenceNumbers()
Allows user to reset sequences numbers by sending logon with 141=Y.
|
void |
resetSequenceNumbers(boolean checkGapFillBefore)
Allows user to reset sequences numbers by sending logon with 141=Y.
|
protected void |
resetTestRequestFlags() |
protected void |
restoreSessionAfterReceivedTestRequest()
Restore the session if test request is received.
|
void |
saveSessionParameters()
Save session parameters to file.
|
boolean |
sendAsIs(FIXFieldList message)
Convenient method to send out FIX message based on the message type and message content.
|
boolean |
sendAsIs(FIXFieldList message,
int options)
Convenient method to send out FIX message based on the message type and message content.
|
boolean |
sendMessage(FIXFieldList message)
Convenient method to send out user built FIX message.
|
boolean |
sendMessage(FIXFieldList message,
int optionMask)
Convenient method to send out user built FIX message.
|
boolean |
sendMessage(String type,
FIXFieldList content)
Convenient method to send out FIX message based on the message type and message content.
|
boolean |
sendMessage(String type,
FIXFieldList content,
int optionMask)
Convenient method to send out FIX message based on the message type and message content.
|
int |
sendMessageAndGetQueueSize(FIXFieldList message,
int optionMask)
Do the same that
FIXSession.sendMessage(FIXFieldList, int) and return queue size. |
int |
sendMessageAndGetQueueSize(String type,
FIXFieldList content,
int optionMask)
Do the same that
FIXSession.sendMessage(String, FIXFieldList, int) and return queue size. |
boolean |
sendMessageOutOfTurn(String type,
FIXFieldList message)
Sends message out of turn.
|
protected void |
sendTestRequest()
Send test request.
|
boolean |
sendWithChanges(FIXFieldList content,
ChangesType allowedChangesType)
Convenient method to send out FIX message based on the message type and message content.
|
boolean |
sendWithChanges(FIXFieldList content,
ChangesType allowedChangesType,
int options)
Convenient method to send out FIX message based on the message type and message content.
|
int |
sendWithChangesAndGetQueueSize(FIXFieldList content,
ChangesType allowedChangesType) |
int |
sendWithChangesAndGetQueueSize(FIXFieldList content,
ChangesType allowedChangesType,
int options)
Do the same that
FIXSession.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 value)
Sets session attribute.
|
void |
setErrorHandler(ErrorHandler handler)
Sets error handler.
|
void |
setFIXSessionListener(FIXSessionListener listener)
Sets FIXSession listener to monitor session
status and receive incoming messages.
|
void |
setFIXSessionOutOfSyncListener(FIXSessionOutOfSyncListener listener) |
void |
setInSeqNum(long inSeqNum) |
protected void |
setLastDisconnectReason(DisconnectReason reason) |
void |
setOutOfTurnMode(boolean mode)
Sets OutOf turn mode.
|
void |
setOutSeqNum(long outSeqNum) |
protected void |
setPreLogoffSessionState(boolean forced,
boolean continueReading) |
void |
setRejectMessageListener(RejectMessageListener listener)
Sets reject listener.
|
void |
setSequenceNumbers(long inSeqNum,
long outSeqNum)
Allows user to change sequences numbers for disconnected sessions.
|
void |
setSessionState(SessionState sessionState)
Sets session state.
|
void |
setSlowConsumerListener(FIXSessionSlowConsumerListener slowConsumerListener)
Sets slow consumer message listener.
|
void |
shutdown(boolean blocking)
Deprecated.
|
void |
shutdown(DisconnectReason reason,
boolean blocking)
Shutdown the session.
|
protected void |
startSession() |
void |
subscribeForAttributeChanges(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr,
com.epam.fixengine.session.ExtendedFIXSessionAttributeListener listener) |
String |
toString() |
void |
unlockSending() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAndRemoveAttribute
protected static final Log log
protected static final boolean DEBUG_ENABLED
protected static final boolean TRACE_ENABLED
protected FIXTransport transport
protected Queue<FIXFieldListWithType> queue
protected final HandlerChain listener
protected SessionParameters sessionParameters
protected FIXSessionRuntimeState runtimeState
protected final FIXMessageFactory messageFactory
protected boolean graceful
protected final com.epam.fixengine.session.SessionSequenceManager sequenceManager
protected TestReqIDTimestamp testRequestTime
protected MutableInteger sentTRNum
protected final Object sessionLock
protected final com.epam.fixengine.session.util.ConfigurationAdaptor configuration
protected com.epam.fixengine.configuration.SendingMode preferredSendingMode
public AbstractFIXSession(FIXMessageFactory messageFactory, SessionParameters sessionParameters, HandlerChain fixSessionListener)
AbstractFIXSession
.protected com.epam.fixengine.session.util.ConfigurationAdaptor getConfiguration()
protected FIXSessionRuntimeState initSessionRuntimeState(SessionParameters sessionParameters)
public com.epam.fixengine.session.SessionSequenceManager getSequenceManager()
public ExtendedFIXSessionListener getExtendedFIXSessionListener()
ExtendedFIXSession
getExtendedFIXSessionListener
in interface ExtendedFIXSession
ExtendedFIXSession.getExtendedFIXSessionListener()
public StorageFactory getStorageFactory()
public RejectMessageListener getRejectMessageListener()
ExtendedFIXSession
getRejectMessageListener
in interface ExtendedFIXSession
ExtendedFIXSession.getRejectMessageListener()
public ErrorHandler getErrorHandler()
ExtendedFIXSession
getErrorHandler
in interface ExtendedFIXSession
ExtendedFIXSession.getErrorHandler()
public void setErrorHandler(ErrorHandler handler)
FIXSession
setErrorHandler
in interface FIXSession
handler
- the error handlerFIXSession.setErrorHandler(com.epam.fixengine.ErrorHandler)
public void setRejectMessageListener(RejectMessageListener listener)
FIXSession
setRejectMessageListener
in interface FIXSession
listener
- the reject message listenerFIXSession.setRejectMessageListener(com.epam.fixengine.RejectMessageListener)
public void setFIXSessionOutOfSyncListener(FIXSessionOutOfSyncListener listener)
setFIXSessionOutOfSyncListener
in interface ExtendedFIXSession
public FIXSessionOutOfSyncListener getFIXSessionOutOfSyncListener()
getFIXSessionOutOfSyncListener
in interface ExtendedFIXSession
public FIXSessionSlowConsumerListener getSlowConsumerListener()
public void setSlowConsumerListener(FIXSessionSlowConsumerListener slowConsumerListener)
FIXSession
setSlowConsumerListener
in interface FIXSession
slowConsumerListener
- slow consumer listenerFIXSessionSlowConsumerListener
public void markShutdownAsGraceful()
ExtendedFIXSession
markShutdownAsGraceful
in interface ExtendedFIXSession
ExtendedFIXSession.markShutdownAsGraceful();
public void clearQueue()
ExtendedFIXSession
RejectMessageListener
listener.
TODO: @return true if session was able to reject all messages and clean queue (enableMessageRejecting option is
enabled)clearQueue
in interface ExtendedFIXSession
ExtendedFIXSession.clearQueue()
public int getQueuedMessagesCount()
getQueuedMessagesCount
in interface ExtendedFIXSession
public void lockSending()
lockSending
in interface ExtendedFIXSession
public void unlockSending()
unlockSending
in interface ExtendedFIXSession
public void setOutOfTurnMode(boolean mode)
ExtendedFIXSession
setOutOfTurnMode
in interface ExtendedFIXSession
mode
- the modepublic void resetSequenceNumbers() throws IOException
FIXSession
resetSequenceNumbers
in interface FIXSession
IOException
FIXSession.resetSequenceNumbers()
public void resetSequenceNumbers(boolean checkGapFillBefore) throws IOException
FIXSession
resetSequenceNumbers
in interface FIXSession
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.IOException
FIXSession.resetSequenceNumbers(boolean)
public void setSequenceNumbers(long inSeqNum, long outSeqNum) throws IOException
FIXSession
setSequenceNumbers
in interface FIXSession
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.IOException
public void setFIXSessionListener(FIXSessionListener listener)
FIXSession
setFIXSessionListener
in interface FIXSession
listener
- the user specified listenerFIXSession.setFIXSessionListener(FIXSessionListener)
public void addInSessionLevelMessageListener(FIXMessageListener listener)
FIXSession
addInSessionLevelMessageListener
in interface FIXSession
listener
- the user specified listenerFIXSession.addInSessionLevelMessageListener(FIXMessageListener)
public void addOutSessionLevelMessageListener(com.epam.fixengine.session.TypedFIXMessageListener listener)
addOutSessionLevelMessageListener
in interface FIXSession
public void addUserGlobalMessageHandler(com.epam.fixengine.session.messagehandler.AbstractUserGlobalMessageHandler userMessageHandler)
addUserGlobalMessageHandler
in interface FIXSession
public MessageStorage getOutgoingMessageStorage()
ExtendedFIXSession
getOutgoingMessageStorage
in interface ExtendedFIXSession
ExtendedFIXSession.getOutgoingMessageStorage()
public MessageStorage getIncomingMessageStorage()
ExtendedFIXSession
getIncomingMessageStorage
in interface ExtendedFIXSession
ExtendedFIXSession.getIncomingMessageStorage()
public Queue<FIXFieldListWithType> getMessageQueue()
ExtendedFIXSession
getMessageQueue
in interface ExtendedFIXSession
ExtendedFIXSession.getMessageQueue()
public void saveSessionParameters() throws IOException
ExtendedFIXSession
saveSessionParameters
in interface ExtendedFIXSession
IOException
- if I/O error occurredExtendedFIXSession.saveSessionParameters()
public abstract void connect() throws IOException
FIXSession
connect
in interface FIXSession
IOException
- I/O exception if error occurredFIXSession.connect()
public abstract void reject(String reason) throws IOException
FIXSession
reject
in interface FIXSession
IOException
- I/O exception if error occurredFIXSession.reject(String)
public SessionParameters getSessionParametersInstance()
ExtendedFIXSession
getSessionParametersInstance
in interface ExtendedFIXSession
ExtendedFIXSession.getSessionParametersInstance()
public FIXMessageFactory getMessageFactory()
ExtendedFIXSession
getMessageFactory
in interface ExtendedFIXSession
ExtendedFIXSession.getMessageFactory()
public SessionParameters getSessionParameters()
getSessionParameters
in interface FIXSession
FIXSession.getSessionParameters()
public SessionState getSessionState()
FIXSession
getSessionState
in interface FIXSession
FIXSession.getSessionState()
public void setSessionState(SessionState sessionState)
ExtendedFIXSession
setSessionState
in interface ExtendedFIXSession
sessionState
- the new session stateExtendedFIXSession.setSessionState(com.epam.fixengine.SessionState)
public FIXSessionRuntimeState getRuntimeState()
ExtendedFIXSession
getRuntimeState
in interface ExtendedFIXSession
public boolean isStatisticEnabled()
ExtendedFIXSession
isStatisticEnabled
in interface ExtendedFIXSession
ExtendedFIXSession.isStatisticEnabled()
public boolean isHbtControlInPumper()
public long getBytesRead()
ExtendedFIXSession
getBytesRead
in interface ExtendedFIXSession
ExtendedFIXSession.getBytesRead()
public long getEstablished()
ExtendedFIXSession
getEstablished
in interface ExtendedFIXSession
ExtendedFIXSession.getEstablished()
public long getBytesSent()
ExtendedFIXSession
getBytesSent
in interface ExtendedFIXSession
ExtendedFIXSession.getBytesSent()
public long getNoOfInMessages()
ExtendedFIXSession
getNoOfInMessages
in interface ExtendedFIXSession
ExtendedFIXSession.getNoOfInMessages()
public long getNoOfOutMessages()
ExtendedFIXSession
getNoOfOutMessages
in interface ExtendedFIXSession
ExtendedFIXSession.getNoOfOutMessages()
public long getLastInMessageTimestamp()
ExtendedFIXSession
getLastInMessageTimestamp
in interface ExtendedFIXSession
ExtendedFIXSession.getLastInMessageTimestamp()
public long getLastOutMessageTimestamp()
ExtendedFIXSession
getLastOutMessageTimestamp
in interface ExtendedFIXSession
ExtendedFIXSession.getLastOutMessageTimestamp()
protected HandlerChain getMessageHandlers()
protected void onDisconnect()
public void init() throws IOException
FIXSession
init
in interface FIXSession
IOException
- I/O exception if error occurredpublic void reinit() throws IOException
ExtendedFIXSession
reinit
in interface ExtendedFIXSession
IOException
protected void resetInitialization()
protected void prepareForConnect() throws IOException
IOException
- - if I/O error occurred.protected boolean isResetSeqNumFlagRequiredForInitLogon()
protected void initSessionInternal() throws IOException
IOException
protected void startSession() throws IOException
IOException
public void disconnect(String reason)
The method sends the logof message, if response is not received during the HBI, shutdown the session.
disconnect
in interface FIXSession
reason
- the reason, if parameter is not null,
the logof message will be send with 58=reason.FIXSession.disconnect(String)
public void disconnect(DisconnectReason reasonType, String reasonDescription)
disconnect
in interface ExtendedFIXSession
public void forcedDisconnect(DisconnectReason reasonType, String reasonDescription, boolean continueReading)
ExtendedFIXSession
forcedDisconnect
in interface ExtendedFIXSession
reasonDescription
- the reasoncontinueReading
- if false then reading of incoming messages will be stopped. This can be used for prevent
reading of messages with broken sequencing.protected void disconnect(DisconnectReason reasonType, String reasonDescription, boolean isGracefull, boolean isForced)
protected void disconnect(DisconnectReason reasonType, String reasonDescription, boolean isGracefull, boolean isForced, boolean continueReading)
protected void disconnect(DisconnectReason reasonType, String reasonDescription, boolean isGracefull, boolean isForced, boolean continueReading, boolean sendLogout)
@Deprecated public void shutdown(boolean blocking)
ExtendedFIXSession
shutdown
in interface ExtendedFIXSession
blocking
- If the parameter is true, the next call of method is blocking.public void shutdown(DisconnectReason reason, boolean blocking)
blocking
is true, the next call of method is blocking.shutdown
in interface ExtendedFIXSession
blocking
- the blocking parameterreason
- disconnect reasonprotected void setPreLogoffSessionState(boolean forced, boolean continueReading)
public boolean sendMessage(String type, FIXFieldList content, int optionMask)
FIXSession
msgType
is null, Engine sends the message as is;
If the msgType
is "", Engine updates body length, sequence number, sending time and checksum fields;
Otherwise Engine wraps the content
.
If session is disposed no more messages should be send by session.sendMessage
in interface FIXSession
type
- the message type (Tag 35 content)content
- the message contentoptionMask
- FIXSession.SEND_SYNC
or FIXSession.SEND_ASYNC
FIXSession.sendMessage(String, com.epam.fix.message.FIXFieldList)
public int sendMessageAndGetQueueSize(String type, FIXFieldList content, int optionMask)
ExtendedFIXSession
FIXSession.sendMessage(String, FIXFieldList, int)
and return queue size.sendMessageAndGetQueueSize
in interface ExtendedFIXSession
FIXSession.sendMessage(String, FIXFieldList, int)
public boolean sendMessage(String type, FIXFieldList content)
FIXSession
msgType
is null, Engine sends the message as is;
If the msgType
is "", Engine updates body length, sequence number, sending time and checksum fields;
Otherwise Engine wraps the content
.
If session is disposed no more messages should be send by session.sendMessage
in interface FIXSession
type
- the message type (Tag 35 content)content
- the message contentpublic boolean sendAsIs(FIXFieldList message, int options)
FIXSession
sendAsIs
in interface FIXSession
message
- the message contentoptions
- FIXSession.SEND_SYNC
or FIXSession.SEND_ASYNC
public boolean sendAsIs(FIXFieldList message)
FIXSession
sendAsIs
in interface FIXSession
message
- the message contentpublic boolean sendWithChanges(FIXFieldList content, ChangesType allowedChangesType, int options)
FIXSession
sendWithChanges
in interface FIXSession
content
- the message contentallowedChangesType
- the parameter takes the next values:options
- FIXSession.SEND_SYNC
or FIXSession.SEND_ASYNC
ChangesType
public int sendWithChangesAndGetQueueSize(FIXFieldList content, ChangesType allowedChangesType, int options)
ExtendedFIXSession
FIXSession.sendWithChanges(FIXFieldList, ChangesType, int)
and return queue size.sendWithChangesAndGetQueueSize
in interface ExtendedFIXSession
FIXSession.sendWithChanges(FIXFieldList, ChangesType, int)
public boolean sendWithChanges(FIXFieldList content, ChangesType allowedChangesType)
FIXSession
sendWithChanges
in interface FIXSession
content
- the message contentallowedChangesType
- the parameter takes the next values:ChangesType
public int sendWithChangesAndGetQueueSize(FIXFieldList content, ChangesType allowedChangesType)
public FIXFieldList prepareMessage(FIXFieldList message, MessageStructure structure) throws PreparedMessageException
FIXSession
prepareMessage
in interface FIXSession
message
- FIXFieldList objectstructure
- message structurePreparedMessageException
- exceptionFIXSession.prepareMessage(FIXFieldList, com.epam.fix.message.MessageStructure)
public FIXFieldList prepareMessage(FIXFieldList message, String type, MessageStructure structure) throws PreparedMessageException
FIXSession
prepareMessage
in interface FIXSession
message
- FIXFieldList objecttype
- type of the messagestructure
- message structurePreparedMessageException
- exceptionFIXSession.prepareMessage(FIXFieldList, String, com.epam.fix.message.MessageStructure)
public FIXFieldList prepareMessage(String msgType, MessageStructure userStructure) throws PreparedMessageException
FIXSession
prepareMessage
in interface FIXSession
msgType
- message typeuserStructure
- message structurePreparedMessageException
FIXSession.prepareMessage(String, com.epam.fix.message.MessageStructure)
public FIXFieldList prepareMessageFromString(byte[] message, MessageStructure structure) throws PreparedMessageException
FIXSession
prepareMessageFromString
in interface FIXSession
message
- message stringstructure
- message structure objectPreparedMessageException
- exceptionFIXSession.prepareMessageFromString(byte[], com.epam.fix.message.MessageStructure)
public FIXFieldList prepareMessageFromString(byte[] message, String type, MessageStructure structure) throws PreparedMessageException
FIXSession
prepareMessageFromString
in interface FIXSession
message
- message stringtype
- message typestructure
- message structure objectPreparedMessageException
- exceptionFIXSession.prepareMessageFromString(byte[], String, com.epam.fix.message.MessageStructure)
public boolean sendMessage(FIXFieldList message)
FIXSession
message
.
If session is disposed no more messages should be send by session.sendMessage
in interface FIXSession
message
- the messageFIXSession.sendMessage(com.epam.fix.message.FIXFieldList)
public boolean sendMessage(FIXFieldList message, int optionMask)
FIXSession
message
.
If session is disposed no more messages should be send by session.sendMessage
in interface FIXSession
message
- the messageoptionMask
- FIXSession.SEND_SYNC
or FIXSession.SEND_ASYNC
public int sendMessageAndGetQueueSize(FIXFieldList message, int optionMask)
ExtendedFIXSession
FIXSession.sendMessage(FIXFieldList, int)
and return queue size.sendMessageAndGetQueueSize
in interface ExtendedFIXSession
FIXSession.sendMessage(FIXFieldList, int)
public boolean sendMessageOutOfTurn(String type, FIXFieldList message)
ExtendedFIXSession
sendMessageOutOfTurn
in interface ExtendedFIXSession
type
- the message typemessage
- the messageFIXSession.sendMessage(String, com.epam.fix.message.FIXFieldList)
public MessageValidator getMessageValidator()
FIXSession
getMessageValidator
in interface FIXSession
FIXSession.getMessageValidator()
public void dispose()
FIXSession
dispose
in interface FIXSession
FIXSession.dispose()
protected void sendTestRequest()
public void checkHasSessionSendOrReceivedTestRequest()
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.
public void checkSessionInactiveAndSendHbt()
protected void disconnectTestRequestIsLost()
protected void restoreSessionAfterReceivedTestRequest()
protected void resetTestRequestFlags()
public void setAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, long value)
setAttribute
in interface ExtendedFIXSession
public void removeAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr)
public void removeLongAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr)
public long getAttributeAsLong(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr)
getAttributeAsLong
in interface ExtendedFIXSession
public void setAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, boolean value)
setAttribute
in interface ExtendedFIXSession
public boolean getAttributeAsBool(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr)
getAttributeAsBool
in interface ExtendedFIXSession
public void setAttribute(String key, Object value)
ExtendedFIXSession
setAttribute
in interface ExtendedFIXSession
key
- the attribute keyvalue
- the attribute valueExtendedFIXSession.setAttribute(String, Object)
public void setAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute key, Object object)
setAttribute
in interface ExtendedFIXSession
public Object getAttribute(String key)
ExtendedFIXSession
getAttribute
in interface ExtendedFIXSession
key
- the attribute keyExtendedFIXSession.getAttribute(String)
public Object getAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute key)
getAttribute
in interface ExtendedFIXSession
public void removeAttribute(String key)
ExtendedFIXSession
removeAttribute
in interface ExtendedFIXSession
key
- the attribute keyExtendedFIXSession.removeAttribute(String)
public void subscribeForAttributeChanges(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, com.epam.fixengine.session.ExtendedFIXSessionAttributeListener listener)
subscribeForAttributeChanges
in interface ExtendedFIXSession
public void addSessionStateListener(com.epam.fixengine.session.FIXSessionStateListener stateListener)
addSessionStateListener
in interface com.epam.fixengine.session.SessionStateListenSupport
public void removeSessionStateListener(com.epam.fixengine.session.FIXSessionStateListener stateListener)
removeSessionStateListener
in interface com.epam.fixengine.session.SessionStateListenSupport
public com.epam.fixengine.encryption.Encryption getEncryption()
getEncryption
in interface ExtendedFIXSession
protected void setLastDisconnectReason(DisconnectReason reason)
public DisconnectReason getLastDisconnectReason()
getLastDisconnectReason
in interface ExtendedFIXSession
public void backupStorages() throws IOException
IOException
public void setInSeqNum(long inSeqNum) throws IOException
setInSeqNum
in interface FIXSession
IOException
public void setOutSeqNum(long outSeqNum) throws IOException
setOutSeqNum
in interface FIXSession
IOException
public long getInSeqNum()
getInSeqNum
in interface FIXSession
public long getOutSeqNum()
getOutSeqNum
in interface FIXSession
Copyright © 2000–2022 EPAM Systems. All rights reserved.