public interface FIXSession
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SENDING_OPTIONS |
static int |
SEND_ASYNC
ASYNC - Enqueue the message before sending as opposed to sending immediately from calling thread.
|
static int |
SEND_SYNC
FORCE_SYNC - Send the message synchronously.
|
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 |
addUserGlobalMessageHandler(com.epam.fixengine.session.messagehandler.AbstractUserGlobalMessageHandler userMessageHandler) |
void |
connect()
Connects to remote counterparty,
if initiator or accepts incoming connection if acceptor.
|
void |
disconnect(String reason)
Gracefully disconnects current session.
|
void |
dispose()
Disposes current session, removes its reference from GlobalSessionManager
and frees all allocated resources.
|
long |
getInSeqNum() |
MessageValidator |
getMessageValidator()
Returns message validator.
|
long |
getOutSeqNum() |
SessionParameters |
getSessionParameters()
Returns the cloned session connection parameters instance.
|
SessionState |
getSessionState()
Returns session state.
|
void |
init()
Initialize FIX session.
|
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 |
reject(String reason)
Reject incoming connection for acceptor.
|
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.
|
boolean |
sendAsIs(FIXFieldList message)
Convenient method to send out FIX message based on the message type and message content.
|
boolean |
sendAsIs(FIXFieldList message,
int optionMask)
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 msgType,
FIXFieldList content)
Convenient method to send out FIX message based on the message type and message content.
|
boolean |
sendMessage(String msgType,
FIXFieldList content,
int optionMask)
Convenient method to send out FIX message based on the message type and message content.
|
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 optionMask)
Convenient method to send out FIX message based on the message type and message content.
|
void |
setErrorHandler(ErrorHandler handler)
Sets error handler.
|
void |
setFIXSessionListener(FIXSessionListener listener)
Sets FIXSession listener to monitor session
status and receive incoming messages.
|
void |
setInSeqNum(long inSeqNum) |
void |
setOutSeqNum(long outSeqNum) |
void |
setRejectMessageListener(RejectMessageListener listener)
Sets reject listener.
|
void |
setSequenceNumbers(long inSeqNum,
long outSeqNum)
Allows user to change sequences numbers for disconnected sessions.
|
void |
setSlowConsumerListener(FIXSessionSlowConsumerListener slowConsumerListener)
Sets slow consumer message listener.
|
static final int SEND_ASYNC
static final int SEND_SYNC
static final int DEFAULT_SENDING_OPTIONS
SessionState getSessionState()
FIXFieldList prepareMessage(FIXFieldList message, MessageStructure structure) throws PreparedMessageException
message
- FIXFieldList objectstructure
- message structurePreparedMessageException
- exceptionFIXFieldList prepareMessage(FIXFieldList message, String type, MessageStructure structure) throws PreparedMessageException
message
- FIXFieldList objectstructure
- message structuretype
- type of the messagePreparedMessageException
- exceptionFIXFieldList prepareMessage(String msgType, MessageStructure userStructure) throws PreparedMessageException
msgType
- message typeuserStructure
- message structurePreparedMessageException
FIXFieldList prepareMessageFromString(byte[] message, MessageStructure structure) throws PreparedMessageException
message
- message stringstructure
- message structure objectPreparedMessageException
- exceptionFIXFieldList prepareMessageFromString(byte[] message, String type, MessageStructure structure) throws PreparedMessageException
message
- message stringstructure
- message structure objecttype
- message typePreparedMessageException
- exceptionvoid resetSequenceNumbers() throws IOException
IOException
void resetSequenceNumbers(boolean checkGapFillBefore) throws IOException
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
void setSequenceNumbers(long inSeqNum, long outSeqNum) throws IOException
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
SessionParameters getSessionParameters()
void init() throws IOException
IOException
- I/O exception if error occurredvoid connect() throws IOException
IOException
- I/O exception if error occurredvoid reject(String reason) throws IOException
IOException
- I/O exception if error occurredvoid disconnect(String reason)
reason
- the reasonboolean sendMessage(String msgType, FIXFieldList content)
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.msgType
- the message type (Tag 35 content)content
- the message contentIllegalStateException
- if session is disposedboolean sendMessage(String msgType, FIXFieldList content, int optionMask)
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.msgType
- the message type (Tag 35 content)content
- the message contentoptionMask
- SEND_SYNC
or SEND_ASYNC
IllegalStateException
- if session is disposedboolean sendMessage(FIXFieldList message)
message
.
If session is disposed no more messages should be send by session.message
- the messageIllegalStateException
- if session is disposedboolean sendMessage(FIXFieldList message, int optionMask)
message
.
If session is disposed no more messages should be send by session.message
- the messageoptionMask
- SEND_SYNC
or SEND_ASYNC
IllegalStateException
- if session is disposedboolean sendAsIs(FIXFieldList message)
message
- the message contentIllegalStateException
- if session is disposedboolean sendAsIs(FIXFieldList message, int optionMask)
message
- the message contentoptionMask
- SEND_SYNC
or SEND_ASYNC
IllegalStateException
- if session is disposedboolean sendWithChanges(FIXFieldList content, ChangesType allowedChangesType)
content
- the message contentallowedChangesType
- the parameter takes the next values:IllegalStateException
- if session is disposedChangesType
boolean sendWithChanges(FIXFieldList content, ChangesType allowedChangesType, int optionMask)
content
- the message contentallowedChangesType
- the parameter takes the next values:optionMask
- SEND_SYNC
or SEND_ASYNC
IllegalStateException
- if session is disposedChangesType
void dispose()
MessageValidator getMessageValidator()
void setFIXSessionListener(FIXSessionListener listener)
listener
- the user specified listenervoid addInSessionLevelMessageListener(FIXMessageListener listener)
listener
- the user specified listenervoid addOutSessionLevelMessageListener(com.epam.fixengine.session.TypedFIXMessageListener listener)
void addUserGlobalMessageHandler(com.epam.fixengine.session.messagehandler.AbstractUserGlobalMessageHandler userMessageHandler)
void setErrorHandler(ErrorHandler handler)
handler
- the error handlerErrorHandler
void setRejectMessageListener(RejectMessageListener listener)
listener
- the reject message listenerRejectMessageListener
void setSlowConsumerListener(FIXSessionSlowConsumerListener slowConsumerListener)
slowConsumerListener
- slow consumer listenerFIXSessionSlowConsumerListener
void setInSeqNum(long inSeqNum) throws IOException
IOException
void setOutSeqNum(long outSeqNum) throws IOException
IOException
long getInSeqNum()
long getOutSeqNum()
Copyright © 2000–2022 EPAM Systems. All rights reserved.