Class ServerRpcHandler
java.lang.Object
com.vaadin.flow.server.communication.ServerRpcHandler
- All Implemented Interfaces:
Serializable
Handles a client-to-server message containing serialized RPC invocations.
For internal use only. May be renamed or removed in a future release.
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException thrown when the client side re-sends the same request.static classException thrown then the security key sent by the client does not match the expected one.static classException thrown then the client side resynchronization is required.static classA data transfer object representing an RPC request sent by the client side. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String, RpcInvocationHandler> GetsRpcInvocationHandlers map where the key is the type of the handler gotten viaRpcInvocationHandler.getRpcType().protected StringgetMessage(Reader reader) voidhandleRpc(UI ui, Reader reader, VaadinRequest request) Reads JSON containing zero or more serialized RPC calls (including legacy variable changes) and executes the calls.voidhandleRpc(UI ui, String message, VaadinRequest request) Reads JSON containing zero or more serialized RPC calls (including legacy variable changes) and executes the calls.
-
Constructor Details
-
ServerRpcHandler
public ServerRpcHandler()
-
-
Method Details
-
handleRpc
public void handleRpc(UI ui, Reader reader, VaadinRequest request) throws IOException, ServerRpcHandler.InvalidUIDLSecurityKeyException Reads JSON containing zero or more serialized RPC calls (including legacy variable changes) and executes the calls.- Parameters:
ui- TheUIreceiving the calls. Cannot be null.reader- TheReaderused to read the JSON.request- The request through which the RPC was received- Throws:
IOException- If reading the message fails.ServerRpcHandler.InvalidUIDLSecurityKeyException- If the received security key does not match the one stored in the session.
-
handleRpc
public void handleRpc(UI ui, String message, VaadinRequest request) throws ServerRpcHandler.InvalidUIDLSecurityKeyException Reads JSON containing zero or more serialized RPC calls (including legacy variable changes) and executes the calls.- Parameters:
ui- TheUIreceiving the calls. Cannot be null.message- The JSON message from the request.request- The request through which the RPC was received- Throws:
ServerRpcHandler.InvalidUIDLSecurityKeyException- If the received security key does not match the one stored in the session.
-
getInvocationHandlers
GetsRpcInvocationHandlers map where the key is the type of the handler gotten viaRpcInvocationHandler.getRpcType().This map is used to delegate RPC requests to a specific invocation handler using the type of the request.
Subclasses can overwrite this method to return custom invocation handlers.
- Returns:
- invocation handlers map
-
getMessage
- Throws:
IOException
-