Class RFSLifetimeEventHandler<H extends TradeTypeHandler>
- java.lang.Object
-
- com.caplin.motif.fx.ret.fxtrading.submission.FXTradeLifetimeEventHandler<com.caplin.generated.motif.fx.trading.rfs.RFSTrade>
-
- com.caplin.motif.fx.ret.fxtrading.submission.rfs.AbstractRFSLifetimeEventHandler
-
- com.caplin.motif.fx.ret.fxtrading.submission.rfs.RFSLifetimeEventHandler<H>
-
- Type Parameters:
H
- A Handler
- All Implemented Interfaces:
com.caplin.generated.motif.fx.trading.rfs.RFSTradeListener
,com.caplin.motif.datasource.CloseableTradeListener
,ConversionRateListener
,com.caplin.ret.trapi.connection.pool.ConnectionPoolListener<com.caplin.ret.trapi.connection.MarketOrderConnection>
,com.caplin.ret.trapi.fx.execution.MarketOrderListener
,com.caplin.trading.TradeListener
public class RFSLifetimeEventHandler<H extends TradeTypeHandler> extends AbstractRFSLifetimeEventHandler implements com.caplin.generated.motif.fx.trading.rfs.RFSTradeListener
Receives events throughout the lifetime of an RFS trade.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.caplin.motif.fx.ret.fxtrading.submission.rfs.AbstractRFSLifetimeEventHandler
AbstractRFSLifetimeEventHandler.TradeState
-
-
Constructor Summary
Constructors Constructor Description RFSLifetimeEventHandler(FxTradingAdapterInitialiser adapterInitialiser, UserTradeInfo userTradeInfo, H tradeHandler, AbstractBlotterDataProvider<com.caplin.generated.motif.fx.trading.rfs.RFSTrade> blotterProvider, ExecutionFactory executionFactory, ConversionRateCurrencyPairProvider conversionRateCurrencyPairProvider, CrossCurrencyPairProvider crossCurrencyPairProvider, com.caplin.ret.trapi.concurrent.executor.SharedExecutorService<java.util.concurrent.ExecutorService> serialExecutor, RFSTradePropertiesFactory rfsTradePropertiesFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connectionRegistrationFailed(java.lang.String reason)
com.caplin.ret.trapi.fx.execution.TradeAcceptanceBuilder
createFxTradeAcceptBuilder()
com.caplin.ret.trapi.fx.execution.TradeAcceptanceBuilder
createFxTradeAcceptBuilder(int priceVersion)
com.caplin.motif.datasource.Message
getQuote(com.caplin.ret.trapi.fx.execution.QuoteEvent rfsQuote)
com.caplin.ret.trapi.fx.execution.MarketOrder
getTrapiTrade()
boolean
isQuoteValid(RFSQuote currentQuote, com.caplin.generated.motif.fx.trading.rfs.events.client.ExecuteTradeEvent event)
boolean
isSwap()
void
onClientClose(com.caplin.generated.motif.fx.trading.rfs.events.client.ClientCloseTradeEvent clientCloseTradeEvent)
void
onDealHeld(com.caplin.ret.trapi.fx.execution.TradeErrorEvent event)
void
onDealLoggedError(com.caplin.ret.trapi.fx.execution.TradeErrorEvent event)
void
onDealPickedUp(com.caplin.ret.trapi.fx.execution.TradeEvent event)
void
onDealSubmitError(com.caplin.ret.trapi.fx.execution.TradeErrorEvent event)
void
onExecute(com.caplin.generated.motif.fx.trading.rfs.events.client.ExecuteTradeEvent event)
void
onQuoteExpired(com.caplin.ret.trapi.fx.execution.TradeEvent event)
void
onQuoteReceived(com.caplin.ret.trapi.fx.execution.QuoteEvent quoteEvent)
void
onQuoteWithdrawn(com.caplin.ret.trapi.fx.execution.TradeEvent event)
void
onSubmit(com.caplin.generated.motif.fx.trading.rfs.events.client.SubmitTradeEvent submitEvent)
void
onTradeClosed()
void
receiveEvent(com.caplin.trading.TradeEvent event)
void
receiveInvalidFieldsEvent(com.caplin.trading.InvalidFieldsEvent event)
void
receiveInvalidTransitionEvent(com.caplin.trading.InvalidTransitionEvent event)
com.caplin.ret.trapi.fx.execution.MarketOrder
setUpTrade(com.caplin.ret.trapi.fx.execution.TradingService tradingService, com.caplin.ret.trapi.fx.execution.AccountService accountService)
-
Methods inherited from class com.caplin.motif.fx.ret.fxtrading.submission.rfs.AbstractRFSLifetimeEventHandler
connectionAvailable, onConversionRateFailure, onConversionRateUpdate, onDealSubmitted, onQuoteDenied, onQuoteTimerUpdate
-
Methods inherited from class com.caplin.motif.fx.ret.fxtrading.submission.FXTradeLifetimeEventHandler
close, onDealLogged, tradeClosed
-
-
-
-
Constructor Detail
-
RFSLifetimeEventHandler
public RFSLifetimeEventHandler(FxTradingAdapterInitialiser adapterInitialiser, UserTradeInfo userTradeInfo, H tradeHandler, AbstractBlotterDataProvider<com.caplin.generated.motif.fx.trading.rfs.RFSTrade> blotterProvider, ExecutionFactory executionFactory, ConversionRateCurrencyPairProvider conversionRateCurrencyPairProvider, CrossCurrencyPairProvider crossCurrencyPairProvider, com.caplin.ret.trapi.concurrent.executor.SharedExecutorService<java.util.concurrent.ExecutorService> serialExecutor, RFSTradePropertiesFactory rfsTradePropertiesFactory)
-
-
Method Detail
-
getTrapiTrade
public com.caplin.ret.trapi.fx.execution.MarketOrder getTrapiTrade()
- Specified by:
getTrapiTrade
in classFXTradeLifetimeEventHandler<com.caplin.generated.motif.fx.trading.rfs.RFSTrade>
-
isQuoteValid
public boolean isQuoteValid(RFSQuote currentQuote, com.caplin.generated.motif.fx.trading.rfs.events.client.ExecuteTradeEvent event)
-
onDealPickedUp
public void onDealPickedUp(com.caplin.ret.trapi.fx.execution.TradeEvent event)
- Specified by:
onDealPickedUp
in interfacecom.caplin.ret.trapi.fx.execution.MarketOrderListener
-
onDealHeld
public void onDealHeld(com.caplin.ret.trapi.fx.execution.TradeErrorEvent event)
- Specified by:
onDealHeld
in interfacecom.caplin.ret.trapi.fx.execution.MarketOrderListener
-
onQuoteReceived
public void onQuoteReceived(com.caplin.ret.trapi.fx.execution.QuoteEvent quoteEvent)
- Specified by:
onQuoteReceived
in interfacecom.caplin.ret.trapi.fx.execution.MarketOrderListener
-
onQuoteWithdrawn
public void onQuoteWithdrawn(com.caplin.ret.trapi.fx.execution.TradeEvent event)
- Specified by:
onQuoteWithdrawn
in interfacecom.caplin.ret.trapi.fx.execution.MarketOrderListener
-
onQuoteExpired
public void onQuoteExpired(com.caplin.ret.trapi.fx.execution.TradeEvent event)
- Specified by:
onQuoteExpired
in interfacecom.caplin.ret.trapi.fx.execution.MarketOrderListener
-
onDealSubmitError
public void onDealSubmitError(com.caplin.ret.trapi.fx.execution.TradeErrorEvent event)
- Specified by:
onDealSubmitError
in interfacecom.caplin.ret.trapi.fx.execution.MarketOrderListener
-
onDealLoggedError
public void onDealLoggedError(com.caplin.ret.trapi.fx.execution.TradeErrorEvent event)
- Specified by:
onDealLoggedError
in interfacecom.caplin.ret.trapi.fx.execution.MarketOrderListener
-
connectionRegistrationFailed
public void connectionRegistrationFailed(java.lang.String reason)
- Specified by:
connectionRegistrationFailed
in interfacecom.caplin.ret.trapi.connection.pool.ConnectionPoolListener<H extends TradeTypeHandler>
-
createFxTradeAcceptBuilder
public com.caplin.ret.trapi.fx.execution.TradeAcceptanceBuilder createFxTradeAcceptBuilder(int priceVersion)
-
onExecute
public void onExecute(com.caplin.generated.motif.fx.trading.rfs.events.client.ExecuteTradeEvent event)
- Specified by:
onExecute
in interfacecom.caplin.generated.motif.fx.trading.rfs.RFSTradeListener
-
onClientClose
public void onClientClose(com.caplin.generated.motif.fx.trading.rfs.events.client.ClientCloseTradeEvent clientCloseTradeEvent)
- Specified by:
onClientClose
in interfacecom.caplin.generated.motif.fx.trading.rfs.RFSTradeListener
-
onSubmit
public void onSubmit(com.caplin.generated.motif.fx.trading.rfs.events.client.SubmitTradeEvent submitEvent)
- Specified by:
onSubmit
in interfacecom.caplin.generated.motif.fx.trading.rfs.RFSTradeListener
-
onTradeClosed
public void onTradeClosed()
- Specified by:
onTradeClosed
in interfacecom.caplin.generated.motif.fx.trading.rfs.RFSTradeListener
-
receiveEvent
public void receiveEvent(com.caplin.trading.TradeEvent event) throws com.caplin.trading.TradeException
- Specified by:
receiveEvent
in interfacecom.caplin.trading.TradeListener
- Throws:
com.caplin.trading.TradeException
-
receiveInvalidTransitionEvent
public void receiveInvalidTransitionEvent(com.caplin.trading.InvalidTransitionEvent event)
- Specified by:
receiveInvalidTransitionEvent
in interfacecom.caplin.generated.motif.fx.trading.rfs.RFSTradeListener
- Specified by:
receiveInvalidTransitionEvent
in interfacecom.caplin.trading.TradeListener
-
receiveInvalidFieldsEvent
public void receiveInvalidFieldsEvent(com.caplin.trading.InvalidFieldsEvent event)
- Specified by:
receiveInvalidFieldsEvent
in interfacecom.caplin.generated.motif.fx.trading.rfs.RFSTradeListener
- Specified by:
receiveInvalidFieldsEvent
in interfacecom.caplin.trading.TradeListener
-
setUpTrade
public com.caplin.ret.trapi.fx.execution.MarketOrder setUpTrade(com.caplin.ret.trapi.fx.execution.TradingService tradingService, com.caplin.ret.trapi.fx.execution.AccountService accountService) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getQuote
public com.caplin.motif.datasource.Message getQuote(com.caplin.ret.trapi.fx.execution.QuoteEvent rfsQuote) throws QuoteCreationException
- Throws:
QuoteCreationException
-
createFxTradeAcceptBuilder
public com.caplin.ret.trapi.fx.execution.TradeAcceptanceBuilder createFxTradeAcceptBuilder()
-
isSwap
public boolean isSwap()
- Specified by:
isSwap
in classAbstractRFSLifetimeEventHandler
-
-