public class EditOrderListener extends java.lang.Object implements com.caplin.motif.fx.trading.orders.edit.EditStrategyListener, com.caplin.ret.trapi.connection.pool.ConnectionPoolListener<com.caplin.ret.trapi.connection.OrderTradingConnection>, com.caplin.ret.trapi.fx.order.transaction.strategy.modify.ModifyStrategyListener, StrategyDetailsListener
1 | onEditOpen | Entry point. Client edit request received. Subscribes to strategy details. |
2 | onUpdate | Initial strategy received. Acquires local lock. Requests connection. |
3 | onConnectionAvailable | Connection received. Requests RET strategy lock. |
4 | onStrategyLock | RET strategy lock received. Ready for client save requests (5) or client close (8). |
5 | onSave | Client save request received. Requests RET order modify. |
6 | onUpdate | Client save request successful. |
7 | onOrderModify | Indicates that the transaction is ready for the next modify or unlock.
If ContinueEditing field was empty or false : Unsubscribes from strategy
details and initiates unlock immediately. Next callback will be (9).
If ContinueEditing field was true : Ready for client save requests (5)
or client close (8). |
8 | onClientClose | Client close request received. Unsubscribes from strategy details. Requests RET strategy unlock. |
9 | onStrategyUnlock | Terminal state. RET strategy unlock received. Releases connection. Releases local lock. |
Constructor and Description |
---|
EditOrderListener(OrderAdapterInitialiser adapterServices,
com.caplin.motif.fx.trading.orders.edit.EditStrategyRequest editStrategyRequest,
java.util.concurrent.ExecutorService singleThreadedExecutor) |
Modifier and Type | Method and Description |
---|---|
void |
connectionAvailable(com.caplin.ret.trapi.connection.OrderTradingConnection connection)
Handles notification from Trapi that a connection is free.
|
void |
connectionRegistrationFailed(java.lang.String reason) |
void |
onActivityTimeout() |
void |
onClientClose(com.caplin.motif.fx.trading.orders.edit.event.ClientCloseEvent event)
Handles client close state transition.
|
void |
onEditOpen(com.caplin.motif.fx.trading.orders.edit.event.EditOpenEvent event)
Handles the initial client request to edit an order.
|
void |
onError(java.lang.String error)
Signals an error on the subscription.
|
void |
onOrderModify(com.caplin.ret.trapi.fx.order.OrderModificationEvent event) |
void |
onOrderModifyFail(com.caplin.ret.trapi.fx.order.OrderErrorEvent errorEvent) |
void |
onSave(com.caplin.motif.fx.trading.orders.edit.event.SaveEvent saveEvent)
Handles client request to save an order.
|
void |
onSaveFailed(com.caplin.motif.fx.trading.orders.edit.event.FailureType failureType) |
void |
onStrategyLock(com.caplin.ret.trapi.fx.order.OrderEvent event) |
void |
onStrategyLockFail(com.caplin.ret.trapi.fx.order.OrderErrorEvent errorEvent) |
void |
onStrategyUnlock(com.caplin.ret.trapi.fx.order.OrderEvent event,
java.lang.String newLockOwner) |
void |
onStrategyUnlockFail(com.caplin.ret.trapi.fx.order.OrderErrorEvent errorEvent) |
void |
onTradeClosed() |
void |
onUpdate(com.caplin.motif.fx.trading.orders.details.Strategy updatedStrategy,
com.caplin.ret.trapi.fx.order.strategy.StrategyTree strategyTree)
Sends a strategy update to the subscription.
|
public EditOrderListener(OrderAdapterInitialiser adapterServices, com.caplin.motif.fx.trading.orders.edit.EditStrategyRequest editStrategyRequest, java.util.concurrent.ExecutorService singleThreadedExecutor)
public void onEditOpen(com.caplin.motif.fx.trading.orders.edit.event.EditOpenEvent event)
onEditOpen
in interface com.caplin.motif.fx.trading.orders.edit.EditStrategyListener
public void onClientClose(com.caplin.motif.fx.trading.orders.edit.event.ClientCloseEvent event)
onClientClose
in interface com.caplin.motif.fx.trading.orders.edit.EditStrategyListener
public void connectionAvailable(com.caplin.ret.trapi.connection.OrderTradingConnection connection)
connectionAvailable
in interface com.caplin.ret.trapi.connection.pool.ConnectionPoolListener<com.caplin.ret.trapi.connection.OrderTradingConnection>
public void connectionRegistrationFailed(java.lang.String reason)
connectionRegistrationFailed
in interface com.caplin.ret.trapi.connection.pool.ConnectionPoolListener<com.caplin.ret.trapi.connection.OrderTradingConnection>
public void onSave(com.caplin.motif.fx.trading.orders.edit.event.SaveEvent saveEvent)
onSave
in interface com.caplin.motif.fx.trading.orders.edit.EditStrategyListener
public void onSaveFailed(com.caplin.motif.fx.trading.orders.edit.event.FailureType failureType)
onSaveFailed
in interface com.caplin.motif.fx.trading.orders.edit.EditStrategyListener
public void onTradeClosed()
onTradeClosed
in interface com.caplin.motif.fx.CloseableTradeListener
public void onOrderModify(com.caplin.ret.trapi.fx.order.OrderModificationEvent event)
onOrderModify
in interface com.caplin.ret.trapi.fx.order.transaction.leg.modify.ModifyOrderListener
public void onOrderModifyFail(com.caplin.ret.trapi.fx.order.OrderErrorEvent errorEvent)
onOrderModifyFail
in interface com.caplin.ret.trapi.fx.order.transaction.leg.modify.ModifyOrderListener
public void onUpdate(com.caplin.motif.fx.trading.orders.details.Strategy updatedStrategy, com.caplin.ret.trapi.fx.order.strategy.StrategyTree strategyTree)
StrategyDetailsListener
onUpdate
in interface StrategyDetailsListener
updatedStrategy
- The updated Strategy
.strategyTree
- The latest StrategyTree
that was used to produce the Strategy
.public void onError(java.lang.String error)
StrategyDetailsListener
Signals an error on the subscription.
Errors do NOT signal that the subscription has ended. Subscribers should still remove their listeners.onError
in interface StrategyDetailsListener
error
- The reason for the error.public void onStrategyLock(com.caplin.ret.trapi.fx.order.OrderEvent event)
onStrategyLock
in interface com.caplin.ret.trapi.fx.order.transaction.strategy.lock.LockStrategyListener
public void onStrategyLockFail(com.caplin.ret.trapi.fx.order.OrderErrorEvent errorEvent)
onStrategyLockFail
in interface com.caplin.ret.trapi.fx.order.transaction.strategy.lock.LockStrategyListener
public void onStrategyUnlock(com.caplin.ret.trapi.fx.order.OrderEvent event, java.lang.String newLockOwner)
onStrategyUnlock
in interface com.caplin.ret.trapi.fx.order.transaction.strategy.unlock.UnlockStrategyListener
public void onStrategyUnlockFail(com.caplin.ret.trapi.fx.order.OrderErrorEvent errorEvent)
onStrategyUnlockFail
in interface com.caplin.ret.trapi.fx.order.transaction.strategy.unlock.UnlockStrategyListener
public void onActivityTimeout()
onActivityTimeout
in interface com.caplin.ret.trapi.fx.order.transaction.strategy.modify.ModifyStrategyListener
Copyright © 2016 Caplin Systems.