Class OrderConfigurationBuilder
java.lang.Object
com.caplin.motif.fx.ret.orders.config.OrderConfigurationBuilder
This class produces a OrderConfiguration which can be used to instantiate an OrderAdapter.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionThis class produces a OrderConfiguration which can be used to instantiate aLimitOrderAdapter
.OrderConfigurationBuilder
(ConfigurationLoader configurationLoader) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates an instance of OrderConfiguration which can be used to instantiate a OrderAdapter.registerOrderSubmissionValidator
(String strategyType, OrderSubmissionValidator validator) Takes the strategy type as well as the validator; so for a particular strategy (e.g OCO) the validation can be overridden.Sets a customAdapterConfigurationListener
to load custom configurations.setConfigurationLoader
(ConfigurationLoader configurationLoader) Sets a customConfigurationLoader
to replace the OrderAdapter's default behaviour.setCustomFieldValuesFactory
(CustomFieldValuesFactory<MotifOrderStrategy, OrderProperties> customFieldValuesFactory) Sets a customCustomFieldValuesFactory
used to create customCustomFieldValues
objects for orders.setCustomFieldValuesSerialiser
(CustomFieldValuesSerialiser customFieldValuesSerialiser) Sets a customCustomFieldValuesSerialiser
used to serialise/deserialiseCustomFieldValues
objects.setDataSource
(com.caplin.datasource.DataSource dataSource) Sets a customDataSource
to extend the OrderAdapter's default behaviour.setInstrumentProvider
(InstrumentProvider instrumentProvider) Sets aInstrumentProvider
to replace the OrderAdapter's default behaviour.setNotificationManager
(NotificationManager notificationManager) Set aNotificationManager
used to initialise notification components.setOrderAuditTrailListener
(OrderAuditTrailListener auditTrailListener) Deprecated.Set aOrderConnectionPoolPreprocessor
to preprocess the order connections for the connection pool.Sets a customOrderConnectionRequestRouter
to override the OrderAdapter's default behaviour.setOrderCustomFieldsFactory
(OrderCustomFieldsFactory orderCustomFieldsFactory) Set a customOrderCustomFieldsFactory
to override the OrderAdapters' default OrderCustomFieldsFactory.setOrderEditor
(OrderEditor orderEditor) Sets a customOrderEditor
to override the OrderAdapter's defaultPerStrategyOrderEditor
.setOrderFactory
(OrderFactory orderFactory) Sets a customOrderFactory
to override the OrderAdapter's default OrderFactory.setOrderFieldsGenerator
(OrderFieldsGenerator orderFieldsGenerator) Deprecated.This has been deprecated as you should not modify or remove fields from the Toolkit's default field set.setOrderPermissionFactory
(OrderPermissionFactory orderPermissionFactory) Sets a customOrderPermissionFactory
to extend the OrderAdapter's default behaviour in populating the order blotter, edit orders and see order strategy details.setStrategyDetailsGenerator
(StrategyDetailsGenerator strategyDetailsGenerator) Sets a customStrategyDetailsGenerator
to replace the OrderAdapter's default behaviour.void
setTimezoneOverrides
(Map<String, String> timezoneOverrides) RET does not use standard timezone strings (the standard list can be found: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) RET instead has a list of its own timezone strings.setUserManager
(UserManager userManager) Sets a customUserManager
to override the OrderAdapter's default UserManager.
-
Field Details
-
ADAPTER_NAME
- See Also:
-
-
Constructor Details
-
OrderConfigurationBuilder
This class produces a OrderConfiguration which can be used to instantiate aLimitOrderAdapter
.- Throws:
ConfigurationLoaderException
-
OrderConfigurationBuilder
-
-
Method Details
-
setTimezoneOverrides
RET does not use standard timezone strings (the standard list can be found: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) RET instead has a list of its own timezone strings. The adapter maps the default RET strings to actual timezones.If your RET is configured with more ret timezones, you may provide additional mappings between those ret timezones and tz timezones, if needed.
- Parameters:
timezoneOverrides
- A map containing timezone overrides, the key is RET, and the value is a standard timezone String. All keys/values must be unique across keys+values
-
setOrderFieldsGenerator
@Deprecated public OrderConfigurationBuilder setOrderFieldsGenerator(OrderFieldsGenerator orderFieldsGenerator) Deprecated.This has been deprecated as you should not modify or remove fields from the Toolkit's default field set. The preferred solution to update or remove fields would be using Transformer, and to add additional fields via theOrderCustomFieldsFactory
extension point. This method may be removed in a future version of the Toolkit.Sets a customOrderFieldsGenerator
to override the OrderAdapter's default OrderFieldsGenerator. The OrderFieldsGenerator allows the user to generate fields to be sent for a blotter record. The custom OrderFieldsGenerator can change, add, remove fields on the record.- Parameters:
orderFieldsGenerator
- A customOrderFieldsGenerator
- See Also:
-
setOrderCustomFieldsFactory
public OrderConfigurationBuilder setOrderCustomFieldsFactory(OrderCustomFieldsFactory orderCustomFieldsFactory) Set a customOrderCustomFieldsFactory
to override the OrderAdapters' default OrderCustomFieldsFactory. The OrderCustomFieldsFactory allows the user to receive fields to be sent for a blotter record. The custom OrderCustomFieldsFactory can add more fields on the record.- Parameters:
orderCustomFieldsFactory
- - A customOrderCustomFieldsFactory
- Returns:
- the OrderConfigurationBuilder
-
setOrderFactory
Sets a customOrderFactory
to override the OrderAdapter's default OrderFactory.- Parameters:
orderFactory
- A customOrderFactory
- See Also:
-
setOrderEditor
Sets a customOrderEditor
to override the OrderAdapter's defaultPerStrategyOrderEditor
. The OrderEditor maps data from a given Strategy and Order to a TrAPI order.- Parameters:
orderEditor
- A customOrderEditor
- See Also:
-
setUserManager
Sets a customUserManager
to override the OrderAdapter's default UserManager.- Parameters:
userManager
- a customUserManager
- See Also:
-
setAdapterConfigurationListener
public OrderConfigurationBuilder setAdapterConfigurationListener(AdapterConfigurationListener listener) Sets a customAdapterConfigurationListener
to load custom configurations.- Parameters:
listener
- The listener that will receive a callback to load custom configurations- See Also:
-
setCustomFieldValuesFactory
public OrderConfigurationBuilder setCustomFieldValuesFactory(CustomFieldValuesFactory<MotifOrderStrategy, OrderProperties> customFieldValuesFactory) Sets a customCustomFieldValuesFactory
used to create customCustomFieldValues
objects for orders. The resultingCustomFieldValues
objects will be serialised and stored in the TakerOrderCustom field of the order.- Parameters:
customFieldValuesFactory
- The custom factory to use to createCustomFieldValues
objects for orders
-
setCustomFieldValuesSerialiser
public OrderConfigurationBuilder setCustomFieldValuesSerialiser(CustomFieldValuesSerialiser customFieldValuesSerialiser) Sets a customCustomFieldValuesSerialiser
used to serialise/deserialiseCustomFieldValues
objects. The resulting serialised objects will be stored in the TakerOrderCustom field.- Parameters:
customFieldValuesSerialiser
- The custom serialiser to use when serialising/deserialisingCustomFieldValues
objects
-
setDataSource
Sets a customDataSource
to extend the OrderAdapter's default behaviour.- Parameters:
dataSource
- a customDataSource
- Returns:
- the OrderConfigurationBuilder
- See Also:
-
DataSource
-
setOrderPermissionFactory
public OrderConfigurationBuilder setOrderPermissionFactory(OrderPermissionFactory orderPermissionFactory) Sets a customOrderPermissionFactory
to extend the OrderAdapter's default behaviour in populating the order blotter, edit orders and see order strategy details.- Parameters:
orderPermissionFactory
- a customOrderPermissionFactory
- Returns:
- the OrderConfigurationBuilder
- See Also:
-
setConfigurationLoader
Sets a customConfigurationLoader
to replace the OrderAdapter's default behaviour.- Parameters:
configurationLoader
- a customConfigurationLoader
- Returns:
- the OrderConfigurationBuilder
- See Also:
-
registerOrderSubmissionValidator
public OrderConfigurationBuilder registerOrderSubmissionValidator(String strategyType, OrderSubmissionValidator validator) Takes the strategy type as well as the validator; so for a particular strategy (e.g OCO) the validation can be overridden.- Parameters:
strategyType
- The strategy type for which the validator will be asked to validatevalidator
- The validator which will validate an OrderStrategy- Returns:
- the OrderConfigurationBuilder
-
setStrategyDetailsGenerator
public OrderConfigurationBuilder setStrategyDetailsGenerator(StrategyDetailsGenerator strategyDetailsGenerator) Sets a customStrategyDetailsGenerator
to replace the OrderAdapter's default behaviour.- Parameters:
strategyDetailsGenerator
- a customStrategyDetailsGenerator
- Returns:
- the OrderConfigurationBuilder
- See Also:
-
setOrderConnectionRequestRouter
public OrderConfigurationBuilder setOrderConnectionRequestRouter(OrderConnectionRequestRouter router) Sets a customOrderConnectionRequestRouter
to override the OrderAdapter's default behaviour.- Parameters:
router
- a customOrderConnectionRequestRouter
- Returns:
- the OrderConfigurationBuilder
- See Also:
-
setOrderAuditTrailListener
@Deprecated public OrderConfigurationBuilder setOrderAuditTrailListener(OrderAuditTrailListener auditTrailListener) Deprecated.Sets aOrderAuditTrailListener
to receive callbacks on actions that users perform on orders.- Parameters:
auditTrailListener
- a customOrderAuditTrailListener
- Returns:
- the OrderConfigurationBuilder
- See Also:
-
setInstrumentProvider
Sets aInstrumentProvider
to replace the OrderAdapter's default behaviour.- Parameters:
instrumentProvider
- a customInstrumentProvider
- Returns:
- the OrderConfigurationBuilder
-
setOrderConnectionPoolPreprocessor
public OrderConfigurationBuilder setOrderConnectionPoolPreprocessor(OrderConnectionPoolPreprocessor preProcessor) Set aOrderConnectionPoolPreprocessor
to preprocess the order connections for the connection pool.- Parameters:
preProcessor
- the configuredOrderConnectionPoolPreprocessor
- Returns:
- the OrderConfigurationBuilder
- See Also:
-
setNotificationManager
Set aNotificationManager
used to initialise notification components.- Parameters:
notificationManager
- to received subscriptions and send notifications.- See Also:
-
build
Creates an instance of OrderConfiguration which can be used to instantiate a OrderAdapter.- Returns:
- a new OrderConfiguration
-