com.teraspaces.qwfix.ordermanager
Class FIXSessionOrderManager.DefaultAutoRejectHandler

java.lang.Object
  extended by com.teraspaces.qwfix.ordermanager.FIXSessionOrderManager.DefaultAutoRejectHandler
All Implemented Interfaces:
FIXOrderManagerAutoRejectHandler
Enclosing class:
FIXSessionOrderManager

public class FIXSessionOrderManager.DefaultAutoRejectHandler
extends Object
implements FIXOrderManagerAutoRejectHandler


Constructor Summary
FIXSessionOrderManager.DefaultAutoRejectHandler()
           
 
Method Summary
 void createAutoCancelReject(FIXMessageComponent cancelRequest, FIXMessage rejMessage)
          Called when an order modification request (cancel or reject) against an order is automatically rejected.
 void createAutoCancelReject(FIXRegularOrder order, FIXMessageComponent cancelRequest, FIXMessage cxlRejMessage)
          Called when an order modification request (cancel or reject) against an order is automatically rejected.
 void createAutoExecutionReject(FIXMessageComponent newOrder, FIXMessage rejMessage)
          Called when an order message is automatically rejected.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIXSessionOrderManager.DefaultAutoRejectHandler

public FIXSessionOrderManager.DefaultAutoRejectHandler()
Method Detail

createAutoCancelReject

public void createAutoCancelReject(FIXRegularOrder order,
                                   FIXMessageComponent cancelRequest,
                                   FIXMessage cxlRejMessage)
Description copied from interface: FIXOrderManagerAutoRejectHandler
Called when an order modification request (cancel or reject) against an order is automatically rejected.

The handler is called by run-time to post-process an automatically generated reject message. This module is responsible for generating "OrderID".

QWFIX provides a default implementation.

Specified by:
createAutoCancelReject in interface FIXOrderManagerAutoRejectHandler
Parameters:
order - the order
cancelRequest - the cancel request
cxlRejMessage - the "Cancel Reject" message

createAutoCancelReject

public void createAutoCancelReject(FIXMessageComponent cancelRequest,
                                   FIXMessage rejMessage)
Description copied from interface: FIXOrderManagerAutoRejectHandler
Called when an order modification request (cancel or reject) against an order is automatically rejected.

The handler is called by run-time to post-process an automatically generated reject message. This module is responsible for generating "OrderID".

QWFIX provides a default implementation.

Specified by:
createAutoCancelReject in interface FIXOrderManagerAutoRejectHandler
Parameters:
cancelRequest - the cancel request
rejMessage - the "Cancel Reject" message

createAutoExecutionReject

public void createAutoExecutionReject(FIXMessageComponent newOrder,
                                      FIXMessage rejMessage)
Description copied from interface: FIXOrderManagerAutoRejectHandler
Called when an order message is automatically rejected.

The QWFIX run-time already created the reject message and filled in most of fields. This module is usually responsible for generating IDs ("ExecID" and "OrderID") and filling in "0" values for "LastQty", "LastPx", "CumQty", "AvgPx" and "LeavesQty" tags.

QWFIX provides default implementation for this handler. In default handler, "ExecID" is generated by the following rule:

1. If order is not populated from a list or cross order, the ExecID will follow the format of "GlobalPersistenceID.MsgSeqNum". Both GlobalPersistenceID and MsgSeqNum are integers. In order to further reduce the length of the ID, we use FIXOrderManagerUtility.packNumber(int) to pack the number.

2. If order is populated from a cross or list order, index of the repeating instance should also be appended to ensure uniqueness. The format will be "GlobalPersistenceID.MsgSeqNum.Index".

The "OrderID" rule in default implementation is the same as the rule for "ClOrdID". Uniqueness is guaranteed.

Application developers can provide their own implementation to override the default handler.

Specified by:
createAutoExecutionReject in interface FIXOrderManagerAutoRejectHandler
Parameters:
newOrder - the new order
rejMessage - the "Execution Reject" message