public class RFSTrade extends FXExecution<FXExecutionTradeLeg>
An RFSTrade is a domain object that represents a Request for Stream trade. These trades are generally executed from a ticket.
You do not need to construct instances of this class yourself. Instances of
this class are created by the FX Integration API in response to RFS trade requests
from the client, and passed to your implementation of RFSTradeListenerFactory.createRFSTradeListener(RFSTrade)
.
trade
Modifier and Type | Method and Description |
---|---|
ClientCloseSentResponder |
getClientCloseSentResponder()
Returns the responder used for sending events from the ClientCloseSent state.
|
ExecutableResponder |
getExecutableResponder()
Returns the responder used for sending events from the Executable state.
|
ExecutedResponder |
getExecutedResponder()
Returns the responder used for sending events from the Submitted state.
|
ExecuteSentResponder |
getExecuteSentResponder()
Returns the responder used for sending events from the ExecuteSent state.
|
PickedUpResponder |
getPickedUpResponder()
Returns the responder used for sending events from the PickedUp state.
|
QueuedResponder |
getQueuedResponder()
Returns the responder used for sending events from the Queued state.
|
SubmittedResponder |
getSubmittedResponder()
Returns the responder used for sending events from the Submitted state.
|
FXTradingProtocol |
getTradingProtocol()
Returns the
FXTradingProtocol that was used to enter this trade. |
TradingSubProtocol |
getTradingSubProtocol()
Returns the
TradingSubProtocol that was used to enter this trade. |
getAccount, getBaseCurrency, getCaption, getCurrencyPair, getDealtCurrency, getFarLeg, getNearLeg, getSwapType, getTermCurrency, getTradingType, toString
createEvent, getCurrentState, getField, getRequestID, getTradeChannelSubject, getUsername, sendEvent
public SubmittedResponder getSubmittedResponder()
Returns the responder used for sending events from the Submitted state.
This responder is the first one you should use after you receive the the RFSTradeListener.onSubmit(com.caplin.motif.fx.trading.rfs.event.RFSSubmitEvent)
callback, and you should use it to send an acknowledgement that you have received the trade request by calling SubmittedResponder.sendSubmitAck(com.caplin.motif.fx.trading.rfs.event.RFSSubmitAckEvent)
.
This is typically done immediately on receiving the event, before submitting anything to the trading system.
public ClientCloseSentResponder getClientCloseSentResponder()
Returns the responder used for sending events from the ClientCloseSent state.
If a client attempts to close a trade, probably from the Queued state, the current state will be ClientCloseSent. Once the trade cancelation request has been confirmed or rejected, this responder should be used to represent those transitions.
public ExecutedResponder getExecutedResponder()
Returns the responder used for sending events from the Submitted state.
In the Submitted state, the client's request to execute a quote has been submitted to the trading system. When the trading system confirms or rejects the client's attempt to trade, you should use this responder to send the appropriate event.
public ExecuteSentResponder getExecuteSentResponder()
Returns the responder used for sending events from the ExecuteSent state.
The client transitions the trade into the ExecuteSent state by sending a
Submit event informing you that the client wants to execute one of the
quotes from the stream. You will receive this event as a callback to your RFSTradeListener.onExecute(com.caplin.motif.fx.trading.rfs.event.RFSExecuteEvent)
method.
You should respond to that callback by calling this method to retrieve the ExecuteSentResponder
and then send an acknowledgement message by calling ExecuteSentResponder.sendExecuteAck(com.caplin.motif.fx.trading.rfs.event.RFSExecuteAckEvent)
.
public ExecutableResponder getExecutableResponder()
Returns the responder used for sending events from the Executable state.
The Executable state is when the client is receiving a stream of quotes. Many
transitions can happen from here. The server can send one or more quotes in the stream using
one of the QuoteResponder.sendPriceUpdate(com.caplin.motif.fx.rates.FXQuote)
methods.
The server can also terminate the stream or return the client to the PickedUp state
by calling ExecutableResponder.sendWithdraw(com.caplin.motif.fx.trading.rfs.event.RFSWithdrawEvent)
.
The client can also transition the trade from this state by sending a message informing
the server that they want to execute one of the streaming quotes. If this happens, you will
receive a callback on your RFSTradeListener.onExecute(com.caplin.motif.fx.trading.rfs.event.RFSExecuteEvent)
method.
public PickedUpResponder getPickedUpResponder()
Returns the responder used for sending events from the PickedUp state.
Once the trader who picked up the request sends the first quote in the RFS stream,
this responder should be used to transition the trade into the Executable state
by calling QuoteResponder.sendPriceUpdate(com.caplin.motif.fx.rates.FXQuote, int)
.
public QueuedResponder getQueuedResponder()
Returns the responder used for sending events from the Queued state.
When the backend system auto trader or a manual dealer picks up the trade,
this responder should be used to transition to the PickedUp state by calling
QueuedResponder.sendPickUp(com.caplin.motif.fx.trading.rfs.event.RFSPickUpEvent)
.
public FXTradingProtocol getTradingProtocol()
FXTrade
FXTradingProtocol
that was used to enter this trade.getTradingProtocol
in class FXTrade
FXTradingProtocol
used to enter this trade.public TradingSubProtocol getTradingSubProtocol()
FXTrade
TradingSubProtocol
that was used to enter this trade.
This defaults to TradingSubProtocol.NONE
if no protocol was provided.getTradingSubProtocol
in class FXTrade
TradingSubProtocol
that was use to enter this trade.Copyright © 2015 Caplin Systems.