Class ServerRpcHandler.RpcRequest
java.lang.Object
com.vaadin.flow.server.communication.ServerRpcHandler.RpcRequest
- All Implemented Interfaces:
Serializable
- Enclosing class:
- ServerRpcHandler
A data transfer object representing an RPC request sent by the client
side.
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRpcRequest
(String jsonString, boolean isSyncIdCheckEnabled) RpcRequest
(String jsonString, VaadinRequest request) Creates an instance based on the given JSON received through the given request. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the id of the client to server message.Gets the CSRF security token (synchronizer token pattern) for this request.elemental.json.JsonObject
Gets the entire request in JSON format, as it was received from the client.elemental.json.JsonArray
Gets the data to recreate the RPC as requested by the client side.int
Gets the sync id last seen by the client.boolean
Checks if this is a request to resynchronize the client side.
-
Constructor Details
-
RpcRequest
Creates an instance based on the given JSON received through the given request.- Parameters:
jsonString
- the JSON containing the RPC invocationsrequest
- the request through which the JSON was received
-
RpcRequest
-
-
Method Details
-
getCsrfToken
Gets the CSRF security token (synchronizer token pattern) for this request.- Returns:
- the CSRF security token for this current change request
-
getRpcInvocationsData
public elemental.json.JsonArray getRpcInvocationsData()Gets the data to recreate the RPC as requested by the client side.- Returns:
- the data describing which RPC should be made, and all their data
-
getSyncId
public int getSyncId()Gets the sync id last seen by the client.- Returns:
- the last sync id given by the server, according to the client's request
-
isResynchronize
public boolean isResynchronize()Checks if this is a request to resynchronize the client side.- Returns:
- true if this is a resynchronization request, false otherwise
-
getClientToServerId
public int getClientToServerId()Gets the id of the client to server message.- Returns:
- the server message id
-
getRawJson
public elemental.json.JsonObject getRawJson()Gets the entire request in JSON format, as it was received from the client.Note: This is a shared reference - any modifications made will be shared.
- Returns:
- the raw JSON object that was received from the client
-