Interface ExtendedFIXSession

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

public interface ExtendedFIXSession extends FIXSession
Extended fix session.
  • Method Details

    • getExtendedFIXSessionListener

      ExtendedFIXSessionListener getExtendedFIXSessionListener()
      Gets extended fix session listener.
    • reinit

      void reinit() throws IOException
      Reset session state and reinit it from stored.
      Throws:
      IOException
    • 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(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(DisconnectReason reasonType, String reasonDescription)
    • forcedDisconnect

      void forcedDisconnect(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.
    • 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

      void saveSessionParameters() throws IOException
      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

      void setAttribute(String key, Object object)
      Sets session attribute.
      Parameters:
      key - the attribute key
      object - the attribute value
    • setAttribute

      void setAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute key, Object object)
    • getAttribute

      Object getAttribute(String key)
      Gets session attribute value.
      Parameters:
      key - the attribute key
      Returns:
      attribute value
    • getAndRemoveAttribute

      default Object getAndRemoveAttribute(String key)
    • getAttribute

      Object getAttribute(com.epam.fixengine.session.ExtendedFIXSessionAttribute key)
    • 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
    • subscribeForAttributeChanges

      void subscribeForAttributeChanges(com.epam.fixengine.session.ExtendedFIXSessionAttribute attr, com.epam.fixengine.session.ExtendedFIXSessionAttributeListener listener)
    • 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:
    • 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:
    • 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:
    • 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. 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

      void setFIXSessionOutOfSyncListener(FIXSessionOutOfSyncListener listener)
    • getFIXSessionOutOfSyncListener

      FIXSessionOutOfSyncListener getFIXSessionOutOfSyncListener()
    • lockSending

      void lockSending()
    • unlockSending

      void unlockSending()