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
Constructors Constructor Description SimpleWebSocketConnectionRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IWebSocketConnection
getConnection(Application application, String sessionId, IKey key)
Collection<IWebSocketConnection>
getConnections(Application application)
Returns a collection of currently active websockets.Collection<IWebSocketConnection>
getConnections(Application application, String sessionId)
Collection<IWebSocketConnection>
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 Detail
-
SimpleWebSocketConnectionRegistry
public SimpleWebSocketConnectionRegistry()
-
-
Method Detail
-
getConnection
public IWebSocketConnection getConnection(Application application, String sessionId, IKey key)
- 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
public Collection<IWebSocketConnection> getConnections(Application application, String sessionId)
- 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
public Collection<IWebSocketConnection> getConnections(Application application)
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
public void removeConnection(Application application, String sessionId, IKey key)
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
-
-