FXOrderAdapter
@Deprecated public class FXOrdersAdapter extends Object
An FXOrdersAdapter services trading capabilities for Limit Orders. This includes single leg orders, as well as if-done, oco and if-done-oco multi-leg order types.
Typically, an FXOrdersAdapter will be set up as follows:
FXOrdersAdapter adapter = new FXOrdersAdapter(dataSource); adapter.registerSubmissionListenerFactory(StrategyType.SINGLE.getName(), new MySingleOrderListenerFactory()); adapter.registerSubmissionListenerFactory(StrategyType.IF_DONE.getName(), new MyIfDoneOrderListenerFactory()); adapter.registerSubmissionListenerFactory(StrategyType.OCO.getName(), new MyOCOOrderListenerFactory()); adapter.registerSubmissionListenerFactory(StrategyType.IF_DONE_OCO.getName(), new MyIfDoneOCOOrderListenerFactory());
Constructor and Description |
---|
FXOrdersAdapter(com.caplin.datasource.DataSource dataSource)
Deprecated.
|
FXOrdersAdapter(com.caplin.datasource.DataSource dataSource,
ThreadMode threadMode)
Deprecated.
|
FXOrdersAdapter(TradeAdapter tradeAdapter)
Deprecated.
|
@Deprecated public FXOrdersAdapter(com.caplin.datasource.DataSource dataSource) throws IOException
Constructs an FXOrdersAdapter that will utilise the specified DataSource and its configuration for communication with the motif.
Uses a defaultThreadMode
of ThreadMode.SharedThreads
dataSource
- The DataSource that will be used to receive requests
for Limit Orders.IOException
- If an error occurred when reading the configuration
files for the adapter.@Deprecated public FXOrdersAdapter(com.caplin.datasource.DataSource dataSource, ThreadMode threadMode) throws IOException
Constructs an FXOrdersAdapter that will utilise the specified DataSource and its configuration for communication with the motif.
dataSource
- The DataSource that will be used to receive requests
for Limit Orders.threadMode
- The thread mode to use for trades being made through the Adapter.IOException
- If an error occurred when reading the configuration
files for the adapter.@Deprecated public FXOrdersAdapter(TradeAdapter tradeAdapter)
Constructs the FXOrdersAdapter that will utilise the specified TradeAdapter and its configuration for communication with the motif.
Prefer this constructor if you will be implementing post allocations,
pass the FXPostAllocationAdapter
the same instance of
TradeAdapter
tradeAdapter
- The Trade@Deprecated public void addUserSessionListener(UserSessionListener listener)
listener
- the listener to be notified of session lifecycle events.@Deprecated public void removeUserSessionListener(UserSessionListener listener)
listener
- the listener to be removed from receiving session lifecycle events.@Deprecated public void registerSubmissionListenerFactory(OrderSubmissionListenerFactory<MotifOrderStrategy> listenerFactory)
listenerFactory
- The factory that will be asked to create the OrderSubmissionListener@Deprecated public void registerSubmissionListenerFactory(String strategyType, OrderSubmissionListenerFactory<? extends MotifOrderStrategy> listenerFactory)
strategyType
- The strategy type that the factory will be associated with, see StrategyType
for default valueslistenerFactory
- The factory that will be asked to create the OrderSubmissionListener@Deprecated public void registerSubmissionListenerFactory(String strategyType, OrderSubmissionListenerFactory<? extends OrderStrategy> listenerFactory, OrderStrategyFactory<? extends OrderStrategy> strategyFactory)
An OrderStrategyFactory is passed in, to delegate the job
of creating the said strategy. If this is not a default strategy it is
recommended that a you also a register a validator for the strategy
afterward using registerOrderSubmissionValidator
strategyType
- the The strategy type that the factories will be associated with, see StrategyType
for default valueslistenerFactory
- The factory that will be asked to create the OrderSubmissionListenerstrategyFactory
- The factory that will be asked to create the OrderStrategy@Deprecated public void registerOrderSubmissionValidator(String strategyType, OrderSubmissionValidator validator)
strategyType
- The strategy type for which the validator will be asked to validatevalidator
- The validator which will validate an OrderStrategy@Deprecated public void registerCancelationListenerFactory(OrderCancelationListenerFactory factory)
factory
- The factory that will be asked to create the OrderCancelationListener@Deprecated public void registerChangeActiveStateListenerFactory(OrderChangeActiveStateListenerFactory factory)
factory
- The factory that will be asked to create the OrderChangeActiveStateListener@Deprecated public void registerBulkOrderActionListenerFactory(BulkOrderActionTradeListenerFactory factory)
factory
- The factory that will be asked to create the BulkOrderActionTradeListener@Deprecated public void registerStrategyDetailsRequestListenerFactory(StrategyDetailsRequestListenerFactory factory, com.caplin.datasource.namespace.Namespace namespace, SubjectParser<OrderDetailsInfo> subjectParser)
FXOrderAdapter.registerOrderDetailsProvider(String, com.caplin.motif.datasource.CachedMessageProvider)
StrategyDetailsRequestListenerFactory
which will listen to strategy detail requests from the client.factory
- The factory that will be asked to create the StrategyDetailsRequestListener
instances.namespace
- A namespace representing the subject pattern that this StrategyDetailsRequestListenerFactory
will handle requests for.subjectParser
- The parser that will be used to convert subjects required by the front end into instances of the domain
object OrderDetailsInfo
.@Deprecated public void registerStrategyDetailsRequestListenerFactory(StrategyDetailsRequestListenerFactory factory)
FXOrderAdapter.registerOrderDetailsProvider(String, com.caplin.motif.datasource.CachedMessageProvider)
StrategyDetailsRequestListenerFactory
which will listen to strategy detail requests from the client.factory
- The factory that will be asked to create the StrategyDetailsRequestListenerFactory
@Deprecated public void registerEditStrategyListenerFactory(EditStrategyListenerFactory factory)
EditStrategyListenerFactory
which will listen to Edit Strategy requests from the client.factory
- The factory that will be asked to create the EditStrategyListener
Copyright © 2020 Caplin Systems.