Package velox.api.layer1
Interface Layer1ApiInstrumentAdapter
- All Superinterfaces:
Layer1ApiInstrumentListener
- All Known Subinterfaces:
Layer1ApiAdapter
,StrategyUpdateGenerator
public interface Layer1ApiInstrumentAdapter extends Layer1ApiInstrumentListener
Provides default empty implementations.
-
Method Summary
Modifier and Type Method Description default void
onInstrumentAdded(java.lang.String alias, InstrumentInfo instrumentInfo)
Indicates successful subscription to the instrumentdefault void
onInstrumentAlreadySubscribed(java.lang.String symbol, java.lang.String exchange, java.lang.String type)
Indicates that attempt to subscribe failed because subscription is already activedefault void
onInstrumentNotFound(java.lang.String symbol, java.lang.String exchange, java.lang.String type)
Indicates that attempt to subscribe failed because instrument does not existdefault 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.
-
Method Details
-
onInstrumentAdded
Description copied from interface:Layer1ApiInstrumentListener
Indicates successful subscription to the instrument- Specified by:
onInstrumentAdded
in interfaceLayer1ApiInstrumentListener
- Parameters:
alias
- instrument aliasinstrumentInfo
- instrument specifications
-
onInstrumentRemoved
default void onInstrumentRemoved(java.lang.String alias)Description copied from interface:Layer1ApiInstrumentListener
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 getLayer1ApiInstrumentListener.onInstrumentRemoved(String)
in the middle ofOnlineCalculatable
request- Specified by:
onInstrumentRemoved
in interfaceLayer1ApiInstrumentListener
-
onInstrumentNotFound
default void onInstrumentNotFound(java.lang.String symbol, java.lang.String exchange, java.lang.String type)Description copied from interface:Layer1ApiInstrumentListener
Indicates that attempt to subscribe failed because instrument does not exist- Specified by:
onInstrumentNotFound
in interfaceLayer1ApiInstrumentListener
type
- seeInstrumentCoreInfo.type
-
onInstrumentAlreadySubscribed
default void onInstrumentAlreadySubscribed(java.lang.String symbol, java.lang.String exchange, java.lang.String type)Description copied from interface:Layer1ApiInstrumentListener
Indicates that attempt to subscribe failed because subscription is already active- Specified by:
onInstrumentAlreadySubscribed
in interfaceLayer1ApiInstrumentListener
type
- seeInstrumentCoreInfo.type
-