Package com.vaadin.client.communication
Class ServerConnector
java.lang.Object
com.vaadin.client.communication.ServerConnector
Handles creating and sending messages to the server using
ServerRpcQueue.- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionServerConnector(Registry registry) Creates a new instance connected to the given registry. -
Method Summary
Modifier and TypeMethodDescriptionvoidsendEventMessage(int nodeId, String eventType, elemental.json.JsonObject eventData) Sends an event message to the server.voidsendEventMessage(StateNode node, String eventType, elemental.json.JsonObject eventData) Sends an event message to the server.voidsendExistingElementAttachToServer(StateNode parent, int requestedId, int assignedId, String tagName, int index) Sends a data for attach existing element server side callback.voidsendExistingElementWithIdAttachToServer(StateNode parent, int requestedId, int assignedId, String id) Sends a data for attach existing element with id server side callback.voidsendNavigationMessage(String location, Object stateObject, boolean routerLinkEvent) Sends a navigation message to server.voidsendNodeSyncMessage(StateNode node, int feature, String key, Object value) Sends a node value sync message to the server.voidsendReturnChannelMessage(int stateNodeId, int channelId, elemental.json.JsonArray arguments) Sends a return channel message to the server.voidsendTemplateEventMessage(StateNode node, String methodName, elemental.json.JsonArray argsArray, int promiseId) Sends a template event message to the server.
-
Constructor Details
-
ServerConnector
Creates a new instance connected to the given registry.- Parameters:
registry- the global registry
-
-
Method Details
-
sendEventMessage
Sends an event message to the server.- Parameters:
node- the node that listened to the eventeventType- the type of eventeventData- extra data associated with the event
-
sendEventMessage
Sends an event message to the server.- Parameters:
nodeId- the id of the node that listened to the eventeventType- the type of eventeventData- extra data associated with the event
-
sendTemplateEventMessage
public void sendTemplateEventMessage(StateNode node, String methodName, elemental.json.JsonArray argsArray, int promiseId) Sends a template event message to the server.- Parameters:
node- the node that listened to the eventmethodName- the event handler method name to execute on the server sideargsArray- the arguments array for the methodpromiseId- the promise id to use for getting the result back, or -1 if no result is expected
-
sendNodeSyncMessage
Sends a node value sync message to the server.- Parameters:
node- the node to updatefeature- the id of the node map feature to updatekey- the map key to updatevalue- the new value
-
sendExistingElementAttachToServer
public void sendExistingElementAttachToServer(StateNode parent, int requestedId, int assignedId, String tagName, int index) Sends a data for attach existing element server side callback.- Parameters:
parent- parent of the node to attachrequestedId- originally requested id of a server side nodeassignedId- identifier which should be used on the server side for the element (instead of requestedId)tagName- the requested tagNameindex- the index of the element on the server side
-
sendExistingElementWithIdAttachToServer
public void sendExistingElementWithIdAttachToServer(StateNode parent, int requestedId, int assignedId, String id) Sends a data for attach existing element with id server side callback.- Parameters:
parent- parent of the node to attachrequestedId- originally requested id of a server side nodeassignedId- identifier which should be used on the server side for the element (instead of requestedId)id- id of requested element
-
sendReturnChannelMessage
public void sendReturnChannelMessage(int stateNodeId, int channelId, elemental.json.JsonArray arguments) Sends a return channel message to the server.- Parameters:
stateNodeId- the id of the state node that owns the channel.channelId- the id of the channel.arguments- array of arguments passed to the channel, notnull.