com.vaadin.server.communication
Class ServerRpcHandler

java.lang.Object
  extended by com.vaadin.server.communication.ServerRpcHandler
All Implemented Interfaces:
java.io.Serializable

public class ServerRpcHandler
extends java.lang.Object
implements java.io.Serializable

Handles a client-to-server message containing serialized server RPC invocations.

Since:
7.1
Author:
Vaadin Ltd
See Also:
Serialized Form

Field Summary
static char VAR_BURST_SEPARATOR
           
static char VAR_ESCAPE_CHARACTER
           
 
Constructor Summary
ServerRpcHandler()
           
 
Method Summary
protected  void changeVariables(java.lang.Object source, VariableOwner owner, java.util.Map<java.lang.String,java.lang.Object> m)
           
protected  java.lang.String getMessage(java.io.Reader reader)
           
 void handleRpc(UI ui, java.io.Reader reader, VaadinRequest request)
          Reads JSON containing zero or more serialized RPC calls (including legacy variable changes) and executes the calls.
protected  java.lang.String unescapeBurst(java.lang.String encodedValue)
          Unescape encoded burst separator characters in a burst received from the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VAR_BURST_SEPARATOR

public static final char VAR_BURST_SEPARATOR
See Also:
Constant Field Values

VAR_ESCAPE_CHARACTER

public static final char VAR_ESCAPE_CHARACTER
See Also:
Constant Field Values
Constructor Detail

ServerRpcHandler

public ServerRpcHandler()
Method Detail

handleRpc

public void handleRpc(UI ui,
                      java.io.Reader reader,
                      VaadinRequest request)
               throws java.io.IOException,
                      LegacyCommunicationManager.InvalidUIDLSecurityKeyException,
                      org.json.JSONException
Reads JSON containing zero or more serialized RPC calls (including legacy variable changes) and executes the calls.

Parameters:
ui - The UI receiving the calls. Cannot be null.
reader - The Reader used to read the JSON.
request -
Throws:
java.io.IOException - If reading the message fails.
LegacyCommunicationManager.InvalidUIDLSecurityKeyException - If the received security key does not match the one stored in the session.
org.json.JSONException - If deserializing the JSON fails.

changeVariables

protected void changeVariables(java.lang.Object source,
                               VariableOwner owner,
                               java.util.Map<java.lang.String,java.lang.Object> m)

unescapeBurst

protected java.lang.String unescapeBurst(java.lang.String encodedValue)
Unescape encoded burst separator characters in a burst received from the client. This protects from separator injection attacks.

Parameters:
encodedValue - to decode
Returns:
decoded value

getMessage

protected java.lang.String getMessage(java.io.Reader reader)
                               throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.