com.teraspaces.qwfix.ordermanager
Class FIXOrder

java.lang.Object
  extended by com.teraspaces.qwfix.ordermanager.FIXOrder
Direct Known Subclasses:
FIXCrossOrder, FIXListOrder, FIXRegularOrder

public abstract class FIXOrder
extends Object

Provides access to the information needed to define an order in FIX protocol.


Method Summary
 FIXOrderType getFIXOrderType()
          Gets the type of the order.
 int getIndex()
          Gets the index of current order in corresponding FIXSessionOrderList.
abstract  FIXMessage getMessage(int index)
          Gets the FIXMessage related to this order by specified index.
abstract  int getMessageCount()
          Gets the number of messages related to the current order.
abstract  FIXMessage getPendingRequestMessage(int index)
          Gets the pending request FIX message by index.
abstract  int getPendingRequestsCount()
          Gets count of pending request FIX messages.
 FIXSessionOrderList getSessionOrderList()
          Gets the session order list.
 FIXSessionOrderManager getSessionOrderManager()
          Gets the session order manager.
 FIXSessionPersistence getSessionPersistence()
          Gets the session persistence.
 Object getTag()
          Gets application defined information associated this order.
abstract  boolean isActive()
          Gets a value indicating whether the current order is active.
abstract  boolean isPendingCancel()
          Gets a value indicating whether the current order is pending cancel.
abstract  boolean isPendingReplace()
          Gets a value indicating whether the current order is pending replace
 boolean isRestatedGT()
          Gets a value indicating whether the current order represents a restated GT order.
 void setTag(Object tag)
          Sets application defined information associated this order.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIndex

public int getIndex()
Gets the index of current order in corresponding FIXSessionOrderList.

Returns:
the index
See Also:
getSessionOrderList()

getFIXOrderType

public FIXOrderType getFIXOrderType()
Gets the type of the order.

Returns:
the type

getSessionOrderManager

public FIXSessionOrderManager getSessionOrderManager()
Gets the session order manager.

Returns:
the session order manager

getSessionPersistence

public FIXSessionPersistence getSessionPersistence()
Gets the session persistence.

Returns:
the session persistence

getSessionOrderList

public FIXSessionOrderList getSessionOrderList()
Gets the session order list.

Returns:
the session order list
See Also:
getIndex()

getTag

public Object getTag()
Gets application defined information associated this order.

Tag could be any object. It's up to application developers how to use it.

Returns:
the tag
See Also:
setTag(Object)

setTag

public void setTag(Object tag)
Sets application defined information associated this order.

Tag could be any object. It's up to application developers how to use it.

Parameters:
tag - the new tag
See Also:
getTag()

isActive

public abstract boolean isActive()
Gets a value indicating whether the current order is active.

A FIXRegularOrder is considered active if FIXRegularOrder.getOrdStatus() represents an active state.

A FIXCrossOrder is considered active if any side of the order is active.

A FIXListOrder is considered active if any individual order is active.

Returns:
true if the current order is active; otherwise, false

isPendingCancel

public abstract boolean isPendingCancel()
Gets a value indicating whether the current order is pending cancel.

isPendingCancel() returns true if there is any cancel request in the pending order list.

An order may have more than 1 pending orders. It's up to the high level business logic to decide whether the pending orders should be processed in time order or reverse time order.

Returns:
true if the current order is pending cancel; otherwise, false
See Also:
isPendingReplace(), getPendingRequestsCount(), getPendingRequestMessage(int)

isPendingReplace

public abstract boolean isPendingReplace()
Gets a value indicating whether the current order is pending replace

isPendingReplace() returns true if there is any replace request in the pending order list.

An order may have more than 1 pending orders. It's up to the high level business logic to decide whether the pending orders should be processed in time order or reverse time order.

Returns:
true if the current order is pending replace; otherwise, false
See Also:
isPendingCancel(), getPendingRequestsCount(), getPendingRequestMessage(int)

isRestatedGT

public boolean isRestatedGT()
Gets a value indicating whether the current order represents a restated GT order.

Usually a restated GT order starts with a Execution Report FIX message with Restated order status sent from sell side before market opens.

The first day GT order is not considered a restated GT order. Restated GT order requires special treatment on both buy side and sell side.

Returns:
true, if the current order is a restated GT order
See Also:
FIXSessionOrderManagerGTOrderHandler, FIXSessionOrderManager.setGTOrderHandler(FIXSessionOrderManagerGTOrderHandler)

getMessage

public abstract FIXMessage getMessage(int index)
Gets the FIXMessage related to this order by specified index.

Parameters:
index - the index
Returns:
the message
See Also:
getMessageCount()

getMessageCount

public abstract int getMessageCount()
Gets the number of messages related to the current order.

Returns:
the message count
See Also:
getMessage(int)

getPendingRequestsCount

public abstract int getPendingRequestsCount()
Gets count of pending request FIX messages.

Returns:
the pending requests count
See Also:
getPendingRequestMessage(int)

getPendingRequestMessage

public abstract FIXMessage getPendingRequestMessage(int index)
Gets the pending request FIX message by index.

GetPendingRequestMessage does not acquire FIXOrderManager.syncRoot lock.

If the pending order is a cross order cancel or cross order replace request, the return message may contain more one side of the cross order. To get the exact side related to the current order, use FIXRegularOrder.getPendingRequest(int).

Parameters:
index - the index
Returns:
an instance of FIXMessage representing the pending request
See Also:
getPendingRequestsCount()