public static class EventSourceResource.EventSource extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection to the client.
|
EventSourceResource.EventSource |
data(String data)
Sends a
data message. |
EventSourceResource.EventSource |
end()
Ends a data message.
|
EventSourceResource.EventSource |
event(String eventName)
Switches the current event.
|
org.apache.wicket.request.mapper.parameter.PageParameters |
getParameters() |
EventSourceResource.EventSource |
id(String id)
Sends an
id message. |
boolean |
isClosed()
Checks whether the connection to the client is closed..
|
EventSourceResource.EventSource |
raw(String rawData)
Sends a raw data to the client.
|
EventSourceResource.EventSource |
retry(org.apache.wicket.util.time.Duration retryTimeout)
Sends a
retry message. |
public EventSourceResource.EventSource event(String eventName)
eventName - the name of new eventthis object, for chainingpublic EventSourceResource.EventSource data(String data)
data message.
Must be followed by EventSource#end() call to finish the sending of data.data - the data of new eventthis object, for chainingpublic EventSourceResource.EventSource id(String id)
id message.id - the new idthis object, for chainingpublic EventSourceResource.EventSource retry(org.apache.wicket.util.time.Duration retryTimeout)
retry message.retryTimeout - how many millis to wait before the client to try to reconnectthis object, for chainingpublic EventSourceResource.EventSource raw(String rawData)
rawData - the raw data to send to the clientthis object, for chainingpublic EventSourceResource.EventSource end()
this object, for chainingpublic void close()
public final org.apache.wicket.request.mapper.parameter.PageParameters getParameters()
public final boolean isClosed()
true if the connection is closed, false otherwiseCopyright © 2015. All rights reserved.