Package com.caplin.motif.fx.orders
Class FXOrderAdapter
java.lang.Object
com.caplin.motif.datasource.CachedAdapter
com.caplin.motif.fx.orders.FXOrderAdapter
-
Field Summary
Fields inherited from class com.caplin.motif.datasource.CachedAdapter
dataSource
-
Constructor Summary
ConstructorDescriptionFXOrderAdapter
(com.caplin.datasource.DataSource dataSource) Constructs an FXOrderAdapter that will utilise the specified DataSource and its configuration for communication with the motif.FXOrderAdapter
(com.caplin.datasource.DataSource dataSource, ThreadMode threadMode) Constructs an FXOrderAdapter that will utilise the specified DataSource and its configuration for communication with the motif.FXOrderAdapter
(com.caplin.datasource.DataSource dataSource, ThreadMode threadMode, Properties properties) Constructs an FXOrderAdapter that will utilise the specified DataSource and its configuration for communication with the motif.FXOrderAdapter
(TradeAdapter tradeAdapter) Constructs an FXOrderAdapter that will utilise the specified TradeAdapter and its configuration for communication with the motif. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUserSessionListener
(UserSessionListener listener) Adds a listener that will be notified whenever a user session is created and closed.void
Registers a factory that will listen to Bulk Order Action Trade workflows initiated from the client.void
Registers a factory that will listen to Bulk Order Submission Trade workflows initiated from the client.void
Registers a factory that will listen to Edit Strategy Trade workflows initiated from the client.void
Registers a factory that will listen to Order Change State Trade workflows initiated from the client.void
registerOrderCurrencyPairConfigProvider
(CachedObjectProvider<OrderCurrencyPairConfig, OrderCurrencyPairConfigSubjectInfo> provider) Registers a provider that is capable of responding to currency pair order configuration requests made by individual traders.<T extends SubjectInfo>
voidregisterOrderCurrencyPairConfigProvider
(CachedObjectProvider<OrderCurrencyPairConfig, T> provider, com.caplin.datasource.namespace.Namespace namespace, SubjectParser<T> subjectParser) Used to register a provider that is capable of responding to currency pair order configuration requests made by individual traders on non-standard subjects.void
Registers a provider that is capable of responding to order details requests.void
registerOrderDetailsProvider
(String namespace, CachedMessageProvider<OrderSubjectInfo> provider) Registers a provider that is capable of responding to order details requests.void
registerOrderDetailsProvider
(String namespace, CachedMessageProvider<OrderSubjectInfo> provider, OrderSubjectParser subjectParser) Registers a provider that is capable of responding to order details requests.void
Registers a factory that will listen to Order Submission Trade workflows initiated from the client.void
Deprecated.void
Registers a provider that is capable of responding to sales order details requests.void
registerSalesOrderDetailsProvider
(String namespace, CachedMessageProvider<OrderSubjectInfo> provider) Registers a provider that is capable of responding to sales order details requests.void
registerSalesOrderDetailsProvider
(String namespace, CachedMessageProvider<OrderSubjectInfo> provider, OrderSubjectParser subjectParser) Registers a provider that is capable of responding to sales order details requests.void
registerToboOrderCurrencyPairConfigProvider
(CachedObjectProvider<OrderCurrencyPairConfig, ToboOrderCurrencyPairConfigSubjectInfo> provider) Used to register a provider that is capable of responding to currency pair order configuration requests made by brokers.<T extends SubjectInfo>
voidregisterToboOrderCurrencyPairConfigProvider
(CachedObjectProvider<OrderCurrencyPairConfig, T> provider, com.caplin.datasource.namespace.Namespace namespace, SubjectParser<T> subjectParser) Used to register a provider that is capable of responding to currency pair order configuration requests made by brokers on non-standard subjects.void
removeUserSessionListener
(UserSessionListener listener) Removes a listener UserSessionListener to stop receiving session events.Methods inherited from class com.caplin.motif.datasource.CachedAdapter
createCachedPublisher, createCachedPublisher
-
Constructor Details
-
FXOrderAdapter
Constructs an FXOrderAdapter that will utilise the specified DataSource and its configuration for communication with the motif.Uses a default
ThreadMode
ofThreadMode.SharedThreads
- Parameters:
dataSource
- The DataSource that will be used to receive requests for orders.- Throws:
IOException
- If an error occurred reading configuration files for the adapter.
-
FXOrderAdapter
public FXOrderAdapter(com.caplin.datasource.DataSource dataSource, ThreadMode threadMode) throws IOException Constructs an FXOrderAdapter 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 orders.threadMode
- The thread mode to use for trades being made through the Adapter.- Throws:
IOException
- If an error occurred reading configuration files for the adapter.
-
FXOrderAdapter
public FXOrderAdapter(com.caplin.datasource.DataSource dataSource, ThreadMode threadMode, Properties properties) throws IOException Constructs an FXOrderAdapter 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 orders.threadMode
- The thread mode to use for trades being made through the Adapter.properties
- The properties file to use when creating theTradingProvider
- Throws:
IOException
- If an error occurred reading configuration files for the adapter.
-
FXOrderAdapter
Constructs an FXOrderAdapter that will utilise the specified TradeAdapter and its configuration for communication with the motif.
Prefer this constructor if you will be implementing multiple trade adapters in a single adapter.
- Parameters:
tradeAdapter
- The trade adapter
-
-
Method Details
-
addUserSessionListener
Adds a listener that will be 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
Removes a listener UserSessionListener to stop receiving session events.- Parameters:
listener
- the listener to be removed from receiving session lifecycle events.
-
registerOrderSubmissionTradeListenerFactory
public void registerOrderSubmissionTradeListenerFactory(OrderSubmissionTradeListenerFactory factory) Registers a factory that will listen to Order Submission Trade workflows initiated from the client.- Parameters:
factory
- the factory that will be asked to create theOrderSubmissionTradeListener
-
registerBulkOrderSubmissionTradeListenerFactory
public void registerBulkOrderSubmissionTradeListenerFactory(BulkOrderSubmissionTradeListenerFactory factory) Registers a factory that will listen to Bulk Order Submission Trade workflows initiated from the client.- Parameters:
factory
- the factory that will be asked to create theBulkOrderSubmissionTradeListener
-
registerEditStrategyTradeListenerFactory
Registers a factory that will listen to Edit Strategy Trade workflows initiated from the client.- Parameters:
factory
- the factory that will be asked to create theEditStrategyTradeListener
-
registerBulkOrderActionTradeListenerFactory
public void registerBulkOrderActionTradeListenerFactory(BulkOrderActionTradeListenerFactory factory) Registers a factory that will listen to Bulk Order Action Trade workflows initiated from the client.- Parameters:
factory
- the factory that will be asked to create theBulkOrderActionTradeListener
-
registerOrderChangeStateTradeListenerFactory
public void registerOrderChangeStateTradeListenerFactory(OrderChangeStateTradeListenerFactory factory) Registers a factory that will listen to Order Change State Trade workflows initiated from the client.- Parameters:
factory
- the factory that will be asked to create theOrderChangeStateTradeListener
-
registerPostTradeAllocationTradeListenerFactory
@Deprecated public void registerPostTradeAllocationTradeListenerFactory(PostTradeAllocationTradeListenerFactory factory) Deprecated.use the newer spec associated with the trade adapter atFXTradeAdapter.registerAllocateTradeListenerFactory(AllocateTradeListenerFactory)
Registers a factory that will listen the v1 specification of the Post Trade Allocation- Parameters:
factory
- the factory that will be asked to create thePostTradeAllocationTradeListener
-
registerOrderDetailsProvider
Registers a provider that is capable of responding to order details requests.Provide with messages generated from
OrderDetailsTypesDef.OrderDetails
-
registerOrderDetailsProvider
public void registerOrderDetailsProvider(String namespace, CachedMessageProvider<OrderSubjectInfo> provider) Registers a provider that is capable of responding to order details requests.Provide with messages generated from
OrderDetailsTypesDef.OrderDetails
-
registerOrderDetailsProvider
public void registerOrderDetailsProvider(String namespace, CachedMessageProvider<OrderSubjectInfo> provider, OrderSubjectParser subjectParser) Registers a provider that is capable of responding to order details requests.Provide with messages generated from
OrderDetailsTypesDef.OrderDetails
-
registerSalesOrderDetailsProvider
Registers a provider that is capable of responding to sales order details requests.Provide with messages generated from
OrderDetailsTypesDef.OrderSalesDetails
-
registerSalesOrderDetailsProvider
public void registerSalesOrderDetailsProvider(String namespace, CachedMessageProvider<OrderSubjectInfo> provider) Registers a provider that is capable of responding to sales order details requests.Provide with messages generated from
OrderDetailsTypesDef.OrderSalesDetails
-
registerSalesOrderDetailsProvider
public void registerSalesOrderDetailsProvider(String namespace, CachedMessageProvider<OrderSubjectInfo> provider, OrderSubjectParser subjectParser) Registers a provider that is capable of responding to sales order details requests.Provide with messages generated from
OrderDetailsTypesDef.OrderSalesDetails
-
registerOrderCurrencyPairConfigProvider
public void registerOrderCurrencyPairConfigProvider(CachedObjectProvider<OrderCurrencyPairConfig, OrderCurrencyPairConfigSubjectInfo> provider) Registers a provider that is capable of responding to currency pair order configuration requests made by individual traders.- Parameters:
provider
- The JsonDataProvider that will receive the currency pair configuration requests
-
registerOrderCurrencyPairConfigProvider
public <T extends SubjectInfo> void registerOrderCurrencyPairConfigProvider(CachedObjectProvider<OrderCurrencyPairConfig, T> provider, com.caplin.datasource.namespace.Namespace namespace, SubjectParser<T> subjectParser) Used to register a provider that is capable of responding to currency pair order configuration requests made by individual traders on non-standard subjects.- Parameters:
provider
- The JsonDataProvider that will receive the currency pair configuration requestsnamespace
- A namespace that matches the format of your custom subjectssubjectParser
- A parser that will turn the requested subject into your own custom subclass ofSubjectInfo
-
registerToboOrderCurrencyPairConfigProvider
public void registerToboOrderCurrencyPairConfigProvider(CachedObjectProvider<OrderCurrencyPairConfig, ToboOrderCurrencyPairConfigSubjectInfo> provider) Used to register a provider that is capable of responding to currency pair order configuration requests made by brokers.- Parameters:
provider
- The JsonDataProvider that will receive the currency pair configuration requests
-
registerToboOrderCurrencyPairConfigProvider
public <T extends SubjectInfo> void registerToboOrderCurrencyPairConfigProvider(CachedObjectProvider<OrderCurrencyPairConfig, T> provider, com.caplin.datasource.namespace.Namespace namespace, SubjectParser<T> subjectParser) Used to register a provider that is capable of responding to currency pair order configuration requests made by brokers on non-standard subjects.- Parameters:
provider
- The JsonDataProvider that will receive the currency pair configuration requestsnamespace
- A namespace that matches the format of your custom subjectssubjectParser
- A parser that will turn the requested subject into your own custom subclass ofSubjectInfo
-
FXTradeAdapter.registerAllocateTradeListenerFactory(AllocateTradeListenerFactory)