Class EventSourceResource.EventSource
java.lang.Object
org.wicketstuff.html5.eventsource.EventSourceResource.EventSource
- Enclosing class:
- EventSourceResource
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the connection to the client.Sends adatamessage.end()Ends a data message.Switches the current event.final PageParametersSends anidmessage.final booleanisClosed()Checks whether the connection to the client is closed..Sends a raw data to the client.Sends aretrymessage.
-
Method Details
-
event
Switches the current event.- Parameters:
eventName- the name of new event- Returns:
thisobject, for chaining
-
data
Sends adatamessage. Must be followed by EventSource#end() call to finish the sending of data.- Parameters:
data- the data of new event- Returns:
thisobject, for chaining
-
id
Sends anidmessage.- Parameters:
id- the new id- Returns:
thisobject, for chaining
-
retry
Sends aretrymessage.- Parameters:
retryTimeout- how many millis to wait before the client to try to reconnect- Returns:
thisobject, for chaining
-
raw
Sends a raw data to the client.- Parameters:
rawData- the raw data to send to the client- Returns:
thisobject, for chaining
-
end
Ends a data message.- Returns:
thisobject, for chaining
-
close
public void close()Closes the connection to the client. -
getParameters
- Returns:
- the request parameters sent by the client when making the connection
-
isClosed
public final boolean isClosed()Checks whether the connection to the client is closed..- Returns:
trueif the connection is closed,falseotherwise
-