Package velox.api.layer1
Interface Layer1ApiInstrumentListener
- All Known Subinterfaces:
Layer1ApiAdapter,Layer1ApiInstrumentAdapter,Layer1ApiListener,StrategyUpdateGenerator
- All Known Implementing Classes:
Layer1ApiDepthFreezer,Layer1ApiInjectorRelay,Layer1ApiRelay,Layer1ApiStrategiesEchoMessagesLayer,Layer1ApiUpstreamRelay
@DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
public interface Layer1ApiInstrumentListener
Listener for instrument events
-
Method Summary
Modifier and TypeMethodDescriptionvoidonInstrumentAdded(String alias, InstrumentInfo instrumentInfo) Indicates successful subscription to the instrumentvoidonInstrumentAlreadySubscribed(String symbol, @Nullable String exchange, String type) Indicates that attempt to subscribe failed because subscription is already activevoidonInstrumentNotFound(String symbol, @Nullable String exchange, String type) Indicates that attempt to subscribe failed because instrument does not existvoidonInstrumentRemoved(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
Indicates successful subscription to the instrument- Parameters:
alias- instrument aliasinstrumentInfo- instrument specifications
-
onInstrumentRemoved
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. The reason is that you can getonInstrumentRemoved(String)in the middle ofOnlineCalculatablerequest- Parameters:
alias-
-
onInstrumentNotFound
Indicates that attempt to subscribe failed because instrument does not exist- Parameters:
symbol-exchange-type- seeInstrumentCoreInfo.type
-
onInstrumentAlreadySubscribed
Indicates that attempt to subscribe failed because subscription is already active- Parameters:
symbol-exchange-type- seeInstrumentCoreInfo.type
-