Class SimpleWebSocketConnectionRegistry
java.lang.Object
org.apache.wicket.protocol.ws.api.registry.SimpleWebSocketConnectionRegistry
- All Implemented Interfaces:
IWebSocketConnectionRegistry
public class SimpleWebSocketConnectionRegistry
extends Object
implements IWebSocketConnectionRegistry
A registry that keeps all currently opened web socket connections in
maps in Application's meta data.
- Since:
- 6.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.wicket.protocol.ws.api.registry.IWebSocketConnectionRegistry
IWebSocketConnectionRegistry.IConnectionsFilter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetConnection
(Application application, String sessionId, IKey key) getConnections
(Application application) Returns a collection of currently active websockets.getConnections
(Application application, String sessionId) getConnections
(Application application, IWebSocketConnectionRegistry.IConnectionsFilter connectionsFilter) void
removeConnection
(Application application, String sessionId, IKey key) Removes a web socket connection from the registry at the specified coordinates (application+session+page)void
setConnection
(Application application, String sessionId, IKey key, IWebSocketConnection connection) Adds a new connection into the registry at the specified coordinates (application+session+page)
-
Constructor Details
-
SimpleWebSocketConnectionRegistry
public SimpleWebSocketConnectionRegistry()
-
-
Method Details
-
getConnection
- Specified by:
getConnection
in 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
- Specified by:
getConnections
in interfaceIWebSocketConnectionRegistry
- Parameters:
application
- the web application to look insessionId
- the http session id- Returns:
- collection of web socket connections used by a client with the given session id
-
getConnections
public Collection<IWebSocketConnection> getConnections(Application application, IWebSocketConnectionRegistry.IConnectionsFilter connectionsFilter) - Specified by:
getConnections
in interfaceIWebSocketConnectionRegistry
- Parameters:
application
- the web application to look inconnectionsFilter
- theIWebSocketConnectionRegistry.IConnectionsFilter
- Returns:
- collection of web socket connections that match certain filter
-
getConnections
Returns a collection of currently active websockets. The connections might close at any time.- Specified by:
getConnections
in interfaceIWebSocketConnectionRegistry
- Parameters:
application
- The application- Returns:
- a collection of currently active websockets
-
setConnection
public void setConnection(Application application, String sessionId, IKey key, IWebSocketConnection connection) Description copied from interface:IWebSocketConnectionRegistry
Adds a new connection into the registry at the specified coordinates (application+session+page)- Specified by:
setConnection
in 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
Description copied from interface:IWebSocketConnectionRegistry
Removes a web socket connection from the registry at the specified coordinates (application+session+page)- Specified by:
removeConnection
in interfaceIWebSocketConnectionRegistry
- Parameters:
application
- the web application to look insessionId
- the http session idkey
- the web socket client key
-