From 340280edf29cfbf6b519b7fb6312f90e2c1f9871 Mon Sep 17 00:00:00 2001 From: Eric Reed Date: Wed, 27 Feb 2013 07:49:55 -0500 Subject: Partial implementation of PackageManager --- .../Updates/IInstallationManager.cs | 119 --------------------- MediaBrowser.Common/Updates/IPackageManager.cs | 42 ++++++++ 2 files changed, 42 insertions(+), 119 deletions(-) delete mode 100644 MediaBrowser.Common/Updates/IInstallationManager.cs create mode 100644 MediaBrowser.Common/Updates/IPackageManager.cs (limited to 'MediaBrowser.Common/Updates') diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.cs deleted file mode 100644 index 23c1477487..0000000000 --- a/MediaBrowser.Common/Updates/IInstallationManager.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using MediaBrowser.Common.Events; -using MediaBrowser.Common.Plugins; -using MediaBrowser.Model.Updates; - -namespace MediaBrowser.Common.Updates -{ - public interface IInstallationManager - { - /// - /// The current installations - /// - List> CurrentInstallations { get; set; } - - /// - /// The completed installations - /// - ConcurrentBag CompletedInstallations { get; set; } - - /// - /// Occurs when [plugin uninstalled]. - /// - event EventHandler> PluginUninstalled; - - /// - /// Occurs when [plugin updated]. - /// - event EventHandler>> PluginUpdated; - - /// - /// Called when [plugin updated]. - /// - /// The plugin. - /// The new version. - void OnPluginUpdated(IPlugin plugin, PackageVersionInfo newVersion); - - /// - /// Occurs when [plugin updated]. - /// - event EventHandler> PluginInstalled; - - /// - /// Called when [plugin installed]. - /// - /// The package. - void OnPluginInstalled(PackageVersionInfo package); - - /// - /// Gets all available packages. - /// - /// The cancellation token. - /// Type of the package. - /// The application version. - /// Task{List{PackageInfo}}. - Task> GetAvailablePackages(CancellationToken cancellationToken, - PackageType? packageType = null, - Version applicationVersion = null); - - /// - /// Gets the package. - /// - /// The name. - /// The classification. - /// The version. - /// Task{PackageVersionInfo}. - Task GetPackage(string name, PackageVersionClass classification, Version version); - - /// - /// Gets the latest compatible version. - /// - /// The name. - /// The classification. - /// Task{PackageVersionInfo}. - Task GetLatestCompatibleVersion(string name, PackageVersionClass classification = PackageVersionClass.Release); - - /// - /// Gets the latest compatible version. - /// - /// The available packages. - /// The name. - /// The classification. - /// PackageVersionInfo. - PackageVersionInfo GetLatestCompatibleVersion(IEnumerable availablePackages, string name, PackageVersionClass classification = PackageVersionClass.Release); - - /// - /// Gets the available plugin updates. - /// - /// if set to true [with auto update enabled]. - /// The cancellation token. - /// Task{IEnumerable{PackageVersionInfo}}. - Task> GetAvailablePluginUpdates(bool withAutoUpdateEnabled, CancellationToken cancellationToken); - - /// - /// Installs the package. - /// - /// The package. - /// The progress. - /// The cancellation token. - /// Task. - /// package - Task InstallPackage(PackageVersionInfo package, IProgress progress, CancellationToken cancellationToken); - - /// - /// Uninstalls a plugin - /// - /// The plugin. - /// - void UninstallPlugin(IPlugin plugin); - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - void Dispose(); - } -} \ No newline at end of file diff --git a/MediaBrowser.Common/Updates/IPackageManager.cs b/MediaBrowser.Common/Updates/IPackageManager.cs new file mode 100644 index 0000000000..d5a8a59b12 --- /dev/null +++ b/MediaBrowser.Common/Updates/IPackageManager.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Common.Kernel; +using MediaBrowser.Common.Net; +using MediaBrowser.Common.Security; +using MediaBrowser.Model.Serialization; +using MediaBrowser.Model.Updates; + +namespace MediaBrowser.Common.Updates +{ + public interface IPackageManager + { + /// + /// Gets all available packages. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// Task{List{PackageInfo}}. + Task> GetAvailablePackages(IHttpClient client, + INetworkManager networkManager, + ISecurityManager securityManager, + ResourcePool resourcePool, + IJsonSerializer serializer, + CancellationToken cancellationToken); + + /// + /// Installs a package. + /// + /// The package. + /// The cancellation token. + /// Task. + Task InstallPackage(PackageVersionInfo package, CancellationToken cancellationToken); + } +} -- cgit v1.2.3