Class FXRatesAdapter

java.lang.Object
com.caplin.motif.datasource.CachedAdapter
com.caplin.motif.fx.rates.FXRatesAdapter

public class FXRatesAdapter extends CachedAdapter

An FXRatesAdapter services rate streaming for ESP, SPOT, FORWARD and SWAP rates. The adapter also supports streaming prices for broken dates.

Typically, an FXRatesAdapter will be setup as follows:

 FXRatesAdapter adapter = new FXRatesAdapter(dataSource);
 
  • Constructor Details

    • FXRatesAdapter

      public FXRatesAdapter(com.caplin.datasource.DataSource dataSource)
      Constructs an FXRatesAdapter 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, SPOT, FORWARD and SWAP rates. As well as requests for prices on Broken Dates.
  • Method Details

    • createQuotePublisher

      public FXQuotePublisher createQuotePublisher(String namespace, CachedDataProvider<RateSubjectInfo> provider)
      Creates an FXQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.
      Parameters:
      namespace - the namespace to provide rates for, defaults are defined in RateSubjectNamespacing.DefaultNamespaces
      provider - the CachedDataProvider that will receive the rate requests
      Returns:
      the FXQuotePublisher able to send quotes containing rates
    • createQuotePublisher

      public <T extends RateSubjectInfo> FXQuotePublisher createQuotePublisher(String namespace, CachedDataProvider<T> provider, SubjectParser<T> subjectParser)
      Creates an FXQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.
      Parameters:
      namespace - the namespace to provide rates for, defaults are defined in RateSubjectNamespacing.DefaultNamespaces
      provider - the CachedDataProvider that will receive the rate requests
      subjectParser - the parser that will parse rate subject requests into an object representation of the request.
      Returns:
      the FXQuotePublisher able to send quotes containing rates
    • createQuotePublisher

      public <T extends RateSubjectInfo> FXQuotePublisher createQuotePublisher(com.caplin.datasource.namespace.Namespace namespace, CachedDataProvider<T> provider, SubjectParser<T> subjectParser)
      Creates an FXQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.
      Parameters:
      namespace - a custom namespace to provide rates for
      provider - the CachedDataProvider that will receive the rate requests
      subjectParser - the parser that will parse rate subject requests into an object representation of the request.
      Returns:
      the FXQuotePublisher able to send quotes containing rates