com.teraspaces.qwfix.ordermanager
Class FIXSessionOrderList

java.lang.Object
  extended by com.teraspaces.qwfix.ordermanager.FIXSessionOrderList

public final class FIXSessionOrderList
extends Object

Represents list of all orders against a specific FIXSessionPersistence.


Method Summary
 List<FIXCrossOrder> getCrossOrders()
          Gets the list all cross orders in current FIXSessionOrderList.
 FIXOrderMessage getExecutionByExecID(String execID)
          Gets the execution by ExecID.
 List<FIXListOrder> getListOrders()
          Gets the list all list orders in current FIXSessionOrderList.
 FIXOrderMessage getOrderByClOrdID(String clOrdID)
          Gets a regular order identified by ClOrdID.
 FIXOrderMessage getOrderByCrossID(String crossID)
          Gets the cross order by specified crossID.
 FIXListOrder getOrderByListID(String listID)
          Gets the list order by specified ListID.
 List<FIXRegularOrder> getRegularOrders()
          Gets the list of all regular orders (those can be identified by ClOrdID) managed in current FIXSessionOrderList.
 FIXSessionPersistence getSessionPersistence()
          Gets the session persistence.
 boolean isClOrdIDAvailable(String clOrdID)
          Determines whether a ClOrdID is available.
 void setCapacity(int nRegularOrder, int nCrossOrder, int nListOrder, int nExecution)
          Initializes the capacity of the current FIXSessionOrderList.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isClOrdIDAvailable

public boolean isClOrdIDAvailable(String clOrdID)
Determines whether a ClOrdID is available.

Parameters:
clOrdID - the ClOrdID
Returns:
true if ClOrdID is available; otherwise, false

getSessionPersistence

public FIXSessionPersistence getSessionPersistence()
Gets the session persistence.

Returns:
the session persistence; or null if the owner FIXSessionOrderManager has FIXSessionOrderManagerSettings.uniqueIDForMultipleDaySessions() in its settings

getOrderByClOrdID

public FIXOrderMessage getOrderByClOrdID(String clOrdID)
Gets a regular order identified by ClOrdID.

Parameters:
clOrdID - the ClOrdID
Returns:
an instance of FIXOrderMessage representing the order message. FIXOrderMessage.NULL will be returned the order is not found.

getOrderByCrossID

public FIXOrderMessage getOrderByCrossID(String crossID)
Gets the cross order by specified crossID.

Parameters:
crossID - the CrossID
Returns:
an instance of FIXOrderMessage representing the order message. FIXOrderMessage.NULL will be returned the order is not found.

getOrderByListID

public FIXListOrder getOrderByListID(String listID)
Gets the list order by specified ListID.

Parameters:
listID - the ListID
Returns:
the order by ListID; or null if not found

getExecutionByExecID

public FIXOrderMessage getExecutionByExecID(String execID)
Gets the execution by ExecID.

Parameters:
execID - the ExecID
Returns:
the execution by ExecID. FIXOrderMessage.NULL will be returned the execution is not found.

getRegularOrders

public List<FIXRegularOrder> getRegularOrders()
Gets the list of all regular orders (those can be identified by ClOrdID) managed in current FIXSessionOrderList. The returned collection is read only.

The collection contains the list of all single orders, side orders populated from all cross orders, and single orders populated from all list orders.

This collection only contains the orders that can be identified by unique ClOrdID. In order to get all cross orders and list orders, use getCrossOrders() or getListOrders().

Returns:
the regular orders

getCrossOrders

public List<FIXCrossOrder> getCrossOrders()
Gets the list all cross orders in current FIXSessionOrderList. The returned collection is read only.

Cross orders are orders identified by CrossID. To get the list of orders of other types, see getRegularOrders() or getListOrders().

Returns:
the cross orders

getListOrders

public List<FIXListOrder> getListOrders()
Gets the list all list orders in current FIXSessionOrderList. The returned collection is read only.

Cross orders are orders identified by ListID. To get the list of orders of other types, see getRegularOrders() or getCrossOrders().

Returns:
the list orders

setCapacity

public void setCapacity(int nRegularOrder,
                        int nCrossOrder,
                        int nListOrder,
                        int nExecution)
Initializes the capacity of the current FIXSessionOrderList.

FIXSessionOrderList uses Hashtable to manage unique IDs such as "ClOrdID", "CrossID", "ListID" and "ExecID".

This method will reset the capacity of those hash tables. Application can use this method to fine tune the performance by reducing or even eliminating the hash table resize, which will result in creating a new bucket list and copying the existing items over. It is especially useful in applications that require low latency in order handling, such as high frequency trading.

Parameters:
nRegularOrder - capacity of regular orders
nCrossOrder - capacity of cross orders
nListOrder - capacity of list orders
nExecution - capacity of executions