Package velox.api.layer1
Interface Layer1ApiInstrumentAdapter
- All Superinterfaces:
Layer1ApiInstrumentListener
- All Known Subinterfaces:
Layer1ApiAdapter,StrategyUpdateGenerator
Provides default empty implementations.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonInstrumentAdded(String alias, InstrumentInfo instrumentInfo) Indicates successful subscription to the instrumentdefault voidonInstrumentAlreadySubscribed(String symbol, String exchange, String type) Indicates that attempt to subscribe failed because subscription is already activedefault voidonInstrumentNotFound(String symbol, String exchange, String type) Indicates that attempt to subscribe failed because instrument does not existdefault voidonInstrumentRemoved(String alias) Unsubscribed from instrument (user-initiated or provider initiated).
Please note that if you use this in strategy that implementsOnlineCalculatable, you should not delete any data about instrument that is expected inOnlineCalculatable.calculateValuesInRange(String, String, long, long, int, velox.api.layer1.layers.strategies.interfaces.CalculatedResultListener)orOnlineCalculatable.createOnlineValueCalculator(String, String, long, java.util.function.Consumer, velox.api.layer1.layers.strategies.interfaces.InvalidateInterface), or should handle absence of that data (in case you delete it) gracefully.
-
Method Details
-
onInstrumentAdded
Description copied from interface:Layer1ApiInstrumentListenerIndicates successful subscription to the instrument- Specified by:
onInstrumentAddedin interfaceLayer1ApiInstrumentListener- Parameters:
alias- instrument aliasinstrumentInfo- instrument specifications
-
onInstrumentRemoved
Description copied from interface:Layer1ApiInstrumentListenerUnsubscribed from instrument (user-initiated or provider initiated).
Please note that if you use this in strategy that implementsOnlineCalculatable, you should not delete any data about instrument that is expected inOnlineCalculatable.calculateValuesInRange(String, String, long, long, int, velox.api.layer1.layers.strategies.interfaces.CalculatedResultListener)orOnlineCalculatable.createOnlineValueCalculator(String, String, long, java.util.function.Consumer, velox.api.layer1.layers.strategies.interfaces.InvalidateInterface), or should handle absence of that data (in case you delete it) gracefully. The reason is that you can getLayer1ApiInstrumentListener.onInstrumentRemoved(String)in the middle ofOnlineCalculatablerequest- Specified by:
onInstrumentRemovedin interfaceLayer1ApiInstrumentListener
-
onInstrumentNotFound
Description copied from interface:Layer1ApiInstrumentListenerIndicates that attempt to subscribe failed because instrument does not exist- Specified by:
onInstrumentNotFoundin interfaceLayer1ApiInstrumentListenertype- seeInstrumentCoreInfo.type
-
onInstrumentAlreadySubscribed
Description copied from interface:Layer1ApiInstrumentListenerIndicates that attempt to subscribe failed because subscription is already active- Specified by:
onInstrumentAlreadySubscribedin interfaceLayer1ApiInstrumentListenertype- seeInstrumentCoreInfo.type
-