com.epam.fixengine.session
Interface ExtendedFIXSession

All Superinterfaces:
FIXSession
All Known Implementing Classes:
AbstractFIXSession, AcceptorFIXSession, BackupFIXSession, InitiatorFIXSession

public interface ExtendedFIXSession
extends FIXSession

Extended fix session.


Field Summary
 
Fields inherited from interface com.epam.fixengine.FIXSession
DEFAULT_SENDING_OPTIONS, SEND_ASYNC, SEND_SYNC
 
Method Summary
 void clearQueue()
          Clears output message queue.
 void disconnect(com.epam.fixengine.session.DisconnectReason reasonType, String reasonDescription)
           
 void forcedDisconnect(com.epam.fixengine.session.DisconnectReason reasonType, String reason, boolean continueReading)
          Gracefully disconnects current session but wait for answer forcedLogoffTimeout.
 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.
 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.
 MessageStorage getIncomingMessageStorage()
          Gets incoming message storage.
 com.epam.fixengine.session.DisconnectReason getLastDisconnectReason()
           
 long getLastInMessageTimestamp()
          Gets last received message timestamp.
 long getLastOutMessageTimestamp()
          Gets time when the message is sent
 FIXMessageFactory getMessageFactory()
          Gets message factory.
 long getNoOfInMessages()
          Gets number of received message.
 long getNoOfOutMessages()
          Gets number of sent message.
 MessageStorage getOutgoingMessageStorage()
          Gets outgoing message storage.
 int getQueuedMessagesCount()
           
 RejectMessageListener getRejectMessageListener()
          Gets reject message listener.
 SessionParameters getSessionParametersInstance()
          Gets session parameter instance.
 boolean isStatisticEnabled()
          Shows statistics on or off.
 void markShutdownAsGraceful()
          Marks the session shutdown as gracefully.
 void removeAttribute(String key)
          Removes session attribute.
 void restoreSessionParameters()
          Restore session parameters in file.
 void saveSessionParameters()
          Save session parameters to file.
 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 msgType, FIXFieldList message)
          Sends message out of turn.
 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(String key, Object object)
          Sets session attribute.
 void setOutOfTurnMode(boolean mode)
          Sets OutOf turn mode.
 void setSessionState(SessionState sessionState)
          Sets session state.
 void shutdown(boolean blocking)
          Deprecated. 
 void shutdown(com.epam.fixengine.session.DisconnectReason reason, boolean blocking)
          Shutdown the session with specified reason.
 
Methods inherited from interface com.epam.fixengine.FIXSession
connect, disconnect, dispose, getMessageValidator, getSessionParameters, getSessionState, prepareMessage, prepareMessage, prepareMessage, prepareMessageFromString, prepareMessageFromString, reject, resetSequenceNumbers, resetSequenceNumbers, sendAsIs, sendAsIs, sendMessage, sendMessage, sendMessage, sendMessage, sendWithChanges, sendWithChanges, setErrorHandler, setFIXSessionListener, setRejectMessageListener, setSequenceNumbers
 

Method Detail

getExtendedFIXSessionListener

ExtendedFIXSessionListener getExtendedFIXSessionListener()
Gets extended fix session listener.


shutdown

@Deprecated
void shutdown(boolean blocking)
Deprecated. 

Shutdown the session.

Parameters:
blocking - If the parameter is true, the next call of method is blocking.

shutdown

void shutdown(com.epam.fixengine.session.DisconnectReason reason,
              boolean blocking)
Shutdown the session with specified reason.

Parameters:
reason - disconnect reason
blocking - If the parameter is true, the next call of method is blocking.

disconnect

void disconnect(com.epam.fixengine.session.DisconnectReason reasonType,
                String reasonDescription)

forcedDisconnect

void forcedDisconnect(com.epam.fixengine.session.DisconnectReason reasonType,
                      String reason,
                      boolean continueReading)
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 reason
continueReading - if false then reading of incoming messages will be stopped. This can be used for prevent reading of messages with broken sequencing.

setSessionState

void setSessionState(SessionState sessionState)
Sets session state.

Parameters:
sessionState - the new session state

getSessionParametersInstance

SessionParameters getSessionParametersInstance()
Gets session parameter instance.


getIncomingMessageStorage

MessageStorage getIncomingMessageStorage()
Gets incoming message storage.

Returns:
message storage

getOutgoingMessageStorage

MessageStorage getOutgoingMessageStorage()
Gets outgoing message storage.

Returns:
message storage

saveSessionParameters

void saveSessionParameters()
                           throws IOException
Save session parameters to file.

Throws:
IOException - if I/O error occurred

restoreSessionParameters

void restoreSessionParameters()
                              throws IOException
Restore session parameters in file. Method reset all parameters to default.

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(), getBytesRead(), getNoOfInMessages(), getNoOfOutMessages()

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

void setAttribute(String key,
                  Object object)
Sets session attribute.

Parameters:
key - the attribute key
object - the attribute value

getAttribute

Object getAttribute(String key)
Gets session attribute value.

Parameters:
key - the attribute key
Returns:
attribute value

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

void removeAttribute(String key)
Removes session attribute.

Parameters:
key - the attribute key

sendMessageOutOfTurn

boolean sendMessageOutOfTurn(String msgType,
                             FIXFieldList message)
Sends message out of turn.

Parameters:
msgType - the message type
message - 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

int sendMessageAndGetQueueSize(String type,
                               FIXFieldList content,
                               int optionMask)
Do the same that FIXSession.sendMessage(String, FIXFieldList, int) and return queue size.

Returns:
queue size. 0 if message was send synchronously
See Also:
FIXSession.sendMessage(String, FIXFieldList, int)

sendWithChangesAndGetQueueSize

int sendWithChangesAndGetQueueSize(FIXFieldList content,
                                   ChangesType allowedChangesType,
                                   int options)
Do the same that FIXSession.sendWithChanges(FIXFieldList, ChangesType, int) and return queue size.

Returns:
queue size. 0 if message was send synchronously
See Also:
FIXSession.sendWithChanges(FIXFieldList, ChangesType, int)

sendMessageAndGetQueueSize

int sendMessageAndGetQueueSize(FIXFieldList message,
                               int optionMask)
Do the same that FIXSession.sendMessage(FIXFieldList, int) and return queue size.

Returns:
queue size. 0 if message was send synchronously
See Also:
FIXSession.sendMessage(FIXFieldList, int)

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 the RejectMessageListener listener.


getEncryption

com.epam.fixengine.encryption.Encryption getEncryption()

getLastDisconnectReason

com.epam.fixengine.session.DisconnectReason getLastDisconnectReason()


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.