Package velox.api.layer1
Interface Layer1ApiInstrumentListener
- All Known Subinterfaces:
Layer1ApiAdapter
,Layer1ApiInstrumentAdapter
,Layer1ApiListener
,StrategyUpdateGenerator
- All Known Implementing Classes:
Layer1ApiDepthFreezer
,Layer1ApiInjectorRelay
,Layer1ApiRelay
,Layer1ApiStrategiesEchoMessagesLayer
,Layer1ApiUpstreamRelay
public interface Layer1ApiInstrumentListener
Listener for instrument events
-
Method Summary
Modifier and Type Method Description void
onInstrumentAdded(java.lang.String alias, InstrumentInfo instrumentInfo)
Indicates successful subscription to the instrumentvoid
onInstrumentAlreadySubscribed(java.lang.String symbol, java.lang.String exchange, java.lang.String type)
Indicates that attempt to subscribe failed because subscription is already activevoid
onInstrumentNotFound(java.lang.String symbol, java.lang.String exchange, java.lang.String type)
Indicates that attempt to subscribe failed because instrument does not existvoid
onInstrumentRemoved(java.lang.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
void onInstrumentRemoved(java.lang.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. The reason is that you can getonInstrumentRemoved(String)
in the middle ofOnlineCalculatable
request- Parameters:
alias
-
-
onInstrumentNotFound
void onInstrumentNotFound(java.lang.String symbol, java.lang.String exchange, java.lang.String type)Indicates that attempt to subscribe failed because instrument does not exist- Parameters:
symbol
-exchange
-type
- seeInstrumentCoreInfo.type
-
onInstrumentAlreadySubscribed
void onInstrumentAlreadySubscribed(java.lang.String symbol, java.lang.String exchange, java.lang.String type)Indicates that attempt to subscribe failed because subscription is already active- Parameters:
symbol
-exchange
-type
- seeInstrumentCoreInfo.type
-