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 and Description |
---|
FXRatesAdapter(com.caplin.datasource.DataSource dataSource)
Constructs an FXRatesAdapter that will utilise the specified
DataSource and its configuration for communication with the motif.
|
Modifier and Type | Method and Description |
---|---|
FXQuotePublisher |
createMetalQuotePublisher(CachedDataProvider<? extends MetalSubjectInfo> provider)
Creates an FXQuotePublisher that is able to respond to messages
received on the CachedDataProvider that is passed in.
|
FXQuotePublisher |
createMetalQuotePublisher(CachedDataProvider<? extends MetalSubjectInfo> provider,
boolean sendDiscardAfterError)
Creates an FXQuotePublisher that is able to respond to messages
received on the CachedDataProvider that is passed in.
|
FXQuotePublisher |
createMetalQuotePublisher(CachedDataProvider<? extends MetalSubjectInfo> provider,
SubjectParser<? extends MetalSubjectInfo> subjectParser)
Creates an FXQuotePublisher that is able to respond to messages
received on the CachedDataProvider that is passed in.
|
FXQuotePublisher |
createMetalQuotePublisher(CachedDataProvider<? extends MetalSubjectInfo> provider,
SubjectParser<? extends MetalSubjectInfo> subjectParser,
boolean sendDiscardAfterError)
Creates an FXQuotePublisher that is able to respond to messages
received on the CachedDataProvider that is passed in.
|
FXQuotePublisher |
createQuotePublisher(CachedDataProvider<? extends FXSubjectInfo> provider)
Creates an FXQuotePublisher that is able to respond to messages
received on the CachedDataProvider that is passed in.
|
FXQuotePublisher |
createQuotePublisher(CachedDataProvider<? extends FXSubjectInfo> provider,
boolean sendDiscardAfterError)
Creates an FXQuotePublisher that is able to respond to messages
received on the CachedDataProvider that is passed in.
|
FXQuotePublisher |
createQuotePublisher(CachedDataProvider<? extends FXSubjectInfo> provider,
SubjectParser<? extends FXSubjectInfo> subjectParser)
Creates an FXQuotePublisher that is able to respond to messages
received on the CachedDataProvider that is passed in.
|
FXQuotePublisher |
createQuotePublisher(CachedDataProvider<? extends FXSubjectInfo> provider,
SubjectParser<? extends FXSubjectInfo> subjectParser,
boolean sendDiscardAfterError)
Creates an FXQuotePublisher that is able to respond to messages
received on the CachedDataProvider that is passed in.
|
clearCache, createActivePublisher, createActivePublisher, createActivePublisher, createActivePublisher
public FXRatesAdapter(com.caplin.datasource.DataSource dataSource)
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.public FXQuotePublisher createQuotePublisher(CachedDataProvider<? extends FXSubjectInfo> provider, SubjectParser<? extends FXSubjectInfo> subjectParser, boolean sendDiscardAfterError)
provider
- the CachedDataProvider that will receive the rate requestssubjectParser
- the parser that will parse FX rate subject requests into an object
representation of the request.sendDiscardAfterError
- If set to TRUE, your CachedDataProvider will receive an
immediate callback on the CachedDataProvider.onDiscard(SubjectInfo)
method
after you publish a failure message by calling FXQuotePublisher.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.public FXQuotePublisher createQuotePublisher(CachedDataProvider<? extends FXSubjectInfo> provider, SubjectParser<? extends FXSubjectInfo> subjectParser)
provider
- the CachedDataProvider that will receive the rate requestssubjectParser
- the parser that will parse FX rate subject requests into an object
representation of the request.public FXQuotePublisher createQuotePublisher(CachedDataProvider<? extends FXSubjectInfo> provider, boolean sendDiscardAfterError)
provider
- the CachedDataProvider that will receive the rate requestssendDiscardAfterError
- If set to TRUE, your CachedDataProvider will receive an
immediate callback on the CachedDataProvider.onDiscard(SubjectInfo)
method
after you publish a failure message by calling FXQuotePublisher.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.public FXQuotePublisher createQuotePublisher(CachedDataProvider<? extends FXSubjectInfo> provider)
provider
- the CachedDataProvider that will receive the rate requestspublic FXQuotePublisher createMetalQuotePublisher(CachedDataProvider<? extends MetalSubjectInfo> provider, SubjectParser<? extends MetalSubjectInfo> subjectParser, boolean sendDiscardAfterError)
provider
- the CachedDataProvider that will receive the metal requestssubjectParser
- the parser that will parse metal subject requests into an object
representation of the request.sendDiscardAfterError
- If set to TRUE, a discard message will be triggered
after a NotFound or Unavailable message is sent
from the publisher.public FXQuotePublisher createMetalQuotePublisher(CachedDataProvider<? extends MetalSubjectInfo> provider, SubjectParser<? extends MetalSubjectInfo> subjectParser)
provider
- the CachedDataProvider that will receive the metal requestssubjectParser
- the parser that will parse metal subject requests into an object
representation of the request.public FXQuotePublisher createMetalQuotePublisher(CachedDataProvider<? extends MetalSubjectInfo> provider, boolean sendDiscardAfterError)
provider
- the CachedDataProvider that will receive the metal requestssendDiscardAfterError
- If set to TRUE, a discard message will be triggered
after a NotFound or Unavailable message is sent
from the publisher.public FXQuotePublisher createMetalQuotePublisher(CachedDataProvider<? extends MetalSubjectInfo> provider)
provider
- the CachedDataProvider that will receive the metal requestsCopyright © 2015 Caplin Systems.