Class SimpleWebSocketConnectionRegistry
- java.lang.Object
-
- org.apache.wicket.protocol.ws.api.registry.SimpleWebSocketConnectionRegistry
-
- All Implemented Interfaces:
IWebSocketConnectionRegistry
public class SimpleWebSocketConnectionRegistry extends java.lang.Object implements IWebSocketConnectionRegistry
A registry that keeps all currently opened web socket connections in maps in Application's meta data.- Since:
- 6.0
-
-
Constructor Summary
Constructors Constructor Description SimpleWebSocketConnectionRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IWebSocketConnectiongetConnection(org.apache.wicket.Application application, java.lang.String sessionId, IKey key)java.util.Collection<IWebSocketConnection>getConnections(org.apache.wicket.Application application)Returns a collection of currently active websockets.java.util.Collection<IWebSocketConnection>getConnections(org.apache.wicket.Application application, java.lang.String sessionId)voidremoveConnection(org.apache.wicket.Application application, java.lang.String sessionId, IKey key)Removes a web socket connection from the registry at the specified coordinates (application+session+page)voidsetConnection(org.apache.wicket.Application application, java.lang.String sessionId, IKey key, IWebSocketConnection connection)Adds a new connection into the registry at the specified coordinates (application+session+page)
-
-
-
Method Detail
-
getConnection
public IWebSocketConnection getConnection(org.apache.wicket.Application application, java.lang.String sessionId, IKey key)
- Specified by:
getConnectionin interfaceIWebSocketConnectionRegistry- Parameters:
application- the web application to look insessionId- the http session idkey- the web socket client key- Returns:
- the web socket connection used by a client from the specified coordinates
-
getConnections
public java.util.Collection<IWebSocketConnection> getConnections(org.apache.wicket.Application application, java.lang.String sessionId)
- Specified by:
getConnectionsin interfaceIWebSocketConnectionRegistry- Parameters:
application- the web application to look insessionId- the http session id- Returns:
- collection of web socket connection used by a client with the given session id
-
getConnections
public java.util.Collection<IWebSocketConnection> getConnections(org.apache.wicket.Application application)
Returns a collection of currently active websockets. The connections might close at any time.- Specified by:
getConnectionsin interfaceIWebSocketConnectionRegistry- Parameters:
application- The application- Returns:
- a collection of currently active websockets
-
setConnection
public void setConnection(org.apache.wicket.Application application, java.lang.String sessionId, IKey key, IWebSocketConnection connection)Description copied from interface:IWebSocketConnectionRegistryAdds a new connection into the registry at the specified coordinates (application+session+page)- Specified by:
setConnectionin interfaceIWebSocketConnectionRegistry- Parameters:
application- the web application to look insessionId- the http session idkey- the web socket client keyconnection- the web socket connection to add
-
removeConnection
public void removeConnection(org.apache.wicket.Application application, java.lang.String sessionId, IKey key)Description copied from interface:IWebSocketConnectionRegistryRemoves a web socket connection from the registry at the specified coordinates (application+session+page)- Specified by:
removeConnectionin interfaceIWebSocketConnectionRegistry- Parameters:
application- the web application to look insessionId- the http session idkey- the web socket client key
-
-