From e1f8c18b516f5bd31f64b8faaa53266a3daddd7a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 9 May 2013 13:38:02 -0400 Subject: added ability to track web sockets per session --- MediaBrowser.Controller/Session/ISessionManager.cs | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 MediaBrowser.Controller/Session/ISessionManager.cs (limited to 'MediaBrowser.Controller/Session') diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs new file mode 100644 index 000000000..66facdf6d --- /dev/null +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -0,0 +1,90 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Library; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using MediaBrowser.Model.Session; + +namespace MediaBrowser.Controller.Session +{ + /// + /// Interface ISessionManager + /// + public interface ISessionManager + { + /// + /// Occurs when [playback start]. + /// + event EventHandler PlaybackStart; + + /// + /// Occurs when [playback progress]. + /// + event EventHandler PlaybackProgress; + + /// + /// Occurs when [playback stopped]. + /// + event EventHandler PlaybackStopped; + + /// + /// Gets all connections. + /// + /// All connections. + IEnumerable AllConnections { get; } + + /// + /// Gets the active connections. + /// + /// The active connections. + IEnumerable RecentConnections { get; } + + /// + /// Logs the user activity. + /// + /// Type of the client. + /// The device id. + /// Name of the device. + /// The user. + /// Task. + /// user + Task LogConnectionActivity(string clientType, string deviceId, string deviceName, User user); + + /// + /// Used to report that playback has started for an item + /// + /// The user. + /// The item. + /// Type of the client. + /// The device id. + /// Name of the device. + /// + void OnPlaybackStart(User user, BaseItem item, string clientType, string deviceId, string deviceName); + + /// + /// Used to report playback progress for an item + /// + /// The user. + /// The item. + /// The position ticks. + /// Type of the client. + /// The device id. + /// Name of the device. + /// Task. + /// + Task OnPlaybackProgress(User user, BaseItem item, long? positionTicks, string clientType, string deviceId, string deviceName); + + /// + /// Used to report that playback has ended for an item + /// + /// The user. + /// The item. + /// The position ticks. + /// Type of the client. + /// The device id. + /// Name of the device. + /// Task. + /// + Task OnPlaybackStopped(User user, BaseItem item, long? positionTicks, string clientType, string deviceId, string deviceName); + } +} \ No newline at end of file -- cgit v1.2.3