using System.Collections.Generic; using Umbraco.Cms.Core.Models; namespace Umbraco.Cms.Infrastructure.PublishedCache.Persistence { /// /// Defines a data source for NuCache. /// public interface INuCacheContentService { /// /// Used during startup to see if the configured serialized is different from the persisted serialize type. /// If they are different, this will rebuild the nucache DB table with the configured serializer. /// void RebuildDatabaseCacheIfSerializerChanged(); // TODO: For these required sort orders, would sorting on Path 'just work'? ContentNodeKit GetContentSource(int id); /// /// Returns all content ordered by level + sortOrder /// /// /// MUST be ordered by level + parentId + sortOrder! /// IEnumerable GetAllContentSources(); /// /// Returns branch for content ordered by level + sortOrder /// /// /// MUST be ordered by level + parentId + sortOrder! /// IEnumerable GetBranchContentSources(int id); /// /// Returns content by Ids ordered by level + sortOrder /// /// /// MUST be ordered by level + parentId + sortOrder! /// IEnumerable GetTypeContentSources(IEnumerable ids); ContentNodeKit GetMediaSource(int id); /// /// Returns all media ordered by level + sortOrder /// /// /// MUST be ordered by level + parentId + sortOrder! /// IEnumerable GetAllMediaSources(); /// /// Returns branch for media ordered by level + sortOrder /// /// /// MUST be ordered by level + parentId + sortOrder! /// IEnumerable GetBranchMediaSources(int id); // must order by level, sortOrder /// /// Returns media by Ids ordered by level + sortOrder /// /// /// MUST be ordered by level + parentId + sortOrder! /// IEnumerable GetTypeMediaSources(IEnumerable ids); void DeleteContentItem(IContentBase item); void DeleteContentItems(IEnumerable items); /// /// Refreshes the nucache database row for the /// void RefreshContent(IContent content); /// /// Refreshes the nucache database row for the /// void RefreshMedia(IMedia media); /// /// Refreshes the nucache database row for the /// void RefreshMember(IMember member); /// /// Rebuilds the database caches for content, media and/or members based on the content type ids specified /// /// If not null will process content for the matching content types, if empty will process all content /// If not null will process content for the matching media types, if empty will process all media /// If not null will process content for the matching members types, if empty will process all members void Rebuild( IReadOnlyCollection contentTypeIds = null, IReadOnlyCollection mediaTypeIds = null, IReadOnlyCollection memberTypeIds = null); bool VerifyContentDbCache(); bool VerifyMediaDbCache(); bool VerifyMemberDbCache(); } }