com.teraspaces.qwfix.ordermanager
Interface FIXOrderManagerAutoRejectHandler

All Known Implementing Classes:
FIXSessionOrderManager.DefaultAutoRejectHandler

public interface FIXOrderManagerAutoRejectHandler

The Interface to handle automatic order reject or cancel reject in QWFIX Order Manager. Use FIXSessionOrderManager.setAutoRejectHandler(FIXOrderManagerAutoRejectHandler) to register your handler.


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.
 

Method Detail

createAutoCancelReject

void createAutoCancelReject(FIXRegularOrder order,
                            FIXMessageComponent cancelRequest,
                            FIXMessage cxlRejMessage)
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.

Parameters:
order - the order
cancelRequest - the cancel request
cxlRejMessage - the "Cancel Reject" message

createAutoCancelReject

void createAutoCancelReject(FIXMessageComponent cancelRequest,
                            FIXMessage rejMessage)
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.

Parameters:
cancelRequest - the cancel request
rejMessage - the "Cancel Reject" message

createAutoExecutionReject

void createAutoExecutionReject(FIXMessageComponent newOrder,
                               FIXMessage rejMessage)
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.

Parameters:
newOrder - the new order
rejMessage - the "Execution Reject" message