public class ValidateTrade extends UserTrade
A single ValidateTrade active in the system.
A Trade is initiated by a client and is tied to a TradeChannel
. The lifecycle of a Trade consists
of a number of messages, represented by TradeEvents, being sent between the client and the
Trading System in both directions. These messages cause the Trade to transition between a number
of predefined states.
Trades are comprised of one or more trade legs, which each leg representing the exchange of a financial instrument and the resultant cash flow. It is possible to add, remove and update trades from the client or from the TradingDataSource.
A Trade is uniquely identified in two ways: by RequestId set by the client and a TradeId set by the Trading System.
Constructor and Description |
---|
ValidateTrade(com.caplin.trading.Trade backingTrade,
ScheduledExecutorService executorService)
Constructor used by the generated code.
|
Modifier and Type | Method and Description |
---|---|
ClientCloseAckTradeEvent |
createClientCloseAckTradeEvent()
Create a
TradeEvent that can be used to trigger the trade to transition into the ClientCloseAck state. |
ErrorTradeEvent |
createErrorTradeEvent()
Create a
TradeEvent that can be used to trigger the trade to transition into the Error state. |
ValidationTradeEvent |
createValidationTradeEvent()
Create a
TradeEvent that can be used to trigger the trade to transition into the Validation state. |
void |
sendClientCloseAckEvent()
Send a
TradeEvent with no fields to trigger the trade to transition into the ClientCloseAck state. |
void |
sendClientCloseAckEvent(ClientCloseAckTradeEvent event)
Send a
TradeEvent to trigger the trade to transition into the ClientCloseAck state. |
void |
sendErrorEvent()
Send a
TradeEvent with no fields to trigger the trade to transition into the Error state. |
void |
sendErrorEvent(ErrorTradeEvent event)
Send a
TradeEvent to trigger the trade to transition into the Error state. |
void |
sendValidationEvent()
Send a
TradeEvent with no fields to trigger the trade to transition into the Validation state. |
void |
sendValidationEvent(ValidationTradeEvent event)
Send a
TradeEvent to trigger the trade to transition into the Validation state. |
getBackingTrade, getExecutorService, getRequestID, getUsername, toString
public ValidateTrade(com.caplin.trading.Trade backingTrade, ScheduledExecutorService executorService)
Constructor used by the generated code.
public ValidationTradeEvent createValidationTradeEvent()
Create a TradeEvent
that can be used to trigger the trade to transition into the Validation state.
public void sendValidationEvent(ValidationTradeEvent event)
Send a TradeEvent
to trigger the trade to transition into the Validation state.
event
- The event to send.public void sendValidationEvent()
Send a TradeEvent
with no fields to trigger the trade to transition into the Validation state.
public ErrorTradeEvent createErrorTradeEvent()
Create a TradeEvent
that can be used to trigger the trade to transition into the Error state.
public void sendErrorEvent(ErrorTradeEvent event)
Send a TradeEvent
to trigger the trade to transition into the Error state.
event
- The event to send.public void sendErrorEvent()
Send a TradeEvent
with no fields to trigger the trade to transition into the Error state.
public ClientCloseAckTradeEvent createClientCloseAckTradeEvent()
Create a TradeEvent
that can be used to trigger the trade to transition into the ClientCloseAck state.
public void sendClientCloseAckEvent(ClientCloseAckTradeEvent event)
Send a TradeEvent
to trigger the trade to transition into the ClientCloseAck state.
event
- The event to send.public void sendClientCloseAckEvent()
Send a TradeEvent
with no fields to trigger the trade to transition into the ClientCloseAck state.
Copyright © 2018 Caplin Systems.