Class FIXSessionManager

java.lang.Object
com.epam.fixengine.manager.FIXSessionManager

public class FIXSessionManager extends Object
This singleton contains all registered FIXSessions in this JVM session. Each class in the list backed up by the WeakReference so it may return bogus values for sessions that just expired and were removed from the list because of that. SessionState will be returned as DEAD.
See Also:
  • Method Details

    • getWaitTime

      public final long getWaitTime()
      Gets a wait time.
    • setWaitTime

      public final void setWaitTime(long waitTime)
      Sets a wait time.
    • addTask

      public final void addTask(SessionManagerTask task)
      Adds a new session manager task.
      Parameters:
      task - the task to add
    • removeTask

      public final boolean removeTask(SessionManagerTask task)
      Removes the task.
      Parameters:
      task - the task to remove
    • scheduleTask

      public final void scheduleTask(com.epam.fixengine.manager.scheduler.SchedulerTask schedulerTask, long scheduleTimestamp)
      Added scheduled task.
      Parameters:
      schedulerTask - the task
      scheduleTimestamp - the timestamp
      Throws:
      IllegalStateException - if task was scheduled.
    • scheduleTask

      public final void scheduleTask(com.epam.fixengine.manager.scheduler.SchedulerTask schedulerTask, long scheduleTimestamp, long period)
      Added scheduled task.
      Parameters:
      schedulerTask - the task
      scheduleTimestamp - the timestamp
      period - the period
      Throws:
      IllegalStateException - if task was scheduled.
    • cancelScheduleTask

      public final void cancelScheduleTask(com.epam.fixengine.manager.scheduler.SchedulerTask schedulerTask)
      Remove scheduled task.
    • getFIXSessionManager

      public static final FIXSessionManager getFIXSessionManager()
      Gets the FIXSessionManager instance.
    • registerFIXSession

      public final void registerFIXSession(ExtendedFIXSession session)
      Registers a new session
      Parameters:
      session -
    • removeFIXSession

      public final void removeFIXSession(ExtendedFIXSession session)
      Removes the session.
      Parameters:
      session -
    • removeAllSessions

      public final void removeAllSessions()
      Remove all sessions.
    • locate

      public final ExtendedFIXSession locate(String sessionID)
      Finds the session by sessionID.
      Parameters:
      sessionID - the unique session identifier
    • locate

      public final ExtendedFIXSession locate(SessionID sessionID)
      Finds the session by sessionID.
      Parameters:
      sessionID - the unique session identifier
    • locate

      public final ExtendedFIXSession locate(SessionParameters params)
    • locate

      public final ExtendedFIXSession locate(String senderComId, String senderSubId, String senderLocationId, String targetCompId, String targetSubId, String targetLocationId)
      TODO: implement ASAP
      Parameters:
      senderComId -
      senderSubId -
      senderLocationId -
      targetCompId -
      targetSubId -
      targetLocationId -
      Returns:
    • locateFirst

      public final ExtendedFIXSession locateFirst(String senderCompID, String targetCompID)
      Finds the session with senderCompID and targetCompID. It's possible that can be several such sessions but method will return randomly first.
      Parameters:
      senderCompID - the sender comp id
      targetCompID - the target comp id
    • exists

      public final boolean exists(String sessionID)
      Returns true if session with senderCompID and targetCompID exists.
      Parameters:
      sessionID - the unique session identifier
    • getList

      public final List<ExtendedFIXSession> getList()
      Gets the session list.
      Returns:
      cloned list of session
    • getCopyList

      public final void getCopyList(List<ExtendedFIXSession> copyTo)
    • getSessionSize

      public final int getSessionSize()
    • registerSessionManagerListener

      public final void registerSessionManagerListener(FIXSessionListListener listener)
      Register client FIXSessionListListener.
      Parameters:
      listener -
    • unregisterSessionManagerListener

      public final void unregisterSessionManagerListener(FIXSessionListListener listener)
      Unregister client FIXSessionListListener.
      Parameters:
      listener -
    • notifySessionAdd

      protected final void notifySessionAdd(ExtendedFIXSession fixSession)
    • notifySessionRemoved

      protected final void notifySessionRemoved(ExtendedFIXSession fixSession)
    • closeAllSession

      public static void closeAllSession()
      Methods close all sessions.

    • disposeAllSession

      public static void disposeAllSession()
      Methods dispose all sessions.

    • resetSeqNums

      public static boolean resetSeqNums(SessionParameters params) throws IOException
      Parameters:
      params -
      Returns:
      Throws:
      IOException
    • setSeqNums

      public static boolean setSeqNums(SessionParameters params, int inSeqNum, int outSeqNum) throws IOException
      Parameters:
      params -
      inSeqNum -
      outSeqNum -
      Returns:
      Throws:
      IOException
    • decode

      protected static String decode(byte[] cipher)