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
-
Constructor Summary
ConstructorDescriptionThis 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 customFxTradingAccountManager
to extend the FxTradingAdapter's default behaviour.Sets a customAdapterConfigurationListener
to load custom configurations.setBlockQuoteFactory
(BlockQuoteFactory blockQuoteFactory) Sets a customBlockQuoteFactory
to replace the defaultDefaultBlockQuoteFactory
.setBlockTradeCustomFieldValuesFactory
(CustomFieldValuesFactory<com.caplin.generated.motif.fx.trading.rfs.RFSTrade, BlockTradeProperties> blockTradeCustomFieldValuesFactory) Sets a customCustomFieldValuesFactory
used to create customCustomFieldValues
objects for block trades.setBlockTradeListenerEventInfoFactory
(BlockStateEventFactory blockTradeListenerEventInfoFactory) Sets a customBlockStateEventFactory
to extend the FxTradingAdapter's default behaviour for Block Trades.setBlotterItemFieldsUpdater
(TradeBlotterItemFieldsUpdater fieldsUpdater) Sets a customTradeBlotterItemFieldsUpdater
to override the FxTradingAdapter's default BlotterItemFieldsUpdater.setConfigurationLoader
(ConfigurationLoader configurationLoader) Sets a customConfigurationLoader
to replace the default.setCustomFieldValuesSerialiser
(CustomFieldValuesSerialiser customFieldValuesSerialiser) Sets a customCustomFieldValuesSerialiser
used to serialise/deserialiseCustomFieldValues
objects for ESP trades.setDataSource
(com.caplin.datasource.DataSource dataSource) Sets a customDataSource
to extend the FxTradingAdapter's default behaviour.setDataSourceProviderExtension
(DataSourceProviderExtension dataSourceProviderExtension) Sets a customDataSourceProviderExtension
that 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 customCustomFieldValuesFactory
used to create customCustomFieldValues
objects for ESP trades.setInstrumentProvider
(InstrumentProvider instrumentProvider) Sets a customInstrumentProvider
to replace the defaultFxCrossInstrumentProvider
.setQuoteFactory
(QuoteFactory quoteFactory) Sets a customQuoteFactory
to replace the defaultDefaultQuoteFactory
.setRFSCustomFieldValuesFactory
(CustomFieldValuesFactory<com.caplin.generated.motif.fx.trading.rfs.RFSTrade, RFSTradeProperties> rfsCustomFieldValuesFactory) Sets a customCustomFieldValuesFactory
used to create customCustomFieldValues
objects for RFS trades.setRFSStateEventFactory
(RFSStateEventFactory RFSStateEventFactory) Sets a customRFSStateEventFactory
to extend the FxTradingAdapter's default behaviour for RFS Trades.setSalesQuoteFactory
(SalesQuoteFactory salesQuoteFactory) Sets a customSalesQuoteFactory
to replace the defaultDefaultSalesQuoteFactory
.setSalesSwapQuoteFactory
(SalesSwapQuoteFactory salesSwapQuoteFactory) Sets a customSalesSwapQuoteFactory
to replace the defaultDefaultSalesSwapQuoteFactory
.setSwapQuoteFactory
(SwapQuoteFactory swapQuoteFactory) Sets a customSwapQuoteFactory
to replace the defaultDefaultSwapQuoteFactory
.setTradingConnectionRouter
(TradingConnectionRouter tradingConnectionRouter) Sets a customTradingConnectionRouter
.setUserManager
(UserManager userManager) Sets a customUserManager
to 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 customTradeBlotterItemFieldsUpdater
to 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 customDataSourceProviderExtension
that can be used to publish additional data using services fromDataSourceProviderExtension.Context
.- Parameters:
dataSourceProviderExtension
- an implementation ofDataSourceProviderExtension
- Returns:
- the FxTradingConfigurationBuilder
- See Also:
-
setUserManager
Sets a customUserManager
to override the FxTradingAdapter's default UserManager.- Parameters:
userManager
- a customUserManager
- Returns:
- the FxTradingConfigurationBuilder
- See Also:
-
setAdapterConfigurationListener
public FxTradingConfigurationBuilder setAdapterConfigurationListener(AdapterConfigurationListener listener) Sets a customAdapterConfigurationListener
to 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 customCustomFieldValuesFactory
used to create customCustomFieldValues
objects for ESP trades. The resultingCustomFieldValues
objects will be serialised and stored in the TakerOrderCustom field of the ESP trade.- Parameters:
espCustomFieldValuesFactory
- The custom factory to use to createCustomFieldValues
objects for ESP trades
-
setRFSCustomFieldValuesFactory
public FxTradingConfigurationBuilder setRFSCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.generated.motif.fx.trading.rfs.RFSTrade, RFSTradeProperties> rfsCustomFieldValuesFactory) Sets a customCustomFieldValuesFactory
used to create customCustomFieldValues
objects for RFS trades. The resultingCustomFieldValues
objects will be serialised and stored in the TakerOrderCustom field of the RFS trade.- Parameters:
rfsCustomFieldValuesFactory
- The custom factory to use to createCustomFieldValues
objects for RFS trades
-
setBlockTradeCustomFieldValuesFactory
public FxTradingConfigurationBuilder setBlockTradeCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.generated.motif.fx.trading.rfs.RFSTrade, BlockTradeProperties> blockTradeCustomFieldValuesFactory) Sets a customCustomFieldValuesFactory
used to create customCustomFieldValues
objects for block trades. The resultingCustomFieldValues
objects will be serialised and stored in the TakerOrderCustom field of the block trade.- Parameters:
blockTradeCustomFieldValuesFactory
- The custom factory to use to createCustomFieldValues
objects for block trades
-
setCustomFieldValuesSerialiser
public FxTradingConfigurationBuilder setCustomFieldValuesSerialiser(CustomFieldValuesSerialiser customFieldValuesSerialiser) Sets a customCustomFieldValuesSerialiser
used to serialise/deserialiseCustomFieldValues
objects 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/deserialisingCustomFieldValues
objects for ESP trades
-
setDataSource
Sets a customDataSource
to extend the FxTradingAdapter's default behaviour.- Parameters:
dataSource
- a customDataSource
- Returns:
- the FxTradingConfigurationBuilder
- See Also:
-
DataSource
-
setAccountManager
Sets a customFxTradingAccountManager
to extend the FxTradingAdapter's default behaviour.- Parameters:
accountManager
- a customFxTradingAccountManager
- Returns:
- the FxTradingConfigurationBuilder
-
setRFSStateEventFactory
public FxTradingConfigurationBuilder setRFSStateEventFactory(RFSStateEventFactory RFSStateEventFactory) Sets a customRFSStateEventFactory
to extend the FxTradingAdapter's default behaviour for RFS Trades.- Parameters:
RFSStateEventFactory
- a customRFSStateEventFactory
- Returns:
- the FxTradingConfigurationBuilder
-
setBlockTradeListenerEventInfoFactory
public FxTradingConfigurationBuilder setBlockTradeListenerEventInfoFactory(BlockStateEventFactory blockTradeListenerEventInfoFactory) Sets a customBlockStateEventFactory
to extend the FxTradingAdapter's default behaviour for Block Trades.- Parameters:
blockTradeListenerEventInfoFactory
- a customBlockStateEventFactory
- Returns:
- the FxTradingConfigurationBuilder
-
setConfigurationLoader
public FxTradingConfigurationBuilder setConfigurationLoader(ConfigurationLoader configurationLoader) Sets a customConfigurationLoader
to replace the default.- Parameters:
configurationLoader
- a customConfigurationLoader
- Returns:
- the FxTradingConfigurationBuilder
- See Also:
-
setInstrumentProvider
Sets a customInstrumentProvider
to replace the defaultFxCrossInstrumentProvider
.- Parameters:
instrumentProvider
- a customInstrumentProvider
- Returns:
- the FxTradingConfigurationBuilder
-
setQuoteFactory
Sets a customQuoteFactory
to replace the defaultDefaultQuoteFactory
.- Parameters:
quoteFactory
- a customQuoteFactory
- Returns:
- the FxTradingConfigurationBuilder
-
setSalesQuoteFactory
Sets a customSalesQuoteFactory
to replace the defaultDefaultSalesQuoteFactory
.- Parameters:
salesQuoteFactory
- a customSalesQuoteFactory
- Returns:
- the FxTradingConfigurationBuilder
-
setBlockQuoteFactory
Sets a customBlockQuoteFactory
to replace the defaultDefaultBlockQuoteFactory
.- Parameters:
blockQuoteFactory
- a customBlockQuoteFactory
- Returns:
- the FxTradingConfigurationBuilder
-
setSwapQuoteFactory
Sets a customSwapQuoteFactory
to replace the defaultDefaultSwapQuoteFactory
.- Parameters:
swapQuoteFactory
- a customSwapQuoteFactory
- Returns:
- the FxTradingConfigurationBuilder
-
setSalesSwapQuoteFactory
public FxTradingConfigurationBuilder setSalesSwapQuoteFactory(SalesSwapQuoteFactory salesSwapQuoteFactory) Sets a customSalesSwapQuoteFactory
to 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
-