Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IWebSocketConnection getConnection​(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)  
      void removeConnection​(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)
      void setConnection​(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)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleWebSocketConnectionRegistry

        public SimpleWebSocketConnectionRegistry()
    • Method Detail

      • getConnection

        public IWebSocketConnection getConnection​(org.apache.wicket.Application application,
                                                  java.lang.String sessionId,
                                                  IKey key)
        Specified by:
        getConnection in interface IWebSocketConnectionRegistry
        Parameters:
        application - the web application to look in
        sessionId - the http session id
        key - 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:
        getConnections in interface IWebSocketConnectionRegistry
        Parameters:
        application - the web application to look in
        sessionId - 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:
        getConnections in interface IWebSocketConnectionRegistry
        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: IWebSocketConnectionRegistry
        Adds a new connection into the registry at the specified coordinates (application+session+page)
        Specified by:
        setConnection in interface IWebSocketConnectionRegistry
        Parameters:
        application - the web application to look in
        sessionId - the http session id
        key - the web socket client key
        connection - 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: IWebSocketConnectionRegistry
        Removes a web socket connection from the registry at the specified coordinates (application+session+page)
        Specified by:
        removeConnection in interface IWebSocketConnectionRegistry
        Parameters:
        application - the web application to look in
        sessionId - the http session id
        key - the web socket client key