com.vaadin.flow.server.communication.
Class ServerRpcHandler
- java.lang.Object
-
- com.vaadin.flow.server.communication.ServerRpcHandler
-
All Implemented Interfaces:
public class ServerRpcHandler extends Object implements Serializable
Handles a client-to-server message containing serialized RPC invocations.
Since:
1.0
Author:
Vaadin Ltd
See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
ServerRpcHandler.InvalidUIDLSecurityKeyException
Exception thrown then the security key sent by the client does not match the expected one.
static class
ServerRpcHandler.RpcRequest
A data transfer object representing an RPC request sent by the client side.
-
Field Summary
Fields Modifier and Type Field and Description static String
WIDGETSET_MISMATCH_INFO
-
Constructor Summary
Constructors Constructor and Description ServerRpcHandler()
-
Method Summary
All Methods Modifier and Type Method and Description protected Map<String,RpcInvocationHandler>
getInvocationHandlers()
Gets
RpcInvocationHandler
s map where the key is the type of the handler gotten viaRpcInvocationHandler.getRpcType()
.protected String
getMessage(Reader reader)
void
handleRpc(UI ui, Reader reader, VaadinRequest request)
Reads JSON containing zero or more serialized RPC calls (including legacy variable changes) and executes the calls.
-
-
-
Field Detail
-
WIDGETSET_MISMATCH_INFO
public static final String WIDGETSET_MISMATCH_INFO
See Also:
-
-
Method Detail
-
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
- TheUI
receiving the calls. Cannot be null.reader
- TheReader
used to read the JSON.request
- The request through which the RPC was receivedThrows:
IOException
- If reading the message fails.ServerRpcHandler.InvalidUIDLSecurityKeyException
- If the received security key does not match the one stored in the session.
-
getInvocationHandlers
protected Map<String,RpcInvocationHandler> getInvocationHandlers()
Gets
RpcInvocationHandler
s 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
protected String getMessage(Reader reader) throws IOException
Throws:
-
-