using System;
using System.Collections.Generic;
using JetBrains.Annotations;
namespace Abp.RealTime
{
///
/// Used to manage online clients those are connected to the application.
///
public interface IOnlineClientManager : IOnlineClientManager
{
}
public interface IOnlineClientManager
{
event EventHandler ClientConnected;
event EventHandler ClientDisconnected;
event EventHandler UserConnected;
event EventHandler UserDisconnected;
///
/// Adds a client.
///
/// The client.
void Add(IOnlineClient client);
///
/// Removes a client by connection id.
///
/// The connection id.
/// True, if a client is removed
bool Remove(string connectionId);
///
/// Tries to find a client by connection id.
/// Returns null if not found.
///
/// connection id
IOnlineClient GetByConnectionIdOrNull(string connectionId);
///
/// Gets all online clients.
///
IReadOnlyList GetAllClients();
IReadOnlyList GetAllByUserId([NotNull] IUserIdentifier user);
}
}