2014-09-20 14:57:16 -07:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2013-09-30 15:18:44 -07:00
|
|
|
|
using System;
|
2013-02-20 18:33:05 -07:00
|
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Persistence
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Provides an interface to implement a UserData repository
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IUserDataRepository : IRepository
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2013-04-02 12:25:16 -07:00
|
|
|
|
/// Saves the user data.
|
2013-02-20 18:33:05 -07:00
|
|
|
|
/// </summary>
|
2013-04-02 12:25:16 -07:00
|
|
|
|
/// <param name="userId">The user id.</param>
|
2013-04-13 11:02:30 -07:00
|
|
|
|
/// <param name="key">The key.</param>
|
2013-04-02 12:25:16 -07:00
|
|
|
|
/// <param name="userData">The user data.</param>
|
2013-02-20 18:33:05 -07:00
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2017-08-26 17:32:33 -07:00
|
|
|
|
void SaveUserData(Guid userId, string key, UserItemData userData, CancellationToken cancellationToken);
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-04-02 12:25:16 -07:00
|
|
|
|
/// Gets the user data.
|
2013-02-20 18:33:05 -07:00
|
|
|
|
/// </summary>
|
2013-04-02 12:25:16 -07:00
|
|
|
|
/// <param name="userId">The user id.</param>
|
2013-04-13 11:02:30 -07:00
|
|
|
|
/// <param name="key">The key.</param>
|
2013-04-02 12:25:16 -07:00
|
|
|
|
/// <returns>Task{UserItemData}.</returns>
|
2013-06-17 13:35:43 -07:00
|
|
|
|
UserItemData GetUserData(Guid userId, string key);
|
2014-09-20 14:57:16 -07:00
|
|
|
|
|
2016-06-03 17:15:14 -07:00
|
|
|
|
UserItemData GetUserData(Guid userId, List<string> keys);
|
|
|
|
|
|
2014-09-20 14:57:16 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Return all user data associated with the given user
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId"></param>
|
|
|
|
|
/// <returns></returns>
|
2017-08-26 17:32:33 -07:00
|
|
|
|
List<UserItemData> GetAllUserData(Guid userId);
|
2014-09-20 14:57:16 -07:00
|
|
|
|
|
|
|
|
|
/// <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>
|
2017-08-26 17:32:33 -07:00
|
|
|
|
void SaveAllUserData(Guid userId, UserItemData[] userData, CancellationToken cancellationToken);
|
2014-09-20 14:57:16 -07:00
|
|
|
|
|
2013-02-20 18:33:05 -07:00
|
|
|
|
}
|
|
|
|
|
}
|