Package org.eclipse.keyple.distributed
Interface AsyncNodeClient
public interface AsyncNodeClient
API of the Node associated to a client endpoint using an asynchronous
network protocol.
Then, you can access it everywhere on the client's side using the getAsyncNode() method of the associated above distributed component.
You must bind this kind of node on the client's side if you plan to use a full duplex communication protocol, such as Web Sockets for example.
Then, you should provide an implementation of the AsyncEndpointClientSpi
SPI in order
to interact with this node.
Keyple provides its own implementations of this interface and manages their lifecycle.
This kind of node can be bind to a all client remote plugins and local services :
LocalServiceClient
RemotePluginClient
Then, you can access it everywhere on the client's side using the getAsyncNode() method of the associated above distributed component.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Must be invoked by theAsyncEndpointClientSpi
endpoint following the closing of a communication session with the server.void
Must be invoked by theAsyncEndpointClientSpi
endpoint if a technical error occurs when sending a message to the server.void
onMessage
(MessageDto message) Must be invoked by theAsyncEndpointClientSpi
endpoint following the reception and deserialization of aMessageDto
from the server.void
Must be invoked by theAsyncEndpointClientSpi
endpoint following the opening of a new communication session with the server.
-
Method Details
-
onOpen
Must be invoked by theAsyncEndpointClientSpi
endpoint following the opening of a new communication session with the server.- Parameters:
sessionId
- The session id previously transmitted to theAsyncEndpointClientSpi
endpoint to open a session.- Since:
- 2.0.0
-
onMessage
Must be invoked by theAsyncEndpointClientSpi
endpoint following the reception and deserialization of aMessageDto
from the server.- Parameters:
message
- The message to process.- Since:
- 2.0.0
-
onClose
Must be invoked by theAsyncEndpointClientSpi
endpoint following the closing of a communication session with the server.- Parameters:
sessionId
- The session id registered during the session opening process.- Since:
- 2.0.0
-
onError
Must be invoked by theAsyncEndpointClientSpi
endpoint if a technical error occurs when sending a message to the server.- Parameters:
sessionId
- The session id registered during the session opening process.error
- The unexpected error.- Since:
- 2.0.0
-