public class ServerEventManager extends Object
| Constructor and Description |
|---|
ServerEventManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnection(io.undertow.server.handlers.sse.ServerSentEventConnection connection)
Adds a new connection to the manager
|
void |
close(String uri)
Closes all connections for a given URI resource
|
Set<io.undertow.server.handlers.sse.ServerSentEventConnection> |
getConnections(String uri)
Retrieves all connection resources under a given URL
|
void |
removeConnections(String uri)
Removes all URI resources for a given URL
|
void |
send(String uri,
String data)
Sends data to all connections for a given URI resource
|
void |
send(String uri,
String data,
io.undertow.server.handlers.sse.ServerSentEventConnection.EventCallback eventCallback)
Sends data to all connections for a given URI and invokes the callback
on Success or failure
|
void |
setConnections(String uri,
Set<io.undertow.server.handlers.sse.ServerSentEventConnection> uriConnections)
Sets the URI resources for a given URL
|
public void addConnection(io.undertow.server.handlers.sse.ServerSentEventConnection connection)
connection - The connection to putpublic void send(String uri, String data)
uri - The URI resource for the connectiondata - The event datapublic void send(String uri, String data, io.undertow.server.handlers.sse.ServerSentEventConnection.EventCallback eventCallback)
uri - The URI resource for the connectiondata - The event dataeventCallback - A callback that is notified on Success or failurepublic void close(String uri)
uri - The URI resource for the connectionpublic Set<io.undertow.server.handlers.sse.ServerSentEventConnection> getConnections(String uri)
uri - The URI resource for the connectionspublic void setConnections(String uri, Set<io.undertow.server.handlers.sse.ServerSentEventConnection> uriConnections)
uri - The URI resource for the connectionuriConnections - The connections for the URI resourcepublic void removeConnections(String uri)
uri - The URI resource for the connectionCopyright © 2016. All rights reserved.