Class FXOrdersAdapter

java.lang.Object
com.caplin.motif.fx.trading.orders.FXOrdersAdapter

@Deprecated public class FXOrdersAdapter extends Object
Deprecated.
Prefer to use FXOrderAdapter

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 Details

    • FXOrdersAdapter

      @Deprecated public FXOrdersAdapter(com.caplin.datasource.DataSource dataSource) throws IOException
      Deprecated.

      Constructs an FXOrdersAdapter that will utilise the specified DataSource and its configuration for communication with the motif.

      Uses a default ThreadMode of ThreadMode.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 public FXOrdersAdapter(TradeAdapter tradeAdapter)
      Deprecated.

      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

      Parameters:
      tradeAdapter - The Trade
  • Method Details

    • addUserSessionListener

      @Deprecated public void addUserSessionListener(UserSessionListener listener)
      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 public void removeUserSessionListener(UserSessionListener listener)
      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, see StrategyType for default values
      listenerFactory - 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, see StrategyType for default values
      listenerFactory - The factory that will be asked to create the OrderSubmissionListener
      strategyFactory - 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 validate
      validator - The validator which will validate an OrderStrategy
    • registerCancelationListenerFactory

      @Deprecated public void registerCancelationListenerFactory(OrderCancelationListenerFactory factory)
      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)
      Registers a factory and your own parser implementation that will be asked to create the StrategyDetailsRequestListenerFactory which will listen to strategy detail requests from the client.
      Parameters:
      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.
    • registerStrategyDetailsRequestListenerFactory

      @Deprecated public void registerStrategyDetailsRequestListenerFactory(StrategyDetailsRequestListenerFactory factory)
      Registers a factory that will be asked to create the StrategyDetailsRequestListenerFactory which will listen to strategy detail requests from the client.
      Parameters:
      factory - The factory that will be asked to create the StrategyDetailsRequestListenerFactory
    • registerEditStrategyListenerFactory

      @Deprecated public void registerEditStrategyListenerFactory(EditStrategyListenerFactory factory)
      Deprecated.
      This is due to be replaced
      Registers a factory that will be asked to create the EditStrategyListenerFactory which will listen to Edit Strategy requests from the client.
      Parameters:
      factory - The factory that will be asked to create the EditStrategyListener