public class QuoteResponder extends FXResponder<RFSTrade>
Base class for sending Quotes.
Constructor and Description |
---|
QuoteResponder(RFSTrade trade)
Constructs a Responder that can respond from states that send
quotes, for the RFS Trade Model.
|
Modifier and Type | Method and Description |
---|---|
void |
sendPriceUpdate(FXQuote quote)
Sends a mid-stream RFS quote to the client.
|
void |
sendPriceUpdate(FXQuote quote,
int timeout)
Sends the first RFS quote in the stream to the client with the
specified timeout for the stream, specified in seconds.
|
void |
sendPriceUpdate(RFSPriceUpdateEvent quoteEvent)
Sends an RFS quote to the client.
|
sendError, sendReject
public QuoteResponder(RFSTrade trade)
trade
- The Trade this responder will send messages for.public void sendPriceUpdate(FXQuote quote) throws com.caplin.trading.TradeException
Sends a mid-stream RFS quote to the client.
This should only be used for quotes sent after the first quote. If
this is the first quote in the stream, use sendPriceUpdate(FXQuote, int)
instead of this method.
quote
- The quote to send.com.caplin.trading.TradeException
- If there was a problem sending the eventpublic void sendPriceUpdate(FXQuote quote, int timeout) throws com.caplin.trading.TradeException
Sends the first RFS quote in the stream to the client with the specified timeout for the stream, specified in seconds.
This method should only be used to send the first quote in the stream. After
the first quote has been sent, use the sendPriceUpdate(FXQuote)
method
to send subsequent quotes, rather than calling this one again.
The client will automatically count down, so it's not necessary to send
timeout updates with every quote. Use
sendPriceUpdate(FXQuote)
for subsequent
quotes.
Example:
FwdQuote quote = new FwdQuote( new BidRate("id-1234", "1.12", "1.1234", "-1.2"), new AskRate("id-1234", "1.13", "1.1334", "-1.1")); responder.sendQuote(quote, 30);
Note that this is equivalent to:
responder.sendQuote(new RFSQuoteEvent(quote, 30));
quote
- The quote to send.timeout
- The time that the quote is valid for.com.caplin.trading.TradeException
- If there was a problem sending the eventpublic void sendPriceUpdate(RFSPriceUpdateEvent quoteEvent) throws com.caplin.trading.TradeException
Sends an RFS quote to the client.
You can use this method if you have created
an instance of RFSPriceUpdateEvent
yourself, rather than calling the convenience
methods sendPriceUpdate(FXQuote)
or sendPriceUpdate(FXQuote, int)
, which
create an instance of RFSPriceUpdateEvent
for you.
quoteEvent
- The quote to send.com.caplin.trading.TradeException
- If there was a problem sending the eventCopyright © 2015 Caplin Systems.