Class ServerRpcHandler.RpcRequest

java.lang.Object
com.vaadin.flow.server.communication.ServerRpcHandler.RpcRequest
All Implemented Interfaces:
Serializable
Enclosing class:
ServerRpcHandler

public static class ServerRpcHandler.RpcRequest extends Object implements Serializable
A data transfer object representing an RPC request sent by the client side.
Since:
1.0
Author:
Vaadin Ltd
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    RpcRequest(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 Type
    Method
    Description
    int
    Gets the id of the client to server message.
    Gets the CSRF security token (synchronizer token pattern) for this request.
    com.fasterxml.jackson.databind.JsonNode
    Gets the entire request in JSON format, as it was received from the client.
    com.fasterxml.jackson.databind.node.ArrayNode
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RpcRequest

      public RpcRequest(String jsonString, VaadinRequest request)
      Creates an instance based on the given JSON received through the given request.
      Parameters:
      jsonString - the JSON containing the RPC invocations
      request - the request through which the JSON was received
    • RpcRequest

      public RpcRequest(String jsonString, boolean isSyncIdCheckEnabled)
  • Method Details

    • getCsrfToken

      public String getCsrfToken()
      Gets the CSRF security token (synchronizer token pattern) for this request.
      Returns:
      the CSRF security token for this current change request
    • getRpcInvocationsData

      public com.fasterxml.jackson.databind.node.ArrayNode 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 com.fasterxml.jackson.databind.JsonNode 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