com.epam.fixengine.manager
Class FIXSessionManager

java.lang.Object
  extended by 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:
for such sessions.

Method Summary
 void addTask(SessionManagerTask task)
          Adds a new session manager task.
 void cancelScheduleTask(SchedulerTask schedulerTask)
          Remove scheduled task.
static void closeAllSession()
          Methods close all sessions.
protected static String decode(byte[] cipher)
           
static void disposeAllSession()
          Methods dispose all sessions.
 boolean exists(String sessionID)
          Returns true if session with senderCompID and targetCompID exists.
 void getCopyList(List<ExtendedFIXSession> copyTo)
           
static FIXSessionManager getFIXSessionManager()
          Gets the FIXSessionManager instance.
 List<ExtendedFIXSession> getList()
          Gets the session list.
 int getSessionSize()
           
 long getWaitTime()
          Gets a wait time.
 ExtendedFIXSession locate(SessionID sessionID)
          Finds the session by sessionID.
 ExtendedFIXSession locate(SessionParameters params)
           
 ExtendedFIXSession locate(String sessionID)
          Finds the session by sessionID.
 ExtendedFIXSession locate(String senderComId, String senderSubId, String senderLocationId, String targetCompId, String targetSubId, String targetLocationId)
          TODO: implement ASAP
 ExtendedFIXSession locateFirst(String senderCompID, String targetCompID)
          Finds the session with senderCompID and targetCompID.
protected  void notifySessionAdd(ExtendedFIXSession fixSession)
           
protected  void notifySessionRemoved(ExtendedFIXSession fixSession)
           
 void registerFIXSession(ExtendedFIXSession session)
          Registers a new session
 void registerSessionManagerListener(FIXSessionListListener listener)
          Register client FIXSessionListListener.
 void removeAllSessions()
          Remove all sessions.
 void removeFIXSession(ExtendedFIXSession session)
          Removes the session.
 boolean removeTask(SessionManagerTask task)
          Removes the task.
static boolean resetSeqNums(SessionParameters params)
           
 void scheduleTask(SchedulerTask schedulerTask, long scheduleTimestamp)
          Added scheduled task.
 void scheduleTask(SchedulerTask schedulerTask, long scheduleTimestamp, long period)
          Added scheduled task.
static boolean setSeqNums(SessionParameters params, int inSeqNum, int outSeqNum)
           
 void setWaitTime(long waitTime)
          Sets a wait time.
 void unregisterSessionManagerListener(FIXSessionListListener listener)
          Unregister client FIXSessionListListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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(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(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(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)


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.