Class FxTradingConfigurationBuilder
- java.lang.Object
-
- com.caplin.motif.fx.ret.fxtrading.config.FxTradingConfigurationBuilder
-
public class FxTradingConfigurationBuilder extends java.lang.Object
This class produces a FxTradingConfiguration which can be used to instantiate an FxTradingAdapter.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ADAPTER_NAME
-
Constructor Summary
Constructors Constructor Description FxTradingConfigurationBuilder()
This class produces a FxTradingConfiguration which can be used to instantiate aFxTradingAdapter
.FxTradingConfigurationBuilder(ConfigurationLoader configurationLoader)
-
Method Summary
-
-
-
Field Detail
-
ADAPTER_NAME
public static final java.lang.String ADAPTER_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FxTradingConfigurationBuilder
public FxTradingConfigurationBuilder() throws ConfigurationLoaderException
This class produces a FxTradingConfiguration which can be used to instantiate aFxTradingAdapter
.- Throws:
ConfigurationLoaderException
-
FxTradingConfigurationBuilder
public FxTradingConfigurationBuilder(ConfigurationLoader configurationLoader)
-
-
Method Detail
-
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:
TradeBlotterItemFieldsUpdater
-
setUserManager
public FxTradingConfigurationBuilder setUserManager(UserManager userManager)
Sets a customUserManager
to override the FxTradingAdapter's default UserManager.- Parameters:
userManager
- a customUserManager
- Returns:
- the FxTradingConfigurationBuilder
- See Also:
UserManager
-
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:
AdapterConfigurationListener
-
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
public FxTradingConfigurationBuilder setDataSource(com.caplin.datasource.DataSource dataSource)
Sets a customDataSource
to extend the FxTradingAdapter's default behaviour.- Parameters:
dataSource
- a customDataSource
- Returns:
- the FxTradingConfigurationBuilder
- See Also:
DataSource
-
setAccountManager
public FxTradingConfigurationBuilder setAccountManager(FxTradingAccountManager accountManager)
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:
ConfigurationLoader
-
setInstrumentProvider
public FxTradingConfigurationBuilder setInstrumentProvider(InstrumentProvider instrumentProvider)
Sets a customInstrumentProvider
to replace the defaultFxCrossInstrumentProvider
.- Parameters:
instrumentProvider
- a customInstrumentProvider
- Returns:
- the FxTradingConfigurationBuilder
-
setQuoteFactory
public FxTradingConfigurationBuilder setQuoteFactory(QuoteFactory quoteFactory)
Sets a customQuoteFactory
to replace the defaultDefaultQuoteFactory
.- Parameters:
quoteFactory
- a customQuoteFactory
- Returns:
- the FxTradingConfigurationBuilder
-
setSalesQuoteFactory
public FxTradingConfigurationBuilder setSalesQuoteFactory(SalesQuoteFactory salesQuoteFactory)
Sets a customSalesQuoteFactory
to replace the defaultDefaultSalesQuoteFactory
.- Parameters:
salesQuoteFactory
- a customSalesQuoteFactory
- Returns:
- the FxTradingConfigurationBuilder
-
setBlockQuoteFactory
public FxTradingConfigurationBuilder setBlockQuoteFactory(BlockQuoteFactory blockQuoteFactory)
Sets a customBlockQuoteFactory
to replace the defaultDefaultBlockQuoteFactory
.- Parameters:
blockQuoteFactory
- a customBlockQuoteFactory
- Returns:
- the FxTradingConfigurationBuilder
-
setSwapQuoteFactory
public FxTradingConfigurationBuilder setSwapQuoteFactory(SwapQuoteFactory swapQuoteFactory)
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
public FxTradingConfiguration build()
Creates an instance of FxTradingConfiguration which can be used to instantiate a FxTradingAdapter.- Returns:
- a new FxTradingConfiguration
-
-