Package com.epam.fixengine.manager
Class FIXSessionManager
java.lang.Object
com.epam.fixengine.manager.FIXSessionManager
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 Summary
Modifier and TypeMethodDescriptionfinal void
addTask
(SessionManagerTask task) Adds a new session manager task.final void
cancelScheduleTask
(com.epam.fixengine.manager.scheduler.SchedulerTask schedulerTask) Remove scheduled task.static void
Methods close all sessions.protected static String
decode
(byte[] cipher) static void
Methods dispose all sessions.final boolean
Returns true if session with senderCompID and targetCompID exists.final void
getCopyList
(List<ExtendedFIXSession> copyTo) static final FIXSessionManager
Gets theFIXSessionManager
instance.final List<ExtendedFIXSession>
getList()
Gets the session list.final int
final long
Gets a wait time.final ExtendedFIXSession
Finds the session by sessionID.final ExtendedFIXSession
locate
(SessionParameters params) final ExtendedFIXSession
Finds the session by sessionID.final ExtendedFIXSession
locate
(String senderComId, String senderSubId, String senderLocationId, String targetCompId, String targetSubId, String targetLocationId) TODO: implement ASAPfinal ExtendedFIXSession
locateFirst
(String senderCompID, String targetCompID) Finds the session with senderCompID and targetCompID.protected final void
notifySessionAdd
(ExtendedFIXSession fixSession) protected final void
notifySessionRemoved
(ExtendedFIXSession fixSession) final void
registerFIXSession
(ExtendedFIXSession session) Registers a newsession
final void
Register client FIXSessionListListener.final void
Remove all sessions.final void
removeFIXSession
(ExtendedFIXSession session) Removes thesession
.final boolean
removeTask
(SessionManagerTask task) Removes the task.static boolean
resetSeqNums
(SessionParameters params) final void
scheduleTask
(com.epam.fixengine.manager.scheduler.SchedulerTask schedulerTask, long scheduleTimestamp) Added scheduled task.final void
scheduleTask
(com.epam.fixengine.manager.scheduler.SchedulerTask schedulerTask, long scheduleTimestamp, long period) Added scheduled task.static boolean
setSeqNums
(SessionParameters params, int inSeqNum, int outSeqNum) final void
setWaitTime
(long waitTime) Sets a wait time.final void
Unregister client FIXSessionListListener.
-
Method Details
-
getWaitTime
public final long getWaitTime()Gets a wait time. -
setWaitTime
public final void setWaitTime(long waitTime) Sets a wait time. -
addTask
Adds a new session manager task.- Parameters:
task
- the task to add
-
removeTask
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 taskscheduleTimestamp
- 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 taskscheduleTimestamp
- the timestampperiod
- the period- Throws:
IllegalStateException
- if task was scheduled.
-
cancelScheduleTask
public final void cancelScheduleTask(com.epam.fixengine.manager.scheduler.SchedulerTask schedulerTask) Remove scheduled task. -
getFIXSessionManager
Gets theFIXSessionManager
instance. -
registerFIXSession
Registers a newsession
- Parameters:
session
-
-
removeFIXSession
Removes thesession
.- Parameters:
session
-
-
removeAllSessions
public final void removeAllSessions()Remove all sessions. -
locate
Finds the session by sessionID.- Parameters:
sessionID
- the unique session identifier
-
locate
Finds the session by sessionID.- Parameters:
sessionID
- the unique session identifier
-
locate
-
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
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 idtargetCompID
- the target comp id
-
exists
Returns true if session with senderCompID and targetCompID exists.- Parameters:
sessionID
- the unique session identifier
-
getList
Gets the session list.- Returns:
- cloned list of session
-
getCopyList
-
getSessionSize
public final int getSessionSize() -
registerSessionManagerListener
Register client FIXSessionListListener.- Parameters:
listener
-
-
unregisterSessionManagerListener
Unregister client FIXSessionListListener.- Parameters:
listener
-
-
notifySessionAdd
-
notifySessionRemoved
-
closeAllSession
public static void closeAllSession()Methods close all sessions. -
disposeAllSession
public static void disposeAllSession()Methods dispose all sessions. -
resetSeqNums
- 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
-