Class FXOrdersAdapter
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 Summary
ConstructorDescriptionFXOrdersAdapter
(com.caplin.datasource.DataSource dataSource) Deprecated.FXOrdersAdapter
(com.caplin.datasource.DataSource dataSource, ThreadMode threadMode) Deprecated.FXOrdersAdapter
(TradeAdapter tradeAdapter) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUserSessionListener
(UserSessionListener listener) Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.This is due to be replacedvoid
registerOrderSubmissionValidator
(String strategyType, OrderSubmissionValidator validator) Deprecated.void
Deprecated.This has been replaced byFXOrderAdapter.registerOrderDetailsProvider(String, com.caplin.motif.datasource.CachedMessageProvider)
void
registerStrategyDetailsRequestListenerFactory
(StrategyDetailsRequestListenerFactory factory, com.caplin.datasource.namespace.Namespace namespace, SubjectParser<OrderDetailsInfo> subjectParser) Deprecated.This has been replaced byFXOrderAdapter.registerOrderDetailsProvider(String, com.caplin.motif.datasource.CachedMessageProvider)
void
registerSubmissionListenerFactory
(OrderSubmissionListenerFactory<MotifOrderStrategy> listenerFactory) Deprecated.void
registerSubmissionListenerFactory
(String strategyType, OrderSubmissionListenerFactory<? extends OrderStrategy> listenerFactory, OrderStrategyFactory<? extends OrderStrategy> strategyFactory) Deprecated.void
registerSubmissionListenerFactory
(String strategyType, OrderSubmissionListenerFactory<? extends MotifOrderStrategy> listenerFactory) Deprecated.void
removeUserSessionListener
(UserSessionListener listener) Deprecated.
-
Constructor Details
-
FXOrdersAdapter
Deprecated.Constructs an FXOrdersAdapter that will utilise the specified DataSource and its configuration for communication with the motif.
Uses a defaultThreadMode
ofThreadMode.SharedThreads
- Parameters:
dataSource
- The DataSource that will be used to receive requests for Limit Orders.- Throws:
IOException
- If an error occurred when reading the configuration files for the adapter.
-
FXOrdersAdapter
@Deprecated public FXOrdersAdapter(com.caplin.datasource.DataSource dataSource, ThreadMode threadMode) throws IOException Deprecated.Constructs an FXOrdersAdapter that will utilise the specified DataSource and its configuration for communication with the motif.
- Parameters:
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.- Throws:
IOException
- If an error occurred when reading the configuration files for the adapter.
-
FXOrdersAdapter
Deprecated.Constructs the FXOrdersAdapter that will utilise the specified TradeAdapter and its configuration for communication with the motif.
- Parameters:
tradeAdapter
- The Trade
-
-
Method Details
-
addUserSessionListener
Deprecated.Adds a listener that is notified whenever a user session is created and closed. Note that you can add multiple UserSessionListeners- Parameters:
listener
- the listener to be notified of session lifecycle events.
-
removeUserSessionListener
Deprecated.Removes a listener UserSessionListener to stop receiving session events.- Parameters:
listener
- the listener to be removed from receiving session lifecycle events.
-
registerSubmissionListenerFactory
@Deprecated public void registerSubmissionListenerFactory(OrderSubmissionListenerFactory<MotifOrderStrategy> listenerFactory) Deprecated.Registers a factory that will listen to Limit Order submission workflows initiated from the client.- Parameters:
listenerFactory
- The factory that will be asked to create the OrderSubmissionListener
-
registerSubmissionListenerFactory
@Deprecated public void registerSubmissionListenerFactory(String strategyType, OrderSubmissionListenerFactory<? extends MotifOrderStrategy> listenerFactory) Deprecated.Registers a factory that will listen to Limit Order submission workflows initiated from the client for the strategy type specified.- Parameters:
strategyType
- The strategy type that the factory will be associated with, seeStrategyType
for default valueslistenerFactory
- The factory that will be asked to create the OrderSubmissionListener
-
registerSubmissionListenerFactory
@Deprecated public void registerSubmissionListenerFactory(String strategyType, OrderSubmissionListenerFactory<? extends OrderStrategy> listenerFactory, OrderStrategyFactory<? extends OrderStrategy> strategyFactory) Deprecated.Registers a factory that will listen to the Limit Order submission workflows initiated from the client for the strategy type specified.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
- Parameters:
strategyType
- the The strategy type that the factories will be associated with, seeStrategyType
for default valueslistenerFactory
- The factory that will be asked to create the OrderSubmissionListenerstrategyFactory
- The factory that will be asked to create the OrderStrategy
-
registerOrderSubmissionValidator
@Deprecated public void registerOrderSubmissionValidator(String strategyType, OrderSubmissionValidator validator) Deprecated.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
-
registerCancelationListenerFactory
Deprecated.Registers a factory that will be asked to create the OrderCancelationFactory which will listen to order cancelation workflows initiated by the client.- Parameters:
factory
- The factory that will be asked to create the OrderCancelationListener
-
registerChangeActiveStateListenerFactory
@Deprecated public void registerChangeActiveStateListenerFactory(OrderChangeActiveStateListenerFactory factory) Deprecated.Registers a factory that will be asked to create the OrderChangeActiveStateListener which will listen to order activation workflows initiated by the client.- Parameters:
factory
- The factory that will be asked to create the OrderChangeActiveStateListener
-
registerBulkOrderActionListenerFactory
@Deprecated public void registerBulkOrderActionListenerFactory(BulkOrderActionTradeListenerFactory factory) Deprecated.Registers a factory that will be asked to create the BulkOrderActionTradeListener which will listen to bulk order action workflows initiated by the client.- Parameters:
factory
- The factory that will be asked to create the BulkOrderActionTradeListener
-
registerStrategyDetailsRequestListenerFactory
@Deprecated public void registerStrategyDetailsRequestListenerFactory(StrategyDetailsRequestListenerFactory factory, com.caplin.datasource.namespace.Namespace namespace, SubjectParser<OrderDetailsInfo> subjectParser) Deprecated.This has been replaced byFXOrderAdapter.registerOrderDetailsProvider(String, com.caplin.motif.datasource.CachedMessageProvider)
Registers a factory and your own parser implementation that will be asked to create theStrategyDetailsRequestListenerFactory
which will listen to strategy detail requests from the client.- Parameters:
factory
- The factory that will be asked to create theStrategyDetailsRequestListener
instances.namespace
- A namespace representing the subject pattern that thisStrategyDetailsRequestListenerFactory
will handle requests for.subjectParser
- The parser that will be used to convert subjects required by the front end into instances of the domain objectOrderDetailsInfo
.
-
registerStrategyDetailsRequestListenerFactory
@Deprecated public void registerStrategyDetailsRequestListenerFactory(StrategyDetailsRequestListenerFactory factory) Deprecated.This has been replaced byFXOrderAdapter.registerOrderDetailsProvider(String, com.caplin.motif.datasource.CachedMessageProvider)
Registers a factory that will be asked to create theStrategyDetailsRequestListenerFactory
which will listen to strategy detail requests from the client.- Parameters:
factory
- The factory that will be asked to create theStrategyDetailsRequestListenerFactory
-
registerEditStrategyListenerFactory
Deprecated.This is due to be replacedRegisters a factory that will be asked to create theEditStrategyListenerFactory
which will listen to Edit Strategy requests from the client.- Parameters:
factory
- The factory that will be asked to create theEditStrategyListener
-
FXOrderAdapter