jellyfin/MediaBrowser.Controller/Sync/ISyncManager.cs

147 lines
4.6 KiB
C#
Raw Normal View History

2014-12-10 23:20:28 -07:00
using MediaBrowser.Controller.Entities;
2014-12-12 20:56:30 -07:00
using MediaBrowser.Model.Dlna;
2015-01-20 20:54:45 -07:00
using MediaBrowser.Model.Events;
2014-07-22 09:36:34 -07:00
using MediaBrowser.Model.Querying;
2014-07-14 21:12:26 -07:00
using MediaBrowser.Model.Sync;
2014-12-30 23:24:49 -07:00
using MediaBrowser.Model.Users;
2015-01-20 20:54:45 -07:00
using System;
2014-07-14 21:12:26 -07:00
using System.Collections.Generic;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Sync
{
public interface ISyncManager
{
2015-01-20 20:54:45 -07:00
event EventHandler<GenericEventArgs<SyncJob>> SyncJobCreated;
event EventHandler<GenericEventArgs<SyncJob>> SyncJobCancelled;
2014-07-14 21:12:26 -07:00
/// <summary>
/// Creates the job.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>Task.</returns>
2014-07-26 10:30:15 -07:00
Task<SyncJobCreationResult> CreateJob(SyncJobRequest request);
2014-07-14 21:12:26 -07:00
/// <summary>
/// Gets the jobs.
/// </summary>
/// <returns>QueryResult&lt;SyncJob&gt;.</returns>
2014-12-30 23:24:49 -07:00
Task<QueryResult<SyncJob>> GetJobs(SyncJobQuery query);
2014-07-14 21:12:26 -07:00
2014-12-16 22:52:34 -07:00
/// <summary>
/// Gets the job items.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult&lt;SyncJobItem&gt;.</returns>
QueryResult<SyncJobItem> GetJobItems(SyncJobItemQuery query);
2014-07-17 15:21:35 -07:00
/// <summary>
/// Gets the job.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>SyncJob.</returns>
SyncJob GetJob(string id);
2014-12-12 20:56:30 -07:00
2014-12-30 23:24:49 -07:00
/// <summary>
/// Updates the job.
/// </summary>
/// <param name="job">The job.</param>
/// <returns>Task.</returns>
Task UpdateJob(SyncJob job);
2015-01-20 20:54:45 -07:00
/// <summary>
/// Res the enable job item.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task ReEnableJobItem(string id);
/// <summary>
/// Cnacels the job item.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task CancelJobItem(string id);
2014-07-14 21:12:26 -07:00
/// <summary>
/// Cancels the job.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task CancelJob(string id);
2014-07-21 18:29:06 -07:00
/// <summary>
/// Adds the parts.
/// </summary>
void AddParts(IEnumerable<ISyncProvider> providers);
/// <summary>
/// Gets the synchronize targets.
/// </summary>
2014-07-22 09:36:34 -07:00
IEnumerable<SyncTarget> GetSyncTargets(string userId);
/// <summary>
/// Supportses the synchronize.
/// </summary>
/// <param name="item">The item.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
bool SupportsSync(BaseItem item);
2014-12-12 20:56:30 -07:00
/// <summary>
/// Gets the device profile.
/// </summary>
/// <param name="targetId">The target identifier.</param>
/// <returns>DeviceProfile.</returns>
DeviceProfile GetDeviceProfile(string targetId);
2014-12-16 22:30:31 -07:00
/// <summary>
/// Reports the synchronize job item transferred.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task ReportSyncJobItemTransferred(string id);
/// <summary>
/// Gets the job item.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>SyncJobItem.</returns>
SyncJobItem GetJobItem(string id);
2014-12-26 10:45:06 -07:00
/// <summary>
/// Reports the offline action.
/// </summary>
/// <param name="action">The action.</param>
/// <returns>Task.</returns>
Task ReportOfflineAction(UserAction action);
2014-12-27 15:52:41 -07:00
/// <summary>
/// Gets the ready synchronize items.
/// </summary>
/// <param name="targetId">The target identifier.</param>
/// <returns>List&lt;SyncedItem&gt;.</returns>
List<SyncedItem> GetReadySyncItems(string targetId);
2014-12-28 22:56:55 -07:00
/// <summary>
/// Synchronizes the data.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>Task&lt;SyncDataResponse&gt;.</returns>
Task<SyncDataResponse> SyncData(SyncDataRequest request);
2015-01-20 21:56:00 -07:00
/// <summary>
/// Marks the job item for removal.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task MarkJobItemForRemoval(string id);
/// <summary>
/// Unmarks the job item for removal.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task UnmarkJobItemForRemoval(string id);
2014-07-14 21:12:26 -07:00
}
}