Class FxTradingConfigurationBuilder
java.lang.Object
com.caplin.motif.fx.ret.fxtrading.config.FxTradingConfigurationBuilder
This class produces a FxTradingConfiguration which can be used to instantiate an FxTradingAdapter.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionThis class produces a FxTradingConfiguration which can be used to instantiate aFxTradingAdapter.FxTradingConfigurationBuilder(ConfigurationLoader configurationLoader) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates an instance of FxTradingConfiguration which can be used to instantiate a FxTradingAdapter.setAccountManager(FxTradingAccountManager accountManager) Sets a customFxTradingAccountManagerto extend the FxTradingAdapter's default behaviour.Sets a customAdapterConfigurationListenerto load custom configurations.setBlockQuoteFactory(BlockQuoteFactory blockQuoteFactory) Sets a customBlockQuoteFactoryto replace the defaultDefaultBlockQuoteFactory.setBlockTradeCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.generated.motif.fx.trading.rfs.RFSTrade, BlockTradeProperties> blockTradeCustomFieldValuesFactory) Sets a customCustomFieldValuesFactoryused to create customCustomFieldValuesobjects for block trades.setBlockTradeListenerEventInfoFactory(BlockStateEventFactory blockTradeListenerEventInfoFactory) Sets a customBlockStateEventFactoryto extend the FxTradingAdapter's default behaviour for Block Trades.setBlotterItemFieldsUpdater(TradeBlotterItemFieldsUpdater fieldsUpdater) Sets a customTradeBlotterItemFieldsUpdaterto override the FxTradingAdapter's default BlotterItemFieldsUpdater.setConfigurationLoader(ConfigurationLoader configurationLoader) Sets a customConfigurationLoaderto replace the default.setCustomFieldValuesSerialiser(CustomFieldValuesSerialiser customFieldValuesSerialiser) Sets a customCustomFieldValuesSerialiserused to serialise/deserialiseCustomFieldValuesobjects for ESP trades.setDataSource(com.caplin.datasource.DataSource dataSource) Sets a customDataSourceto extend the FxTradingAdapter's default behaviour.setDataSourceProviderExtension(DataSourceProviderExtension dataSourceProviderExtension) Sets a customDataSourceProviderExtensionthat can be used to publish additional data using services fromDataSourceProviderExtension.Context.setESPCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.generated.motif.fx.trading.esp.ESPTrade, ESPTradeProperties> espCustomFieldValuesFactory) Sets a customCustomFieldValuesFactoryused to create customCustomFieldValuesobjects for ESP trades.setInstrumentProvider(InstrumentProvider instrumentProvider) Sets a customInstrumentProviderto replace the defaultFxCrossInstrumentProvider.setQuoteFactory(QuoteFactory quoteFactory) Sets a customQuoteFactoryto replace the defaultDefaultQuoteFactory.setRFSCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.generated.motif.fx.trading.rfs.RFSTrade, RFSTradeProperties> rfsCustomFieldValuesFactory) Sets a customCustomFieldValuesFactoryused to create customCustomFieldValuesobjects for RFS trades.setRFSStateEventFactory(RFSStateEventFactory RFSStateEventFactory) Sets a customRFSStateEventFactoryto extend the FxTradingAdapter's default behaviour for RFS Trades.setSalesQuoteFactory(SalesQuoteFactory salesQuoteFactory) Sets a customSalesQuoteFactoryto replace the defaultDefaultSalesQuoteFactory.setSalesSwapQuoteFactory(SalesSwapQuoteFactory salesSwapQuoteFactory) Sets a customSalesSwapQuoteFactoryto replace the defaultDefaultSalesSwapQuoteFactory.setSwapQuoteFactory(SwapQuoteFactory swapQuoteFactory) Sets a customSwapQuoteFactoryto replace the defaultDefaultSwapQuoteFactory.setTradingConnectionRouter(TradingConnectionRouter tradingConnectionRouter) Sets a customTradingConnectionRouter.setUserManager(UserManager userManager) Sets a customUserManagerto override the FxTradingAdapter's default UserManager.
-
Field Details
-
ADAPTER_NAME
- See Also:
-
-
Constructor Details
-
FxTradingConfigurationBuilder
This class produces a FxTradingConfiguration which can be used to instantiate aFxTradingAdapter.- Throws:
ConfigurationLoaderException
-
FxTradingConfigurationBuilder
-
-
Method Details
-
setBlotterItemFieldsUpdater
public FxTradingConfigurationBuilder setBlotterItemFieldsUpdater(TradeBlotterItemFieldsUpdater fieldsUpdater) Sets a customTradeBlotterItemFieldsUpdaterto override the FxTradingAdapter's default BlotterItemFieldsUpdater. The BlotterItemFieldsUpdater allows the user to receive fields to be sent for a blotter record. The custom BlotterItemFieldsUpdater can change, add, remove fields on the record.- Parameters:
fieldsUpdater- A customTradeBlotterItemFieldsUpdater- Returns:
- the FxTradingConfigurationBuilder
- See Also:
-
setDataSourceProviderExtension
public FxTradingConfigurationBuilder setDataSourceProviderExtension(@Nullable DataSourceProviderExtension dataSourceProviderExtension) Sets a customDataSourceProviderExtensionthat can be used to publish additional data using services fromDataSourceProviderExtension.Context.- Parameters:
dataSourceProviderExtension- an implementation ofDataSourceProviderExtension- Returns:
- the FxTradingConfigurationBuilder
- See Also:
-
setUserManager
Sets a customUserManagerto override the FxTradingAdapter's default UserManager.- Parameters:
userManager- a customUserManager- Returns:
- the FxTradingConfigurationBuilder
- See Also:
-
setAdapterConfigurationListener
public FxTradingConfigurationBuilder setAdapterConfigurationListener(AdapterConfigurationListener listener) Sets a customAdapterConfigurationListenerto load custom configurations.- Parameters:
listener- The listener that will receive a callback to load custom configurations- Returns:
- the FxTradingConfigurationBuilder
- See Also:
-
setESPCustomFieldValuesFactory
public FxTradingConfigurationBuilder setESPCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.generated.motif.fx.trading.esp.ESPTrade, ESPTradeProperties> espCustomFieldValuesFactory) Sets a customCustomFieldValuesFactoryused to create customCustomFieldValuesobjects for ESP trades. The resultingCustomFieldValuesobjects will be serialised and stored in the TakerOrderCustom field of the ESP trade.- Parameters:
espCustomFieldValuesFactory- The custom factory to use to createCustomFieldValuesobjects for ESP trades
-
setRFSCustomFieldValuesFactory
public FxTradingConfigurationBuilder setRFSCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.generated.motif.fx.trading.rfs.RFSTrade, RFSTradeProperties> rfsCustomFieldValuesFactory) Sets a customCustomFieldValuesFactoryused to create customCustomFieldValuesobjects for RFS trades. The resultingCustomFieldValuesobjects will be serialised and stored in the TakerOrderCustom field of the RFS trade.- Parameters:
rfsCustomFieldValuesFactory- The custom factory to use to createCustomFieldValuesobjects for RFS trades
-
setBlockTradeCustomFieldValuesFactory
public FxTradingConfigurationBuilder setBlockTradeCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.generated.motif.fx.trading.rfs.RFSTrade, BlockTradeProperties> blockTradeCustomFieldValuesFactory) Sets a customCustomFieldValuesFactoryused to create customCustomFieldValuesobjects for block trades. The resultingCustomFieldValuesobjects will be serialised and stored in the TakerOrderCustom field of the block trade.- Parameters:
blockTradeCustomFieldValuesFactory- The custom factory to use to createCustomFieldValuesobjects for block trades
-
setCustomFieldValuesSerialiser
public FxTradingConfigurationBuilder setCustomFieldValuesSerialiser(CustomFieldValuesSerialiser customFieldValuesSerialiser) Sets a customCustomFieldValuesSerialiserused to serialise/deserialiseCustomFieldValuesobjects for ESP trades. The resulting serialised objects will be stored in the TakerOrderCustom field of the ESP trade.- Parameters:
customFieldValuesSerialiser- The custom serialiser to use when serialising/deserialisingCustomFieldValuesobjects for ESP trades
-
setDataSource
Sets a customDataSourceto extend the FxTradingAdapter's default behaviour.- Parameters:
dataSource- a customDataSource- Returns:
- the FxTradingConfigurationBuilder
- See Also:
-
DataSource
-
setAccountManager
Sets a customFxTradingAccountManagerto extend the FxTradingAdapter's default behaviour.- Parameters:
accountManager- a customFxTradingAccountManager- Returns:
- the FxTradingConfigurationBuilder
-
setRFSStateEventFactory
public FxTradingConfigurationBuilder setRFSStateEventFactory(RFSStateEventFactory RFSStateEventFactory) Sets a customRFSStateEventFactoryto extend the FxTradingAdapter's default behaviour for RFS Trades.- Parameters:
RFSStateEventFactory- a customRFSStateEventFactory- Returns:
- the FxTradingConfigurationBuilder
-
setBlockTradeListenerEventInfoFactory
public FxTradingConfigurationBuilder setBlockTradeListenerEventInfoFactory(BlockStateEventFactory blockTradeListenerEventInfoFactory) Sets a customBlockStateEventFactoryto extend the FxTradingAdapter's default behaviour for Block Trades.- Parameters:
blockTradeListenerEventInfoFactory- a customBlockStateEventFactory- Returns:
- the FxTradingConfigurationBuilder
-
setConfigurationLoader
public FxTradingConfigurationBuilder setConfigurationLoader(ConfigurationLoader configurationLoader) Sets a customConfigurationLoaderto replace the default.- Parameters:
configurationLoader- a customConfigurationLoader- Returns:
- the FxTradingConfigurationBuilder
- See Also:
-
setInstrumentProvider
Sets a customInstrumentProviderto replace the defaultFxCrossInstrumentProvider.- Parameters:
instrumentProvider- a customInstrumentProvider- Returns:
- the FxTradingConfigurationBuilder
-
setQuoteFactory
Sets a customQuoteFactoryto replace the defaultDefaultQuoteFactory.- Parameters:
quoteFactory- a customQuoteFactory- Returns:
- the FxTradingConfigurationBuilder
-
setSalesQuoteFactory
Sets a customSalesQuoteFactoryto replace the defaultDefaultSalesQuoteFactory.- Parameters:
salesQuoteFactory- a customSalesQuoteFactory- Returns:
- the FxTradingConfigurationBuilder
-
setBlockQuoteFactory
Sets a customBlockQuoteFactoryto replace the defaultDefaultBlockQuoteFactory.- Parameters:
blockQuoteFactory- a customBlockQuoteFactory- Returns:
- the FxTradingConfigurationBuilder
-
setSwapQuoteFactory
Sets a customSwapQuoteFactoryto replace the defaultDefaultSwapQuoteFactory.- Parameters:
swapQuoteFactory- a customSwapQuoteFactory- Returns:
- the FxTradingConfigurationBuilder
-
setSalesSwapQuoteFactory
public FxTradingConfigurationBuilder setSalesSwapQuoteFactory(SalesSwapQuoteFactory salesSwapQuoteFactory) Sets a customSalesSwapQuoteFactoryto replace the defaultDefaultSalesSwapQuoteFactory.- Parameters:
salesSwapQuoteFactory- a customSalesSwapQuoteFactory- Returns:
- the FxTradingConfigurationBuilder
-
setTradingConnectionRouter
public FxTradingConfigurationBuilder setTradingConnectionRouter(TradingConnectionRouter tradingConnectionRouter) Sets a customTradingConnectionRouter. There is no default implementation.- Parameters:
tradingConnectionRouter- a customTradingConnectionRouter- Returns:
- the FxTradingConfigurationBuilder
-
build
Creates an instance of FxTradingConfiguration which can be used to instantiate a FxTradingAdapter.- Returns:
- a new FxTradingConfiguration
-