2014-10-02 20:48:59 -07:00
|
|
|
|
using MediaBrowser.Model.Dto;
|
|
|
|
|
using MediaBrowser.Model.Events;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Model.ApiClient
|
|
|
|
|
{
|
|
|
|
|
public interface IConnectionManager
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [connected].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<GenericEventArgs<ConnectionResult>> Connected;
|
|
|
|
|
|
2014-10-03 20:18:57 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs when [remote logged out].
|
|
|
|
|
/// </summary>
|
|
|
|
|
event EventHandler<EventArgs> RemoteLoggedOut;
|
|
|
|
|
|
2014-10-02 20:48:59 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the API client.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <returns>MediaBrowser.Model.ApiClient.IApiClient.</returns>
|
|
|
|
|
IApiClient GetApiClient(BaseItemDto item);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Connects the specified cancellation token.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task<ConnectionResult>.</returns>
|
|
|
|
|
Task<ConnectionResult> Connect(CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Connects the specified server.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="server">The server.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task<ConnectionResult>.</returns>
|
|
|
|
|
Task<ConnectionResult> Connect(ServerInfo server, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Connects the specified server.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="address">The address.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task<ConnectionResult>.</returns>
|
|
|
|
|
Task<ConnectionResult> Connect(string address, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Logouts this instance.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>Task<ConnectionResult>.</returns>
|
|
|
|
|
Task<ConnectionResult> Logout();
|
2014-10-13 13:14:53 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Logins to connect.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task LoginToConnect(string username, string password);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the active api client instance
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Obsolete]
|
|
|
|
|
IApiClient CurrentApiClient { get; }
|
2014-10-02 20:48:59 -07:00
|
|
|
|
}
|
|
|
|
|
}
|