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