Interface RFSCoreTrade
-
- All Known Implementing Classes:
AmendTrade
,RFSTrade
public interface RFSCoreTrade
A single RFSCoreTrade 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AcceptWarningAckTradeEvent
createAcceptWarningAckTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the AcceptWarningAck state.ClientCloseAckTradeEvent
createClientCloseAckTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the ClientCloseAck state.ErrorTradeEvent
createErrorTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the Error state.ExecuteAckTradeEvent
createExecuteAckTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the ExecuteAck state.ExpireTradeEvent
createExpireTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the Expire state.HoldTradeEvent
createHoldTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the Hold state.PickUpTradeEvent
createPickUpTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the PickUp state.PriceUpdateTradeEvent
createPriceUpdateTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the PriceUpdate state.PriceUpdateTradeEvent
createPriceUpdateTradeEvent(Message message)
Create aTradeEvent
that can be used to trigger the trade to transition into the PriceUpdate state.RejectTradeEvent
createRejectTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the Reject state.SubmitAckTradeEvent
createSubmitAckTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the SubmitAck state.TradeConfirmationTradeEvent
createTradeConfirmationTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the TradeConfirmation state.TradeConfirmationTradeEvent
createTradeConfirmationTradeEvent(Message message)
Create aTradeEvent
that can be used to trigger the trade to transition into the TradeConfirmation state.WarningTradeEvent
createWarningTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the Warning state.WithdrawTradeEvent
createWithdrawTradeEvent()
Create aTradeEvent
that can be used to trigger the trade to transition into the Withdraw state.com.caplin.trading.Trade
getBackingTrade()
String
getRequestID()
Returns the ID generated from the client.String
getUsername()
Returns the username of the logged in user that created this trade.void
sendAcceptWarningAckEvent()
Send aTradeEvent
with no fields to trigger the trade to transition into the AcceptWarningAck state.void
sendAcceptWarningAckEvent(AcceptWarningAckTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the AcceptWarningAck state.void
sendClientCloseAckEvent()
Send aTradeEvent
with no fields to trigger the trade to transition into the ClientCloseAck state.void
sendClientCloseAckEvent(ClientCloseAckTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the ClientCloseAck state.void
sendErrorEvent(ErrorTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the Error state.void
sendExecuteAckEvent()
Send aTradeEvent
with no fields to trigger the trade to transition into the ExecuteAck state.void
sendExecuteAckEvent(ExecuteAckTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the ExecuteAck state.void
sendExpireEvent()
Send aTradeEvent
with no fields to trigger the trade to transition into the Expire state.void
sendExpireEvent(ExpireTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the Expire state.void
sendHoldEvent()
Send aTradeEvent
with no fields to trigger the trade to transition into the Hold state.void
sendHoldEvent(HoldTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the Hold state.void
sendPickUpEvent()
Send aTradeEvent
with no fields to trigger the trade to transition into the PickUp state.void
sendPickUpEvent(PickUpTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the PickUp state.void
sendPriceUpdateEvent(PriceUpdateTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the PriceUpdate state.void
sendRejectEvent(RejectTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the Reject state.void
sendSubmitAckEvent()
Send aTradeEvent
with no fields to trigger the trade to transition into the SubmitAck state.void
sendSubmitAckEvent(SubmitAckTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the SubmitAck state.void
sendTradeConfirmationEvent(TradeConfirmationTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the TradeConfirmation state.void
sendWarningEvent()
Send aTradeEvent
with no fields to trigger the trade to transition into the Warning state.void
sendWarningEvent(WarningTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the Warning state.void
sendWithdrawEvent()
Send aTradeEvent
with no fields to trigger the trade to transition into the Withdraw state.void
sendWithdrawEvent(WithdrawTradeEvent event)
Send aTradeEvent
to trigger the trade to transition into the Withdraw state.
-
-
-
Method Detail
-
createErrorTradeEvent
ErrorTradeEvent createErrorTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the Error state.- Returns:
- A new instance of ErrorTradeEvent.
-
sendErrorEvent
void sendErrorEvent(ErrorTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the Error state.- Parameters:
event
- The event to send.
-
createSubmitAckTradeEvent
SubmitAckTradeEvent createSubmitAckTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the SubmitAck state.- Returns:
- A new instance of SubmitAckTradeEvent.
-
sendSubmitAckEvent
void sendSubmitAckEvent(SubmitAckTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the SubmitAck state.- Parameters:
event
- The event to send.
-
sendSubmitAckEvent
void sendSubmitAckEvent()
Send a
TradeEvent
with no fields to trigger the trade to transition into the SubmitAck state.
-
createRejectTradeEvent
RejectTradeEvent createRejectTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the Reject state.- Returns:
- A new instance of RejectTradeEvent.
-
sendRejectEvent
void sendRejectEvent(RejectTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the Reject state.- Parameters:
event
- The event to send.
-
createClientCloseAckTradeEvent
ClientCloseAckTradeEvent createClientCloseAckTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the ClientCloseAck state.- Returns:
- A new instance of ClientCloseAckTradeEvent.
-
sendClientCloseAckEvent
void sendClientCloseAckEvent(ClientCloseAckTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the ClientCloseAck state.- Parameters:
event
- The event to send.
-
sendClientCloseAckEvent
void sendClientCloseAckEvent()
Send a
TradeEvent
with no fields to trigger the trade to transition into the ClientCloseAck state.
-
createWithdrawTradeEvent
WithdrawTradeEvent createWithdrawTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the Withdraw state.- Returns:
- A new instance of WithdrawTradeEvent.
-
sendWithdrawEvent
void sendWithdrawEvent(WithdrawTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the Withdraw state.- Parameters:
event
- The event to send.
-
sendWithdrawEvent
void sendWithdrawEvent()
Send a
TradeEvent
with no fields to trigger the trade to transition into the Withdraw state.
-
createExecuteAckTradeEvent
ExecuteAckTradeEvent createExecuteAckTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the ExecuteAck state.- Returns:
- A new instance of ExecuteAckTradeEvent.
-
sendExecuteAckEvent
void sendExecuteAckEvent(ExecuteAckTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the ExecuteAck state.- Parameters:
event
- The event to send.
-
sendExecuteAckEvent
void sendExecuteAckEvent()
Send a
TradeEvent
with no fields to trigger the trade to transition into the ExecuteAck state.
-
createPriceUpdateTradeEvent
PriceUpdateTradeEvent createPriceUpdateTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the PriceUpdate state.- Returns:
- A new instance of PriceUpdateTradeEvent.
-
sendPriceUpdateEvent
void sendPriceUpdateEvent(PriceUpdateTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the PriceUpdate state.- Parameters:
event
- The event to send.
-
createPriceUpdateTradeEvent
PriceUpdateTradeEvent createPriceUpdateTradeEvent(Message message)
Create a
TradeEvent
that can be used to trigger the trade to transition into the PriceUpdate state.- Returns:
- A new instance of PriceUpdateTradeEvent.
-
createWarningTradeEvent
WarningTradeEvent createWarningTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the Warning state.- Returns:
- A new instance of WarningTradeEvent.
-
sendWarningEvent
void sendWarningEvent(WarningTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the Warning state.- Parameters:
event
- The event to send.
-
sendWarningEvent
void sendWarningEvent()
Send a
TradeEvent
with no fields to trigger the trade to transition into the Warning state.
-
createHoldTradeEvent
HoldTradeEvent createHoldTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the Hold state.- Returns:
- A new instance of HoldTradeEvent.
-
sendHoldEvent
void sendHoldEvent(HoldTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the Hold state.- Parameters:
event
- The event to send.
-
sendHoldEvent
void sendHoldEvent()
Send a
TradeEvent
with no fields to trigger the trade to transition into the Hold state.
-
createExpireTradeEvent
ExpireTradeEvent createExpireTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the Expire state.- Returns:
- A new instance of ExpireTradeEvent.
-
sendExpireEvent
void sendExpireEvent(ExpireTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the Expire state.- Parameters:
event
- The event to send.
-
sendExpireEvent
void sendExpireEvent()
Send a
TradeEvent
with no fields to trigger the trade to transition into the Expire state.
-
createPickUpTradeEvent
PickUpTradeEvent createPickUpTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the PickUp state.- Returns:
- A new instance of PickUpTradeEvent.
-
sendPickUpEvent
void sendPickUpEvent(PickUpTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the PickUp state.- Parameters:
event
- The event to send.
-
sendPickUpEvent
void sendPickUpEvent()
Send a
TradeEvent
with no fields to trigger the trade to transition into the PickUp state.
-
createTradeConfirmationTradeEvent
TradeConfirmationTradeEvent createTradeConfirmationTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the TradeConfirmation state.- Returns:
- A new instance of TradeConfirmationTradeEvent.
-
sendTradeConfirmationEvent
void sendTradeConfirmationEvent(TradeConfirmationTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the TradeConfirmation state.- Parameters:
event
- The event to send.
-
createTradeConfirmationTradeEvent
TradeConfirmationTradeEvent createTradeConfirmationTradeEvent(Message message)
Create a
TradeEvent
that can be used to trigger the trade to transition into the TradeConfirmation state.- Returns:
- A new instance of TradeConfirmationTradeEvent.
-
createAcceptWarningAckTradeEvent
AcceptWarningAckTradeEvent createAcceptWarningAckTradeEvent()
Create a
TradeEvent
that can be used to trigger the trade to transition into the AcceptWarningAck state.- Returns:
- A new instance of AcceptWarningAckTradeEvent.
-
sendAcceptWarningAckEvent
void sendAcceptWarningAckEvent(AcceptWarningAckTradeEvent event)
Send a
TradeEvent
to trigger the trade to transition into the AcceptWarningAck state.- Parameters:
event
- The event to send.
-
sendAcceptWarningAckEvent
void sendAcceptWarningAckEvent()
Send a
TradeEvent
with no fields to trigger the trade to transition into the AcceptWarningAck state.
-
getRequestID
String getRequestID()
Returns the ID generated from the client. The combination of user and trade is unique.- Returns:
- the request ID.
-
getUsername
String getUsername()
Returns the username of the logged in user that created this trade.- Returns:
- the username of the logged in user.
-
getBackingTrade
com.caplin.trading.Trade getBackingTrade()
-
-