public class ConnectionsManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.ConcurrentHashMap<java.lang.String,WebsocketConnection> |
_connections |
private static Log |
_logger |
private java.util.concurrent.atomic.AtomicInteger |
connectionsCounter |
private static ConnectionsManager |
connectionsManager |
Constructor and Description |
---|
ConnectionsManager() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addConnection(WebsocketConnection websocketConnection)
Add new connection to list of current ones
|
java.util.Collection<WebsocketConnection> |
getConnections()
Return all the current web socket connections
|
static ConnectionsManager |
getInstance() |
private java.lang.String |
getNewConnectionId() |
private void |
purgeLostConnections() |
void |
removeConnection(WebsocketConnection websocketConnection)
Remove connection from list of current ones.
|
private static Log _logger
private static ConnectionsManager connectionsManager
private final java.util.concurrent.atomic.AtomicInteger connectionsCounter
private final java.util.concurrent.ConcurrentHashMap<java.lang.String,WebsocketConnection> _connections
public static ConnectionsManager getInstance()
public java.lang.String addConnection(WebsocketConnection websocketConnection)
websocketConnection
- - New connection to be added to current onesprivate void purgeLostConnections()
public void removeConnection(WebsocketConnection websocketConnection)
websocketConnection
- - Connection to be removedpublic java.util.Collection<WebsocketConnection> getConnections()
private java.lang.String getNewConnectionId()