public class OrderConfigurationBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADAPTER_NAME |
Constructor and Description |
---|
OrderConfigurationBuilder()
This class produces a OrderConfiguration which can be used to instantiate a
LimitOrderAdapter . |
Modifier and Type | Method and 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 custom
AdapterConfigurationListener to load custom configurations. |
OrderConfigurationBuilder |
setConfigurationLoader(ConfigurationLoader configurationLoader)
Sets a custom
ConfigurationLoader to replace the
OrderAdapter's default behaviour. |
OrderConfigurationBuilder |
setCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.motif.fx.trading.orders.submission.strategy.MotifOrderStrategy,OrderProperties> customFieldValuesFactory)
Sets a custom
CustomFieldValuesFactory used to create custom CustomFieldValues objects for orders. |
OrderConfigurationBuilder |
setCustomFieldValuesSerialiser(CustomFieldValuesSerialiser customFieldValuesSerialiser)
Sets a custom
CustomFieldValuesSerialiser used to
serialise/deserialise CustomFieldValues objects. |
OrderConfigurationBuilder |
setDataSource(com.caplin.datasource.DataSource dataSource)
Sets a custom
DataSource to extend the
OrderAdapter's default behaviour. |
OrderConfigurationBuilder |
setInstrumentProvider(InstrumentProvider instrumentProvider)
Sets a
InstrumentProvider to replace the OrderAdapter's default behaviour. |
OrderConfigurationBuilder |
setNotificationManager(NotificationManager notificationManager)
Set a
NotificationManager used to initialise notification components. |
OrderConfigurationBuilder |
setOrderAuditTrailListener(OrderAuditTrailListener auditTrailListener)
Deprecated.
|
OrderConfigurationBuilder |
setOrderConnectionPoolPreprocessor(OrderConnectionPoolPreprocessor preProcessor)
Set a
OrderConnectionPoolPreprocessor to preprocess the order connections for the connection pool. |
OrderConfigurationBuilder |
setOrderConnectionRequestRouter(OrderConnectionRequestRouter router)
Sets a custom
OrderConnectionRequestRouter to override the OrderAdapter's
default behaviour. |
OrderConfigurationBuilder |
setOrderEditor(OrderEditor orderEditor)
Sets a custom
OrderEditor to override the OrderAdapter's
default PerStrategyOrderEditor . |
OrderConfigurationBuilder |
setOrderFactory(OrderFactory orderFactory)
Sets a custom
OrderFactory to override the OrderAdapter's
default OrderFactory. |
OrderConfigurationBuilder |
setOrderFieldsGenerator(OrderFieldsGenerator orderFieldsGenerator)
Sets a custom
OrderFieldsGenerator to override the OrderAdapter's default OrderFieldsGenerator. |
OrderConfigurationBuilder |
setOrderPermissionFactory(OrderPermissionFactory orderPermissionFactory)
Sets a custom
OrderPermissionFactory 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 custom
StrategyDetailsGenerator to replace the
OrderAdapter's default behaviour. |
OrderConfigurationBuilder |
setUserManager(UserManager userManager)
Sets a custom
UserManager to override the OrderAdapter's default UserManager. |
public static final java.lang.String ADAPTER_NAME
public OrderConfigurationBuilder() throws ConfigurationLoaderException
LimitOrderAdapter
.ConfigurationLoaderException
public OrderConfigurationBuilder setOrderFieldsGenerator(OrderFieldsGenerator orderFieldsGenerator)
OrderFieldsGenerator
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.orderFieldsGenerator
- A custom OrderFieldsGenerator
OrderFieldsGenerator
public OrderConfigurationBuilder setOrderFactory(OrderFactory orderFactory)
OrderFactory
to override the OrderAdapter's
default OrderFactory.orderFactory
- A custom OrderFactory
OrderFactory
public OrderConfigurationBuilder setOrderEditor(OrderEditor orderEditor)
OrderEditor
to override the OrderAdapter's
default PerStrategyOrderEditor
. The OrderEditor maps data from a given Strategy and Order to a TrAPI order.orderEditor
- A custom OrderEditor
OrderEditor
public OrderConfigurationBuilder setUserManager(UserManager userManager)
UserManager
to override the OrderAdapter's default UserManager.userManager
- a custom UserManager
UserManager
public OrderConfigurationBuilder setAdapterConfigurationListener(AdapterConfigurationListener listener)
AdapterConfigurationListener
to load custom configurations.listener
- The listener that will receive a callback to load custom configurationsAdapterConfigurationListener
public OrderConfigurationBuilder setCustomFieldValuesFactory(CustomFieldValuesFactory<com.caplin.motif.fx.trading.orders.submission.strategy.MotifOrderStrategy,OrderProperties> customFieldValuesFactory)
CustomFieldValuesFactory
used to create custom CustomFieldValues
objects for orders.
The resulting CustomFieldValues
objects will be serialised and stored in the TakerOrderCustom field of the order.customFieldValuesFactory
- The custom factory to use to create
CustomFieldValues
objects for orderspublic OrderConfigurationBuilder setCustomFieldValuesSerialiser(CustomFieldValuesSerialiser customFieldValuesSerialiser)
CustomFieldValuesSerialiser
used to
serialise/deserialise CustomFieldValues
objects.
The resulting serialised objects will be stored in the TakerOrderCustom field.customFieldValuesSerialiser
- The custom serialiser to use when serialising/deserialising
CustomFieldValues
objectspublic OrderConfigurationBuilder setDataSource(com.caplin.datasource.DataSource dataSource)
DataSource
to extend the
OrderAdapter's default behaviour.dataSource
- a custom DataSource
DataSource
public OrderConfigurationBuilder setOrderPermissionFactory(OrderPermissionFactory orderPermissionFactory)
OrderPermissionFactory
to extend the
OrderAdapter's default behaviour in populating the order blotter,
edit orders and see order strategy details.orderPermissionFactory
- a custom OrderPermissionFactory
OrderPermissionFactory
public OrderConfigurationBuilder setConfigurationLoader(ConfigurationLoader configurationLoader)
ConfigurationLoader
to replace the
OrderAdapter's default behaviour.configurationLoader
- a custom ConfigurationLoader
ConfigurationLoader
public OrderConfigurationBuilder registerOrderSubmissionValidator(java.lang.String strategyType, com.caplin.motif.fx.trading.orders.submission.OrderSubmissionValidator validator)
strategyType
- The strategy type for which the validator will be asked to validatevalidator
- The validator which will validate an OrderStrategypublic OrderConfigurationBuilder setStrategyDetailsGenerator(StrategyDetailsGenerator strategyDetailsGenerator)
StrategyDetailsGenerator
to replace the
OrderAdapter's default behaviour.strategyDetailsGenerator
- a custom StrategyDetailsGenerator
StrategyDetailsGenerator
public OrderConfigurationBuilder setOrderConnectionRequestRouter(OrderConnectionRequestRouter router)
OrderConnectionRequestRouter
to override the OrderAdapter's
default behaviour.router
- a custom OrderConnectionRequestRouter
OrderConnectionRequestRouter
@Deprecated public OrderConfigurationBuilder setOrderAuditTrailListener(OrderAuditTrailListener auditTrailListener)
OrderAuditTrailListener
to receive callbacks on actions that users
perform on orders.auditTrailListener
- a custom OrderAuditTrailListener
OrderAuditTrailListener
public OrderConfigurationBuilder setInstrumentProvider(InstrumentProvider instrumentProvider)
InstrumentProvider
to replace the OrderAdapter's default behaviour.instrumentProvider
- a custom InstrumentProvider
public OrderConfigurationBuilder setOrderConnectionPoolPreprocessor(OrderConnectionPoolPreprocessor preProcessor)
OrderConnectionPoolPreprocessor
to preprocess the order connections for the connection pool.preProcessor
- the configured OrderConnectionPoolPreprocessor
OrderConnectionPoolPreprocessor
public OrderConfigurationBuilder setNotificationManager(NotificationManager notificationManager)
NotificationManager
used to initialise notification components.notificationManager
- to received subscriptions and send notifications.NotificationManager
public OrderConfiguration build()
Copyright © 2016 Caplin Systems.