using Quadarax.Foundation.Core.Business.Processor.Enums; using Quadarax.Foundation.Core.Business.Processor.Task; using Quadarax.Foundation.Core.Data; using Quadarax.Foundation.Core.Object; namespace Quadarax.Foundation.Core.Business.Processor.Providers { public interface IProcessorStorageProvider : IDisposable { /// /// Open storage connection if needed /// public void Open(); /// /// Close storage connection if needed /// public void Close(); /// /// Ensure storage is ready to use. If not exists, create it. /// This operation doesn't use Open or Close operation to access to storage and doesn't affects Open/Close state.. /// /// Returns true, if storage already exists. Otherwise returns false that storage was created. public bool EnsureStorage(); /// /// Create new task item in storage and save it. /// /// Item to create. /// Identifier of new created item. public ITaskIdentifier Create(ITaskItemData item); /// /// Get task item from storage by identifier. /// /// Storage identifiers of Task item /// Array of Task items public ITaskItemData[] Get(params ITaskIdentifier[] ids); /// /// Saves task items in storage. /// /// Task items to save. public void Set(params ITaskItemData[] items); /// /// Deletes task items physically in storage. /// /// Storage identifiers of Task item public void Delete(params ITaskIdentifier[] ids); /// /// Query task items from storage by status. /// /// Defines paging settings to apply in storage. /// Allowed statuses /// Queryable collection of selected Task items. public IQueryable Query(IPaging paging, params ProcessStatusEnum[] statuses); } }