aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Session/ISessionManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-05-09 13:38:02 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-05-09 13:38:02 -0400
commite1f8c18b516f5bd31f64b8faaa53266a3daddd7a (patch)
treeb7f3212a71d19dfd99f44d50ba1fa85aa8e81b6b /MediaBrowser.Controller/Session/ISessionManager.cs
parentf57cec4cff8feff70e62056549ea19bbd6a8316c (diff)
added ability to track web sockets per session
Diffstat (limited to 'MediaBrowser.Controller/Session/ISessionManager.cs')
-rw-r--r--MediaBrowser.Controller/Session/ISessionManager.cs90
1 files changed, 90 insertions, 0 deletions
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
+{
+ /// <summary>
+ /// Interface ISessionManager
+ /// </summary>
+ public interface ISessionManager
+ {
+ /// <summary>
+ /// Occurs when [playback start].
+ /// </summary>
+ event EventHandler<PlaybackProgressEventArgs> PlaybackStart;
+
+ /// <summary>
+ /// Occurs when [playback progress].
+ /// </summary>
+ event EventHandler<PlaybackProgressEventArgs> PlaybackProgress;
+
+ /// <summary>
+ /// Occurs when [playback stopped].
+ /// </summary>
+ event EventHandler<PlaybackProgressEventArgs> PlaybackStopped;
+
+ /// <summary>
+ /// Gets all connections.
+ /// </summary>
+ /// <value>All connections.</value>
+ IEnumerable<SessionInfo> AllConnections { get; }
+
+ /// <summary>
+ /// Gets the active connections.
+ /// </summary>
+ /// <value>The active connections.</value>
+ IEnumerable<SessionInfo> RecentConnections { get; }
+
+ /// <summary>
+ /// Logs the user activity.
+ /// </summary>
+ /// <param name="clientType">Type of the client.</param>
+ /// <param name="deviceId">The device id.</param>
+ /// <param name="deviceName">Name of the device.</param>
+ /// <param name="user">The user.</param>
+ /// <returns>Task.</returns>
+ /// <exception cref="System.ArgumentNullException">user</exception>
+ Task LogConnectionActivity(string clientType, string deviceId, string deviceName, User user);
+
+ /// <summary>
+ /// Used to report that playback has started for an item
+ /// </summary>
+ /// <param name="user">The user.</param>
+ /// <param name="item">The item.</param>
+ /// <param name="clientType">Type of the client.</param>
+ /// <param name="deviceId">The device id.</param>
+ /// <param name="deviceName">Name of the device.</param>
+ /// <exception cref="System.ArgumentNullException"></exception>
+ void OnPlaybackStart(User user, BaseItem item, string clientType, string deviceId, string deviceName);
+
+ /// <summary>
+ /// Used to report playback progress for an item
+ /// </summary>
+ /// <param name="user">The user.</param>
+ /// <param name="item">The item.</param>
+ /// <param name="positionTicks">The position ticks.</param>
+ /// <param name="clientType">Type of the client.</param>
+ /// <param name="deviceId">The device id.</param>
+ /// <param name="deviceName">Name of the device.</param>
+ /// <returns>Task.</returns>
+ /// <exception cref="System.ArgumentNullException"></exception>
+ Task OnPlaybackProgress(User user, BaseItem item, long? positionTicks, string clientType, string deviceId, string deviceName);
+
+ /// <summary>
+ /// Used to report that playback has ended for an item
+ /// </summary>
+ /// <param name="user">The user.</param>
+ /// <param name="item">The item.</param>
+ /// <param name="positionTicks">The position ticks.</param>
+ /// <param name="clientType">Type of the client.</param>
+ /// <param name="deviceId">The device id.</param>
+ /// <param name="deviceName">Name of the device.</param>
+ /// <returns>Task.</returns>
+ /// <exception cref="System.ArgumentNullException"></exception>
+ Task OnPlaybackStopped(User user, BaseItem item, long? positionTicks, string clientType, string deviceId, string deviceName);
+ }
+} \ No newline at end of file