public interface Layer1ApiInstrumentAdapter extends Layer1ApiInstrumentListener
Provides default empty implementations.
Modifier and Type | Method and Description |
---|---|
default void |
onInstrumentAdded(java.lang.String alias,
InstrumentInfo instrumentInfo)
Indicates successful subscription to the instrument
|
default 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
|
default 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
|
default void |
onInstrumentRemoved(java.lang.String alias)
Unsubscribed from instrument (user-initiated or provider initiated).
Please note that if you use this in strategy that implements OnlineCalculatable ,
you should not delete any data about instrument that is expected in OnlineCalculatable.calculateValuesInRange(String, String, long, long, int, velox.api.layer1.layers.strategies.interfaces.CalculatedResultListener)
or OnlineCalculatable.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. |
default void onInstrumentAdded(java.lang.String alias, InstrumentInfo instrumentInfo)
Layer1ApiInstrumentListener
onInstrumentAdded
in interface Layer1ApiInstrumentListener
alias
- instrument aliasinstrumentInfo
- instrument specificationsdefault void onInstrumentRemoved(java.lang.String alias)
Layer1ApiInstrumentListener
OnlineCalculatable
,
you should not delete any data about instrument that is expected in OnlineCalculatable.calculateValuesInRange(String, String, long, long, int, velox.api.layer1.layers.strategies.interfaces.CalculatedResultListener)
or OnlineCalculatable.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 get Layer1ApiInstrumentListener.onInstrumentRemoved(String)
in the middle of OnlineCalculatable
requestonInstrumentRemoved
in interface Layer1ApiInstrumentListener
default void onInstrumentNotFound(java.lang.String symbol, java.lang.String exchange, java.lang.String type)
Layer1ApiInstrumentListener
onInstrumentNotFound
in interface Layer1ApiInstrumentListener
type
- see InstrumentCoreInfo.type
default void onInstrumentAlreadySubscribed(java.lang.String symbol, java.lang.String exchange, java.lang.String type)
Layer1ApiInstrumentListener
onInstrumentAlreadySubscribed
in interface Layer1ApiInstrumentListener
type
- see InstrumentCoreInfo.type