Interface FIXEngine

All Known Implementing Classes:
FIXEngineB2B

public interface FIXEngine
Interface for FIXEngine-Application interaction
  • Method Details

    • registerApplication

      void registerApplication(Application application)
      Registers application in FIX Engine instance.
      Parameters:
      application - the application, which will process application messages from remote FIX Engine.
    • unregisterApplication

      void unregisterApplication()
      Unregisters application in FIX Engine instance.
    • addEventListener

      void addEventListener(String sessionID, EventListener eventListener)
      Adds event listener for listening specified session.
      Parameters:
      sessionID - the ID of session, which will be listened.
      eventListener - the event listener implementation.
    • addGlobalEventListener

      void addGlobalEventListener(EventListener eventListener)
      Adds global event listener for listening all sessions.
      Parameters:
      eventListener - the event listener implementation.
    • removeEventListener

      boolean removeEventListener(String sessionID, EventListener eventListener)
      Removes event listener for listening specified session.
      Parameters:
      sessionID - the ID of session, which will be listened.
      eventListener - the event listener implementation.
    • removeGlobalEventListener

      boolean removeGlobalEventListener(EventListener eventListener)
      Removes global event listener for listening all session.
      Parameters:
      eventListener - the event listener implementation.
    • connectToRemoteFIXEngine

      String connectToRemoteFIXEngine(String connectionString) throws EngineNotFoundException
      Establishes connection with remote FIX Engine.

      Connection string must be formatted in the following way:
      < protocol > < subprotocol > :// < host > : < port >
      < protocol > ::= fix42
      < subprotocol > ::= tcp

      Parameters:
      connectionString - the connestion string.
      Returns:
      ID of created session.
      Throws:
      EngineNotFoundException - if connection cannot be created or logon respose is not received in pre-configured timeout interval.
    • connectToRemoteFIXEngine

      String connectToRemoteFIXEngine(String connectionString, int heartBtInt, String senderCompID, String targetCompID, int encryptionType) throws EngineNotFoundException
      Establishes connection with remote FIX Engine. Connection string must be formatted in the following way:
      < protocol > < subprotocol > :// < host > : < port >
      < protocol > ::= fix42
      < subprotocol > ::= tcp
      Parameters:
      heartBtInt - the value of Heartbeat interval in seconds, which will be placed in InitialProcess message
      senderCompID - the SenderCompID, which will be placed in messages headers
      targetCompID - the TargetCompID, which will be placed in messages headers
      encryptionType - the type of encryption.
      Returns:
      ID of created session
      Throws:
      EngineNotFoundException - if connection cannot be created or logon respose is not received in pre-configured timeout interval.
    • connectToRemoteFIXEngine

      String connectToRemoteFIXEngine(String connectionString, int heartBtInt, String senderCompID, String targetCompID, int encryptionType, int startFromSeqNum) throws EngineNotFoundException
      Establishes connection with remote FIX Engine. Connection string must be formatted in the following way:
      < protocol > < subprotocol > :// < host > : < port >
      < protocol > ::= fix42
      < subprotocol > ::= tcp
      Parameters:
      heartBtInt - Value of Heartbeat interval in seconds, which will be placed in InitialProcess message
      senderCompID - the SenderCompID, which will be placed in messages headers
      targetCompID - the TargetCompID, which will be placed in messages headers
      encryptionType - the type of encryption.
      startFromSeqNum - the starting outgoing sequence number.
      Returns:
      ID of created session
      Throws:
      EngineNotFoundException - if connection cannot be created or logon respose is not received in pre-configured timeout interval.
    • connectToRemoteFIXEngine

      String connectToRemoteFIXEngine(String connectionString, StdHdrParamStruct stdHdrParamStruct, LogonParamStruct logonParamStruct, int startFromSeqNum) throws EngineNotFoundException
      Establishes connection with remote FIX Engine.
      Parameters:
      stdHdrParamStruct - structure, which contains Standard Message Header parameters
      logonParamStruct - structure, which contains InitialProcess Message parameters
      Returns:
      ID of created session
      Throws:
      EngineNotFoundException - if connection cannot be created or logon respose is not received in pre-configured timeout interval.
    • getSenderCompIDbySession

      String getSenderCompIDbySession(String sessionID) throws SessionNotFoundException
      Gets SenderCompID of session with specified ID.
      Parameters:
      sessionID - session ID
      Throws:
      SessionNotFoundException - if session cannot be found.
    • getSessionIDbyCompIDs

      String getSessionIDbyCompIDs(String senderCompID, String targetCompID) throws SessionNotFoundException
      Gets session ID by senderCompID and targetCompID.
      Parameters:
      senderCompID - senderCompID
      targetCompID - targetCompID
      Returns:
      session ID string
      Throws:
      SessionNotFoundException - if session cannot be found.
    • getTargetCompIDbySession

      String getTargetCompIDbySession(String sessionID) throws SessionNotFoundException
      Gets TargetCompID of session with specified ID.
      Parameters:
      sessionID - the session ID string
      Throws:
      SessionNotFoundException - if session cannot be found.
    • getFIXVersionBySessionID

      FIXVersion getFIXVersionBySessionID(String sessionID) throws Exception
      Gets the FIX Protocol version ID for specified session.
      Parameters:
      sessionID - the session ID.
      Returns:
      the connection protocol version id string: fix40, fix41, fix42, fix43 or fix44.
      Throws:
      Exception - if the version cannot be retrieved.
    • getHeartbeatIntervalBySessionID

      int getHeartbeatIntervalBySessionID(String sessionID) throws Exception
      Gets the FIX Protocol version ID for specified session.
      Parameters:
      sessionID - the session ID.
      Returns:
      the heartbeat interval in seconds.
      Throws:
      Exception - if the heartbeat interval cannot be retrieved.
    • isSessionActive

      boolean isSessionActive(String sessionID) throws Exception
      Checks if session is online.
      Parameters:
      sessionID - the session ID string.
      Returns:
      true if session is online.
      Throws:
      Exception - if session cannot be found.
    • getIncomingSequenceBySessionID

      int getIncomingSequenceBySessionID(String sessionID) throws Exception
      Gets incoming sequence number for session with indicated sessionID.
      Parameters:
      sessionID - the ID of session.
      Throws:
      Exception - if the incoming sequence number cannot be retrieved.
    • getOutgoingSequenceBySessionID

      int getOutgoingSequenceBySessionID(String sessionID) throws Exception
      Gets outgoing sequence number for session with indicated sessionID.
      Parameters:
      sessionID - the ID of session.
      Throws:
      Exception - if the outgoing sequence number cannot be retrieved.
    • sendMessage

      void sendMessage(FIXMessage message, String sessionID) throws ApplMessageTransmitException
      Put FIX message message to queue for sending to remote FIX Engine.
      Parameters:
      message - the message to be sent.
      sessionID - the ID of session in which message will be sent.
      Throws:
      ApplMessageTransmitException - if the message cannot be sent to the counterparty.
    • sendMessageOutOfTurn

      void sendMessageOutOfTurn(FIXMessage message, String sessionID) throws ApplMessageTransmitException
      Send FIXMessage to remote FIX Engine rigth now.
      Parameters:
      message - the message to be sent in FIXMessage format
      sessionID - the ID of session in which message will be sent
      Throws:
      ApplMessageTransmitException - if the message cannot be sent to the counterparty.
    • getMessageFromMessageStore

      FIXMessage getMessageFromMessageStore(MessageDirection messageType, long seqNum, String sessionID) throws Exception
      Retrieves FIX Message from the Message Storage.
      Parameters:
      messageType - the type of message (1 - incoming, 2 - outgoing)
      seqNum - the sequence number of the message.
      sessionID - the ID of session, from which the message will be retrieved.
      Returns:
      the retrieved connection message.
      Throws:
      Exception - if message cannot be retrieved or parsed.
    • closeEngineSession

      void closeEngineSession(String sessionID) throws SessionNotFoundException
      Closes session with specified ID.
      Parameters:
      sessionID - closing session ID
      Throws:
      SessionNotFoundException - if the session cannot be found or properly closed.
    • closeEngineSession

      void closeEngineSession(String sessionID, String reason) throws SessionNotFoundException
      Closes session with specified ID.
      Parameters:
      reason - the reason string that will be sent as text field value (tag=58) of logout message.
      Throws:
      SessionNotFoundException - if the session cannot be found or properly closed.
    • closeEngine

      void closeEngine() throws Exception
      Closes engine.
      Throws:
      Exception - if the FIX Engine cannot be properly closed.