using Quadarax.Foundation.Core.Business.Processor.Enums; using Quadarax.Foundation.Core.Business.Processor.Task; 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(ITaskItem item); /// /// Get task item from storage by identifier. /// /// Storage identifiers of Task item /// Array of Task items public ITaskItem[] Get(params ITaskIdentifier[] ids); /// /// Saves task items in storage. /// /// Task items to save. public void Set(params ITaskItem[] items); /// /// Deletes task items in storage (or mark it for delete). /// /// Flag is set, performs physical delete of item. Otherwise mark item to delete. /// Storage identifiers of Task item public void Delete(bool force, params ITaskIdentifier[] ids); /// /// Query task items from storage by status. /// /// Allowed statuses /// Queryable collection of selected Task items. public IQueryable Query(params ProcessStatusEnum[] statuses); } }