|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Persistence
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Provides an interface to implement a UserData repository
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IUserDataRepository : IRepository
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Opens the connection to the repository
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task Initialize();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves the user data.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId">The user id.</param>
|
|
|
|
|
/// <param name="key">The key.</param>
|
|
|
|
|
/// <param name="userData">The user data.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task SaveUserData(Guid userId, string key, UserItemData userData, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the user data.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId">The user id.</param>
|
|
|
|
|
/// <param name="key">The key.</param>
|
|
|
|
|
/// <returns>Task{UserItemData}.</returns>
|
|
|
|
|
UserItemData GetUserData(Guid userId, string key);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Return all user data associated with the given user
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
IEnumerable<UserItemData> GetAllUserData(Guid userId);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Save all user data associated with the given user
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId"></param>
|
|
|
|
|
/// <param name="userData"></param>
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
Task SaveAllUserData(Guid userId, IEnumerable<UserItemData> userData, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|