Interface IConnectionManager<T>


public interface IConnectionManager<T>
  • Method Details

    • getConnectionBySessionId

      T getConnectionBySessionId(String sessionId)
      Returns a connection matching the given session id.
      Parameters:
      sessionId - session id
      Returns:
      connection
    • getAllConnections

      Collection<T> getAllConnections()
      Returns all the current connections. It doesn't remove anything.
      Returns:
      list of connections
    • createConnection

      T createConnection(Class<?> connCls)
      Creates a connection based on the given type class.
      Parameters:
      connCls - class
      Returns:
      connection
    • createConnection

      T createConnection(Class<?> connCls, String sessionId)
      Creates a connection of the type specified with associated session id.
      Parameters:
      connCls - class
      sessionId - session id
      Returns:
      connection
    • removeConnection

      T removeConnection(T conn)
      Removes a connection matching the client id specified. If found, the connection will be returned.
      Parameters:
      conn - the connection to be removed
      Returns:
      connection
    • removeConnection

      T removeConnection(String sessionId)
      Removes a connection by the given sessionId.
      Parameters:
      sessionId - session id
      Returns:
      connection that was removed
    • removeConnections

      Collection<T> removeConnections()
      Removes all the connections from the set.
      Returns:
      connections