Package com.caplin.motif.fx.orders
Class FXOrderAdapter
- java.lang.Object
-
- com.caplin.motif.datasource.CachedAdapter
-
- com.caplin.motif.fx.orders.FXOrderAdapter
-
public class FXOrderAdapter extends CachedAdapter
-
-
Constructor Summary
Constructors Constructor Description FXOrderAdapter(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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addUserSessionListener(UserSessionListener listener)
Adds a listener that will be notified whenever a user session is created and closed.void
registerBulkOrderActionTradeListenerFactory(BulkOrderActionTradeListenerFactory factory)
Registers a factory that will listen to Bulk Order Action Trade workflows initiated from the client.void
registerBulkOrderSubmissionTradeListenerFactory(BulkOrderSubmissionTradeListenerFactory factory)
Registers a factory that will listen to Bulk Order Submission Trade workflows initiated from the client.void
registerEditStrategyTradeListenerFactory(EditStrategyTradeListenerFactory factory)
Registers a factory that will listen to Edit Strategy Trade workflows initiated from the client.void
registerOrderChangeStateTradeListenerFactory(OrderChangeStateTradeListenerFactory factory)
Registers a factory that will listen to Order Change State Trade workflows initiated from the client.void
registerOrderDetailsProvider(CachedMessageProvider<OrderSubjectInfo> provider)
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
registerOrderSubmissionTradeListenerFactory(OrderSubmissionTradeListenerFactory factory)
Registers a factory that will listen to Order Submission Trade workflows initiated from the client.void
registerPostTradeAllocationTradeListenerFactory(PostTradeAllocationTradeListenerFactory factory)
Deprecated.use the newer spec associated with the trade adapter atFXTradeAdapter.registerAllocateTradeListenerFactory(AllocateTradeListenerFactory)
void
registerSalesOrderDetailsProvider(CachedMessageProvider<OrderSubjectInfo> provider)
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
removeUserSessionListener(UserSessionListener listener)
Removes a listener UserSessionListener to stop receiving session events.-
Methods inherited from class com.caplin.motif.datasource.CachedAdapter
clearCache, createActivePublisher, createActivePublisher, createCachedPublisher, createCachedPublisher, createCachedPublisher, createCachedPublisher
-
-
-
-
Constructor Detail
-
FXOrderAdapter
public FXOrderAdapter(com.caplin.datasource.DataSource dataSource) throws IOException
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
public FXOrderAdapter(TradeAdapter tradeAdapter)
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 Detail
-
addUserSessionListener
public void addUserSessionListener(UserSessionListener listener)
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
public void removeUserSessionListener(UserSessionListener listener)
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
public void registerEditStrategyTradeListenerFactory(EditStrategyTradeListenerFactory factory)
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
public void registerOrderDetailsProvider(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)
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
public void registerSalesOrderDetailsProvider(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)
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
-
-