Class TradeAdapter


  • public class TradeAdapter
    extends TradeAdapter
    A Trade adapter allows for listeners to listen and receive events when a trade has been initiated for a particular trade protocol.
    • Constructor Detail

      • TradeAdapter

        public TradeAdapter​(com.caplin.datasource.DataSource dataSource,
                            ThreadMode threadMode)
                     throws java.io.IOException
        Constructs the TradeAdapter 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 ESP and RFS trades.
        threadMode - The thread mode to use for trades being made through the Adapter.
        Throws:
        java.io.IOException - If an error occurred reading configuration files for the adapter.
      • TradeAdapter

        public TradeAdapter​(com.caplin.datasource.DataSource dataSource,
                            ThreadMode threadMode,
                            java.util.Properties properties)
                     throws java.io.IOException
        Constructs the TradeAdapter 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 ESP and RFS trades.
        threadMode - The thread mode to use for trades being made through the Adapter.
        properties - The properties file to use when creating the TradingProvider
        Throws:
        java.io.IOException - If an error occurred reading configuration files for the adapter.
      • TradeAdapter

        @Deprecated
        public TradeAdapter​(com.caplin.datasource.DataSource dataSource)
                     throws java.io.IOException
        Deprecated.
        Constructs the TradeAdapter 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 ESP and RFS trades.
        Throws:
        java.io.IOException - If an error occurred reading configuration files for the adapter.
    • Method Detail

      • registerPostAllocationTradeViewListener

        public void registerPostAllocationTradeViewListener​(SubjectParser<AllocationViewEvent> subjectParser,
                                                            PostTradeAllocationViewListener listener)
        Registers the listener that will service the request to view the allocations of an already allocated trade.

        Also registers a parser that will parse the request to a domain specific object.

        Parameters:
        subjectParser - The parser that will parse the clients request to view allocations into a domain specific object.
        listener - The listener that will be called to service the request to view details of already allocated trades.