Interface LocalServiceSpi
public interface LocalServiceSpi
Distributed local service extension able to communicate with a distributed remote plugin
extension.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
connect
(LocalServiceApi localServiceApi) Connects the associated Keyple CoreLocalServiceApi
API.int
exchangeApiLevel
(int coreApiLevel) Exchanges the JSON API levels between the Keyple Core and Distributed layers.getName()
Gets the name of the distributed local service extension.void
onPluginEvent
(String readerName, String jsonData) Invoked when a plugin event occurs in order to be forwarded to the remote plugin.void
onReaderEvent
(String readerName, String jsonData) Invoked when a reader event occurs in order to be forwarded to the remote plugin.
-
Method Details
-
connect
Connects the associated Keyple CoreLocalServiceApi
API.- Parameters:
localServiceApi
- The API to connect.- Since:
- 2.0.0
-
getName
String getName()Gets the name of the distributed local service extension.- Returns:
- A not empty string.
- Since:
- 2.0.0
-
exchangeApiLevel
int exchangeApiLevel(int coreApiLevel) Exchanges the JSON API levels between the Keyple Core and Distributed layers.- Parameters:
coreApiLevel
- The JSON API level of the Core layer.- Returns:
- The JSON API level of the Distributed layer.
- Since:
- 2.1.0
-
onPluginEvent
Invoked when a plugin event occurs in order to be forwarded to the remote plugin.This method will only be invoked if the start reader detection functional method has been previously invoked in order to activate the observation of all local plugins.
- Parameters:
readerName
- The name of the associated local reader.jsonData
- The plugin event as a JSON data to forward to the remote plugin.- Since:
- 2.0.0
-
onReaderEvent
Invoked when a reader event occurs in order to be forwarded to the remote plugin.This method will only be invoked if the start cart detection functional method has been previously invoked in order to activate the observation of a specific local reader.
- Parameters:
readerName
- The name of the associated local reader.jsonData
- The reader event as a JSON data to forward to the remote plugin.- Since:
- 2.0.0
-