public interface ConnectionStateHandler
DefaultConnectionStateHandler.| Modifier and Type | Field and Description |
|---|---|
static String |
UIDL_REFRESH_TOKEN
A string that, if found in a non-JSON response to a UIDL request, will
cause the browser to refresh the page.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configurationUpdated()
Called when some part of the reconnect dialog configuration has been
changed.
|
void |
heartbeatException(com.google.gwt.xhr.client.XMLHttpRequest request,
Exception exception)
Called when an exception occurs during a
Heartbeat request. |
void |
heartbeatInvalidStatusCode(com.google.gwt.xhr.client.XMLHttpRequest xhr)
Called when a heartbeat request returns a status code other than OK
(200).
|
void |
heartbeatOk()
Called when a
Heartbeat request succeeds. |
void |
pushClientTimeout(PushConnection pushConnection,
com.google.gwt.core.client.JavaScriptObject response)
Called when a client side timeout occurs before a push connection to the
server completes.
|
void |
pushClosed(PushConnection pushConnection,
com.google.gwt.core.client.JavaScriptObject responseObject)
Called when the push connection to the server is closed.
|
void |
pushError(PushConnection pushConnection,
com.google.gwt.core.client.JavaScriptObject response)
Called when a fatal error fatal error occurs in the push connection.
|
void |
pushInvalidContent(PushConnection pushConnection,
String message)
Called when invalid content (not JSON) was pushed from the server through
the push connection.
|
void |
pushNotConnected(elemental.json.JsonObject payload)
Called when a message is to be sent to the server through the push
channel but the push channel is not connected.
|
void |
pushOk(PushConnection pushConnection)
Called when the push connection to the server has been established.
|
void |
pushReconnectPending(PushConnection pushConnection)
Called when the push connection has lost the connection to the server and
will proceed to try to re-establish the connection.
|
void |
pushScriptLoadError(String resourceUrl)
Called when the required push script could not be loaded.
|
void |
xhrException(XhrConnectionError xhrConnectionError)
Called when an exception occurs during an XmlHttpRequest request to the
server.
|
void |
xhrInvalidContent(XhrConnectionError xhrConnectionError)
Called when invalid content (not JSON) was returned from the server as
the result of an XmlHttpRequest request.
|
void |
xhrInvalidStatusCode(XhrConnectionError xhrConnectionError)
Called when invalid status code (not 200) was returned by the server as
the result of an XmlHttpRequest.
|
void |
xhrOk()
Called whenever a XmlHttpRequest to the server completes successfully.
|
static final String UIDL_REFRESH_TOKEN
This allows, for instance, a servlet filter to redirect the application to a custom login page when the session expires. For example:
if (sessionExpired) {
response.setHeader("Content-Type", "text/html");
response.getWriter().write(myLoginPageHtml + "<!-- Vaadin-Refresh: "
+ request.getContextPath() + " -->");
}
void heartbeatException(com.google.gwt.xhr.client.XMLHttpRequest request,
Exception exception)
Heartbeat request.request - The heartbeat requestexception - The exception which occurredvoid heartbeatInvalidStatusCode(com.google.gwt.xhr.client.XMLHttpRequest xhr)
xhr - the heartbeat requestvoid heartbeatOk()
Heartbeat request succeeds.void pushClosed(PushConnection pushConnection, com.google.gwt.core.client.JavaScriptObject responseObject)
pushConnection - The push connection which was closedresponseObject - An object containing response datavoid pushClientTimeout(PushConnection pushConnection, com.google.gwt.core.client.JavaScriptObject response)
pushConnection - The push connection which timed outresponse - An object containing response datavoid pushError(PushConnection pushConnection, com.google.gwt.core.client.JavaScriptObject response)
pushConnection - The push connection where the error occurredresponse - An object containing response datavoid pushReconnectPending(PushConnection pushConnection)
pushConnection - The push connection which will be reconnectedvoid pushOk(PushConnection pushConnection)
pushConnection - The push connection which was establishedvoid pushScriptLoadError(String resourceUrl)
resourceUrl - The URL which was used for loading the scriptvoid xhrException(XhrConnectionError xhrConnectionError)
xhrConnectionError - An event containing what was being sent to the server and what
exception occurredvoid xhrInvalidContent(XhrConnectionError xhrConnectionError)
xhrConnectionError - An event containing what was being sent to the server and what
was returnedvoid xhrInvalidStatusCode(XhrConnectionError xhrConnectionError)
xhrConnectionError - An event containing what was being sent to the server and what
was returnedvoid xhrOk()
void pushNotConnected(elemental.json.JsonObject payload)
payload - The payload to send to the servervoid pushInvalidContent(PushConnection pushConnection, String message)
pushConnection - the push connection which was usedmessage - the received messagevoid configurationUpdated()
Copyright © 2000–2018 Vaadin Ltd. All rights reserved.