This package contains classes to facilitate in the restoration of
This will occur when the server sends a specific message to restore a particular
trade. There are two scenarios that can occur on the client side.
- The trade is known on the client (for example a trade object in an open ticket), so a new trade object won't be created.
- The trade is not known on the client, so a new trade object will be created to restore the trade.
Since the trade exists in the first scenario, any object that wishes to listen
for trade restoration events should add a listener directly to the Trade using
For the second scenario, listeners can be added to the
module:caplin/trading/service/TradeService#addTradeRestoredListener. Note that
module:caplin/trading/restoration/TradeRestoreEvent#getTrade method will return null
is fired in this case, since the trade object won't be created yet.
Restoration Event OrderWhen a trade is restored, there is an order in which components of the trade are restored.
Currently the Java Trading Data Source library can only send 1 leg addition at a time. Therefore when the trade is restored it will have at most 1 leg. If the trade already exists on the client and contains more than 1 leg before restoration, all legs except the restored leg will be removed. It is up to the implementors of the Trading Data Source library to add additional legs via another state change if they are required for the trade.