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 voidaddTask(SessionManagerTask task) Adds a new session manager task.final voidcancelScheduleTask(com.epam.fixengine.manager.scheduler.SchedulerTask schedulerTask) Remove scheduled task.static voidMethods close all sessions.protected static Stringdecode(byte[] cipher) static voidMethods dispose all sessions.final booleanReturns true if session with senderCompID and targetCompID exists.final voidgetCopyList(List<ExtendedFIXSession> copyTo) static final FIXSessionManagerGets theFIXSessionManagerinstance.final List<ExtendedFIXSession>getList()Gets the session list.final intfinal longGets a wait time.final ExtendedFIXSessionFinds the session by sessionID.final ExtendedFIXSessionlocate(SessionParameters params) final ExtendedFIXSessionFinds the session by sessionID.final ExtendedFIXSessionlocate(String senderComId, String senderSubId, String senderLocationId, String targetCompId, String targetSubId, String targetLocationId) TODO: implement ASAPfinal ExtendedFIXSessionlocateFirst(String senderCompID, String targetCompID) Finds the session with senderCompID and targetCompID.protected final voidnotifySessionAdd(ExtendedFIXSession fixSession) protected final voidnotifySessionRemoved(ExtendedFIXSession fixSession) final voidregisterFIXSession(ExtendedFIXSession session) Registers a newsessionfinal voidRegister client FIXSessionListListener.final voidRemove all sessions.final voidremoveFIXSession(ExtendedFIXSession session) Removes thesession.final booleanremoveTask(SessionManagerTask task) Removes the task.static booleanresetSeqNums(SessionParameters params) final voidscheduleTask(com.epam.fixengine.manager.scheduler.SchedulerTask schedulerTask, long scheduleTimestamp) Added scheduled task.final voidscheduleTask(com.epam.fixengine.manager.scheduler.SchedulerTask schedulerTask, long scheduleTimestamp, long period) Added scheduled task.static booleansetSeqNums(SessionParameters params, int inSeqNum, int outSeqNum) final voidsetWaitTime(long waitTime) Sets a wait time.final voidUnregister 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 theFIXSessionManagerinstance. -
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
-