Class OrderConfigurationBuilder
- java.lang.Object
-
- com.caplin.motif.fx.ret.orders.config.OrderConfigurationBuilder
-
public class OrderConfigurationBuilder extends java.lang.Object
This class produces a OrderConfiguration which can be used to instantiate an OrderAdapter.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ADAPTER_NAME
-
Constructor Summary
Constructors Constructor Description OrderConfigurationBuilder()
This class produces a OrderConfiguration which can be used to instantiate aLimitOrderAdapter
.OrderConfigurationBuilder(ConfigurationLoader configurationLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description OrderConfiguration
build()
Creates an instance of OrderConfiguration which can be used to instantiate a OrderAdapter.OrderConfigurationBuilder
registerOrderSubmissionValidator(java.lang.String strategyType, com.caplin.motif.fx.trading.orders.submission.OrderSubmissionValidator validator)
Takes the strategy type as well as the validator; so for a particular strategy (e.g OCO) the validation can be overridden.OrderConfigurationBuilder
setAdapterConfigurationListener(AdapterConfigurationListener listener)
Sets a customAdapterConfigurationListener
to load custom configurations.OrderConfigurationBuilder
setConfigurationLoader(ConfigurationLoader configurationLoader)
Sets a customConfigurationLoader
to replace the OrderAdapter's default behaviour.OrderConfigurationBuilder
setCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.motif.fx.trading.orders.submission.strategy.MotifOrderStrategy,OrderProperties> customFieldValuesFactory)
Sets a customCustomFieldValuesFactory
used to create customCustomFieldValues
objects for orders.OrderConfigurationBuilder
setCustomFieldValuesSerialiser(CustomFieldValuesSerialiser customFieldValuesSerialiser)
Sets a customCustomFieldValuesSerialiser
used to serialise/deserialiseCustomFieldValues
objects.OrderConfigurationBuilder
setDataSource(com.caplin.datasource.DataSource dataSource)
Sets a customDataSource
to extend the OrderAdapter's default behaviour.OrderConfigurationBuilder
setInstrumentProvider(InstrumentProvider instrumentProvider)
Sets aInstrumentProvider
to replace the OrderAdapter's default behaviour.OrderConfigurationBuilder
setNotificationManager(NotificationManager notificationManager)
Set aNotificationManager
used to initialise notification components.OrderConfigurationBuilder
setOrderAuditTrailListener(OrderAuditTrailListener auditTrailListener)
Deprecated.OrderConfigurationBuilder
setOrderConnectionPoolPreprocessor(OrderConnectionPoolPreprocessor preProcessor)
Set aOrderConnectionPoolPreprocessor
to preprocess the order connections for the connection pool.OrderConfigurationBuilder
setOrderConnectionRequestRouter(OrderConnectionRequestRouter router)
Sets a customOrderConnectionRequestRouter
to override the OrderAdapter's default behaviour.OrderConfigurationBuilder
setOrderCustomFieldsFactory(OrderCustomFieldsFactory orderCustomFieldsFactory)
Set a customOrderCustomFieldsFactory
to override the OrderAdapters' default OrderCustomFieldsFactory.OrderConfigurationBuilder
setOrderEditor(OrderEditor orderEditor)
Sets a customOrderEditor
to override the OrderAdapter's defaultPerStrategyOrderEditor
.OrderConfigurationBuilder
setOrderFactory(OrderFactory orderFactory)
Sets a customOrderFactory
to override the OrderAdapter's default OrderFactory.OrderConfigurationBuilder
setOrderFieldsGenerator(OrderFieldsGenerator orderFieldsGenerator)
Deprecated.This has been deprecated as you should not modify or remove fields from the Toolkit's default field set.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.OrderConfigurationBuilder
setStrategyDetailsGenerator(StrategyDetailsGenerator strategyDetailsGenerator)
Sets a customStrategyDetailsGenerator
to replace the OrderAdapter's default behaviour.void
setTimezoneOverrides(java.util.Map<java.lang.String,java.lang.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.OrderConfigurationBuilder
setUserManager(UserManager userManager)
Sets a customUserManager
to override the OrderAdapter's default UserManager.
-
-
-
Field Detail
-
ADAPTER_NAME
public static final java.lang.String ADAPTER_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OrderConfigurationBuilder
public OrderConfigurationBuilder() throws ConfigurationLoaderException
This class produces a OrderConfiguration which can be used to instantiate aLimitOrderAdapter
.- Throws:
ConfigurationLoaderException
-
OrderConfigurationBuilder
public OrderConfigurationBuilder(ConfigurationLoader configurationLoader)
-
-
Method Detail
-
setTimezoneOverrides
public void setTimezoneOverrides(java.util.Map<java.lang.String,java.lang.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. 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(OrderCustomFieldsFactory)
-
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
public OrderConfigurationBuilder setOrderFactory(OrderFactory orderFactory)
Sets a customOrderFactory
to override the OrderAdapter's default OrderFactory.- Parameters:
orderFactory
- A customOrderFactory
- See Also:
OrderFactory
-
setOrderEditor
public OrderConfigurationBuilder setOrderEditor(OrderEditor orderEditor)
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:
OrderEditor
-
setUserManager
public OrderConfigurationBuilder setUserManager(UserManager userManager)
Sets a customUserManager
to override the OrderAdapter's default UserManager.- Parameters:
userManager
- a customUserManager
- See Also:
UserManager
-
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:
AdapterConfigurationListener
-
setCustomFieldValuesFactory
public OrderConfigurationBuilder setCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.motif.fx.trading.orders.submission.strategy.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
public OrderConfigurationBuilder setDataSource(com.caplin.datasource.DataSource dataSource)
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:
OrderPermissionFactory
-
setConfigurationLoader
public OrderConfigurationBuilder setConfigurationLoader(ConfigurationLoader configurationLoader)
Sets a customConfigurationLoader
to replace the OrderAdapter's default behaviour.- Parameters:
configurationLoader
- a customConfigurationLoader
- Returns:
- the OrderConfigurationBuilder
- See Also:
ConfigurationLoader
-
registerOrderSubmissionValidator
public OrderConfigurationBuilder registerOrderSubmissionValidator(java.lang.String strategyType, com.caplin.motif.fx.trading.orders.submission.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:
StrategyDetailsGenerator
-
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:
OrderConnectionRequestRouter
-
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:
OrderAuditTrailListener
-
setInstrumentProvider
public OrderConfigurationBuilder setInstrumentProvider(InstrumentProvider instrumentProvider)
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:
OrderConnectionPoolPreprocessor
-
setNotificationManager
public OrderConfigurationBuilder setNotificationManager(NotificationManager notificationManager)
Set aNotificationManager
used to initialise notification components.- Parameters:
notificationManager
- to received subscriptions and send notifications.- See Also:
NotificationManager
-
build
public OrderConfiguration build()
Creates an instance of OrderConfiguration which can be used to instantiate a OrderAdapter.- Returns:
- a new OrderConfiguration
-
-