Package com.caplin.motif.mm.rates
Class MMRatesAdapter
java.lang.Object
com.caplin.motif.datasource.CachedAdapter
com.caplin.motif.mm.rates.MMRatesAdapter
An MMRatesAdapter services rate streaming for ESP rates. The adapter also supports streaming prices for broken dates.
Typically, an MMRatesAdapter will be setup as follows:
MMRatesAdapter adapter = new MMRatesAdapter(dataSource);
-
Field Summary
Fields inherited from class com.caplin.motif.datasource.CachedAdapter
dataSource
-
Constructor Summary
ConstructorDescriptionMMRatesAdapter
(com.caplin.datasource.DataSource dataSource) Constructs an MMRatesAdapter that will utilise the specified DataSource and its configuration for communication with the motif. -
Method Summary
Modifier and TypeMethodDescriptioncreateNoticeRatesQuotePublisher
(String namespace, CachedDataProvider<NoticeRateSubjectInfo> provider) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.createNoticeRatesQuotePublisher
(String namespace, CachedDataProvider<NoticeRateSubjectInfo> provider, boolean sendDiscardAfterError) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.createNoticeRatesQuotePublisherWithSubjectParser
(String namespace, CachedDataProvider<NoticeRateSubjectInfo> provider, NoticeRateSubjectParser subjectParser) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.createNoticeRatesQuotePublisherWithSubjectParser
(String namespace, CachedDataProvider<NoticeRateSubjectInfo> provider, NoticeRateSubjectParser subjectParser, boolean sendDiscardAfterError) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.createQuotePublisher
(String namespace, CachedDataProvider<RateSubjectInfo> provider) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.createQuotePublisher
(String namespace, CachedDataProvider<RateSubjectInfo> provider, boolean sendDiscardAfterError) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.createQuotePublisherWithSubjectParser
(String namespace, CachedDataProvider<RateSubjectInfo> provider, RateSubjectParser subjectParser) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.createQuotePublisherWithSubjectParser
(String namespace, CachedDataProvider<RateSubjectInfo> provider, RateSubjectParser subjectParser, boolean sendDiscardAfterError) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.Methods inherited from class com.caplin.motif.datasource.CachedAdapter
clearCache, createActivePublisher, createActivePublisher, createCachedPublisher, createCachedPublisher, createCachedPublisher, createCachedPublisher
-
Constructor Details
-
MMRatesAdapter
public MMRatesAdapter(com.caplin.datasource.DataSource dataSource) Constructs an MMRatesAdapter 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 rates. As well as requests for prices on Broken Dates.
-
-
Method Details
-
createQuotePublisher
public SubjectMessagePublisher<RateSubjectInfo> createQuotePublisher(String namespace, CachedDataProvider<RateSubjectInfo> provider, boolean sendDiscardAfterError) Creates an MMQuotePublisher 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 inRateSubjectNamespacing.DefaultNamespaces
provider
- the CachedDataProvider that will receive the rate requestssendDiscardAfterError
- If set to TRUE, your CachedDataProvider will receive an immediate callback on theCachedDataProvider.onDiscard(SubjectInfo)
method after you publish a failure message by callingSubjectMessagePublisher.sendNotFound(SubjectInfo)
. This can be useful if you want to use the same code path to clear a cache (for example) whether a subscription is ended by the client discarding it or the back end you are integrating with no longer providing the data.- Returns:
- the MMQuotePublisher able to send quotes containing rates
-
createQuotePublisher
public SubjectMessagePublisher<RateSubjectInfo> createQuotePublisher(String namespace, CachedDataProvider<RateSubjectInfo> provider) Creates an MMQuotePublisher 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 inRateSubjectNamespacing.DefaultNamespaces
provider
- the CachedDataProvider that will receive the rate requests- Returns:
- the MMQuotePublisher able to send quotes containing rates
-
createQuotePublisherWithSubjectParser
public SubjectMessagePublisher<RateSubjectInfo> createQuotePublisherWithSubjectParser(String namespace, CachedDataProvider<RateSubjectInfo> provider, RateSubjectParser subjectParser) Creates an MMQuotePublisher 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 inRateSubjectNamespacing.DefaultNamespaces
provider
- the CachedDataProvider that will receive the rate requestssubjectParser
- the parser that will parse rate subject requests into an object representation of the request.- Returns:
- the MMQuotePublisher able to send quotes containing rates
-
createQuotePublisherWithSubjectParser
public SubjectMessagePublisher<RateSubjectInfo> createQuotePublisherWithSubjectParser(String namespace, CachedDataProvider<RateSubjectInfo> provider, RateSubjectParser subjectParser, boolean sendDiscardAfterError) Creates an MMQuotePublisher 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 inRateSubjectNamespacing.DefaultNamespaces
provider
- the CachedDataProvider that will receive the rate requestssubjectParser
- the parser that will parse rate subject requests into an object representation of the request.sendDiscardAfterError
- If set to TRUE, your CachedDataProvider will receive an immediate callback on theCachedDataProvider.onDiscard(SubjectInfo)
method after you publish a failure message by callingSubjectMessagePublisher.sendNotFound(SubjectInfo)
. This can be useful if you want to use the same code path to clear a cache (for example) whether a subscription is ended by the client discarding it or the back end you are integrating with no longer providing the data.- Returns:
- the MMQuotePublisher able to send quotes containing rates
-
createNoticeRatesQuotePublisher
public SubjectMessagePublisher<NoticeRateSubjectInfo> createNoticeRatesQuotePublisher(String namespace, CachedDataProvider<NoticeRateSubjectInfo> provider, boolean sendDiscardAfterError) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.- Parameters:
namespace
- the namespace to provide notice rates for, defaults are defined inRateSubjectNamespacing.DefaultNamespaces
provider
- the CachedDataProvider that will receive the notice rate requestssendDiscardAfterError
- If set to TRUE, your CachedDataProvider will receive an immediate callback on theCachedDataProvider.onDiscard(SubjectInfo)
method after you publish a failure message by callingSubjectMessagePublisher.sendNotFound(SubjectInfo)
. This can be useful if you want to use the same code path to clear a cache (for example) whether a subscription is ended by the client discarding it or the back end you are integrating with no longer providing the data.- Returns:
- the MMQuotePublisher able to send quotes containing notice rates
-
createNoticeRatesQuotePublisher
public SubjectMessagePublisher<NoticeRateSubjectInfo> createNoticeRatesQuotePublisher(String namespace, CachedDataProvider<NoticeRateSubjectInfo> provider) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.- Parameters:
namespace
- the namespace to provide notice rates for, defaults are defined inRateSubjectNamespacing.DefaultNamespaces
provider
- the CachedDataProvider that will receive the notice rate requests- Returns:
- the MMQuotePublisher able to send quotes containing notice rates
-
createNoticeRatesQuotePublisherWithSubjectParser
public SubjectMessagePublisher<NoticeRateSubjectInfo> createNoticeRatesQuotePublisherWithSubjectParser(String namespace, CachedDataProvider<NoticeRateSubjectInfo> provider, NoticeRateSubjectParser subjectParser) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.- Parameters:
namespace
- the namespace to provide notice rates for, defaults are defined inRateSubjectNamespacing.DefaultNamespaces
provider
- the CachedDataProvider that will receive the notice rate requestssubjectParser
- the parser that will parse notice rate subject requests into an object representation of the request.- Returns:
- the MMQuotePublisher able to send quotes containing notice rates
-
createNoticeRatesQuotePublisherWithSubjectParser
public SubjectMessagePublisher<NoticeRateSubjectInfo> createNoticeRatesQuotePublisherWithSubjectParser(String namespace, CachedDataProvider<NoticeRateSubjectInfo> provider, NoticeRateSubjectParser subjectParser, boolean sendDiscardAfterError) Creates an MMQuotePublisher that is able to respond to messages received on the CachedDataProvider that is passed in.- Parameters:
namespace
- the namespace to provide notice rates for, defaults are defined inRateSubjectNamespacing.DefaultNamespaces
provider
- the CachedDataProvider that will receive the notice rate requestssubjectParser
- the parser that will parse notice rate subject requests into an object representation of the request.sendDiscardAfterError
- If set to TRUE, your CachedDataProvider will receive an immediate callback on theCachedDataProvider.onDiscard(SubjectInfo)
method after you publish a failure message by callingSubjectMessagePublisher.sendNotFound(SubjectInfo)
. This can be useful if you want to use the same code path to clear a cache (for example) whether a subscription is ended by the client discarding it or the back end you are integrating with no longer providing the data.- Returns:
- the MMQuotePublisher able to send quotes containing notice rates
-