public interface PushConnection
ApplicationConnection.| Modifier and Type | Method and Description |
|---|---|
void |
disconnect(com.google.gwt.user.client.Command command)
Closes the push connection.
|
String |
getTransportType()
Returns a human readable string representation of the transport type used
to communicate with the server.
|
void |
init(ApplicationConnection connection,
UIState.PushConfigurationState pushConfigurationState)
Two-phase construction to allow using GWT.create().
|
boolean |
isActive()
Checks whether this push connection is in a state where it can push
messages to the server.
|
boolean |
isBidirectional()
Checks whether this push connection should be used for communication in
both directions or if an XHR should be used for client to server
communication.
|
void |
push(elemental.json.JsonObject payload)
Pushes a message to the server.
|
void init(ApplicationConnection connection, UIState.PushConfigurationState pushConfigurationState)
connection - The ApplicationConnectionvoid push(elemental.json.JsonObject payload)
isActive()).
Implementation detail: If the push connection is not connected and the
message can thus not be sent, the implementation must call
ConnectionStateHandler.pushNotConnected(JsonObject), which will
retry the send later.
This method must not be called if the push connection is not
bidirectional (if isBidirectional() returns false)
payload - the payload to pushIllegalStateException - if this connection is not activeisActive()boolean isActive()
disconnect(Command) has been called.true if this connection can accept new messages;
false if this connection is disconnected or
disconnecting.void disconnect(com.google.gwt.user.client.Command command)
After this method has been called, isActive() returns
false. Calling this method for a connection that is no
longer active will throw an exception.
command - callback command invoked when the connection has been properly
disconnectedIllegalStateException - if this connection is not activeString getTransportType()
boolean isBidirectional()
Copyright © 2021 Vaadin Ltd. All rights reserved.