using System; using System.Collections.Generic; using System.Text; namespace ScrewTurn.Wiki.PluginFramework { /// /// Provides an interface for implementing a Cache Provider for ScrewTurn Wiki. /// /// The Cache should preferably reside in RAM for performance purposes. public interface ICacheProviderV30 : IProviderV30 { /// /// Gets or sets the number of users online. /// int OnlineUsers { get; set; } /// /// Gets the value of a Pseudo-cache item, previously stored in the cache. /// /// The name of the item being requested. /// The value of the item, or null if the item is not found. /// If is null. /// If is empty. string GetPseudoCacheValue(string name); /// /// Sets the value of a Pseudo-cache item. /// /// The name of the item being stored. /// The value of the item. If the value is null, then the item should be removed from the cache. /// If is null. /// If is empty. void SetPseudoCacheValue(string name, string value); /// /// Gets the Content of a Page, previously stored in cache. /// /// The Page Info object related to the Content being requested. /// The Page Content object, or null if the item is not found. /// If is null. PageContent GetPageContent(PageInfo pageInfo); /// /// Sets the Content of a Page. /// /// The Page Info object related to the Content being stored. /// The Content of the Page. /// If or content are null. void SetPageContent(PageInfo pageInfo, PageContent content); /// /// Gets the partially-formatted content (text) of a Page, previously stored in the cache. /// /// The Page Info object related to the content being requested. /// The partially-formatted content, or null if the item is not found. /// If is null. string GetFormattedPageContent(PageInfo pageInfo); /// /// Sets the partially-preformatted content (text) of a Page. /// /// The Page Info object related to the content being stored. /// The partially-preformatted content. /// If or are null. void SetFormattedPageContent(PageInfo pageInfo, string content); /// /// Removes a Page from the cache. /// /// The Page Info object related to the Page that has to be removed. /// If is null. void RemovePage(PageInfo pageInfo); /// /// Clears the Page Content cache. /// void ClearPageContentCache(); /// /// Clears the Pseudo-Cache. /// void ClearPseudoCache(); /// /// Reduces the size of the Page Content cache, removing the least-recently used items. /// /// The number of Pages to remove. /// If is less than or equal to zero. void CutCache(int cutSize); /// /// Gets the number of Pages whose content is currently stored in the cache. /// int PageCacheUsage { get; } /// /// Gets the numer of Pages whose formatted content is currently stored in the cache. /// int FormatterPageCacheUsage { get; } /// /// Adds or updates an editing session. /// /// The edited Page. /// The User who is editing the Page. /// If or are null. /// If or are empty. void RenewEditingSession(string page, string user); /// /// Cancels an editing session. /// /// The Page. /// The User. /// If or are null. /// If or are empty. void CancelEditingSession(string page, string user); /// /// Finds whether a Page is being edited by a different user. /// /// The Page. /// The User who is requesting the status of the Page. /// True if the Page is being edited by another User. /// If or are null. /// If or are empty. bool IsPageBeingEdited(string page, string currentUser); /// /// Gets the username of the user who's editing a page. /// /// The page. /// The username. /// If is null. /// If is empty. string WhosEditing(string page); /// /// Adds the redirection information for a page (overwrites the previous value, if any). /// /// The source page. /// The destination page. /// If or are null. /// If or are empty. void AddRedirection(string source, string destination); /// /// Gets the destination of a redirection. /// /// The source page. /// The destination page, if any, null otherwise. /// If is null. /// If is empty. string GetRedirectionDestination(string source); /// /// Removes a pge from both sources and destinations. /// /// The name of the page. /// If is null. /// If is empty. void RemovePageFromRedirections(string name); /// /// Clears all the redirections information. /// void ClearRedirections(); } }