public class MessageSender extends Object
Internally uses XhrConnection and/or PushConnection for
delivering messages, depending on the application configuration.
| Constructor and Description |
|---|
MessageSender() |
| Modifier and Type | Method and Description |
|---|---|
void |
endRequest() |
static void |
extendLiferaySession()
If on Liferay and logged in, ask the client side session management
JavaScript to extend the session duration.
|
String |
getCommunicationMethodName()
Returns a human readable string representation of the method used to
communicate with the server.
|
boolean |
hasActiveRequest()
Indicates whether or not there are currently active UIDL requests.
|
void |
resynchronize()
Resynchronize the client side, i.e.
|
static void |
runPostRequestHooks(String appId)
Runs possibly registered client side post request hooks.
|
protected void |
send(elemental.json.JsonArray reqInvocations,
elemental.json.JsonObject extraJson)
Makes an UIDL request to the server.
|
void |
send(elemental.json.JsonObject payload)
Sends an asynchronous or synchronous UIDL request to the server using the
given URI.
|
void |
sendInvocationsToServer() |
void |
setClientToServerMessageId(int nextExpectedId,
boolean force)
Used internally to update what the server expects.
|
void |
setConnection(ApplicationConnection connection)
Sets the application connection this instance is connected to.
|
void |
setPushEnabled(boolean enabled)
Sets the status for the push connection.
|
void |
startRequest() |
public void setConnection(ApplicationConnection connection)
connection - the application connection this instance is connected topublic void sendInvocationsToServer()
protected void send(elemental.json.JsonArray reqInvocations,
elemental.json.JsonObject extraJson)
reqInvocations - Data containing RPC invocations and all related information.extraJson - The JsonObject whose parameters are added to the payloadpublic void send(elemental.json.JsonObject payload)
payload - The contents of the request to sendpublic void setPushEnabled(boolean enabled)
enabled - true to enable the push connection;
false to disable the push connection.public void startRequest()
public void endRequest()
public static void runPostRequestHooks(String appId)
appId - public static void extendLiferaySession()
public boolean hasActiveRequest()
public String getCommunicationMethodName()
public void resynchronize()
public void setClientToServerMessageId(int nextExpectedId,
boolean force)
nextExpectedId - the new client id to setforce - true if the id must be updated, false otherwiseCopyright © 2021 Vaadin Ltd. All rights reserved.