Interface IConnectionManager<T>

All Known Implementing Classes:
RTMPConnManager

public interface IConnectionManager<T>
  • Method Details

    • getConnection

      T getConnection(int clientId)
      Returns a connection matching the given client id.
      Parameters:
      clientId - client id
      Returns:
      connection
    • setConnection

      void setConnection(T conn)
      Adds a connection.
      Parameters:
      conn - connection
    • 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(int clientId)
      Removes a connection matching the client id specified. If found, the connection will be returned.
      Parameters:
      clientId - client id
      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