Interface Layer1ApiAdminProvider
- All Superinterfaces:
AutoCloseable,Layer1ApiAdminListenable
- All Known Subinterfaces:
Layer1ApiProvider
- All Known Implementing Classes:
ExternalLiveBaseProvider,ExternalReaderBaseProvider,Layer1ApiDepthFreezer,Layer1ApiInjectorRelay,Layer1ApiRelay,Layer1ApiStrategiesEchoMessagesLayer
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Shut down and dispose.longReturns current Unix epoch time.Returns string representing data source.Get information about features that are supported by a provider.voidInitiate login to the platform.@Nullable ObjectsendUserMessage(Object data) Send a downstream event.Methods inherited from interface velox.api.layer1.Layer1ApiAdminListenable
addListener, removeListener
-
Method Details
-
getSupportedFeatures
Layer1ApiProviderSupportedFeatures getSupportedFeatures()Get information about features that are supported by a provider. Note that some fields might be set differently depending on when request is made. E.g. adapter might not know if trading will be there until login actually happens.
If you are writing a provider - take a look at
MaximumSupportedFeaturesas a way to declare full list of capabilities before being instantiated- Returns:
- object describing supported features
- See Also:
-
login
Initiate login to the platform.- Parameters:
loginData- credentials, different platforms use different subclasses
-
getCurrentTime
long getCurrentTime()Returns current Unix epoch time. This method allows time distortions if consumer is too slow - in this case time of the next event may be returned.- Returns:
- current Unix epoch time in nanoseconds
-
getSource
String getSource()Returns string representing data source.- Returns:
- string representing data source
-
sendUserMessage
Send a downstream event. Allows incorporating arbitrary functionality into protocol.This is the extension point of the downstream direction: the caller hands an arbitrary object to the layer below, which either handles it or passes it further down. The counterpart for the upstream direction is
Layer1ApiAdminListener.onUserMessage(Object).The call is synchronously propagated downstream. It must eventually be consumed by a layer, that will stop propagation and return the result back upwards. Layers are also allowed to alter it without consuming. Layers that do not recognize a message must forward it unchanged (see
Layer1ApiRelay). Messages that implementLayer1ApiIgnorableDownwardMessagemay reach the bottom of the stack unhandled. All others throw if unhandled.Some messages are requests whose reply is not the return value but an upstream
onUserMessagethat arrives later, possibly after this method has returned.- Parameters:
data- Message content, never null- Returns:
- response of the handling layer, or null if the message has no synchronous response or nobody handled it
-
close
void close()Shut down and dispose. For details on the provider lifecycle, check out the Javadoc ofExternalLiveBaseProviderandExternalReaderBaseProviderfor Live and Replay external modules respectively.In a layer chain this call propagates downwards: a layer closes the provider below it and then stops forwarding upstream events.
- Specified by:
closein interfaceAutoCloseable
-