using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.XPath;
using Umbraco.Core.Models;
using Umbraco.Core.Xml;
namespace Umbraco.Web.PublishedCache
{
///
/// Provides access to cached contents in a specified context.
///
internal abstract class ContextualPublishedCache
{
protected readonly UmbracoContext UmbracoContext;
///
/// Initializes a new instance of the with a context.
///
/// The context.
protected ContextualPublishedCache(UmbracoContext umbracoContext)
{
UmbracoContext = umbracoContext;
}
///
/// Gets a content identified by its unique identifier.
///
/// The content unique identifier.
/// The content, or null.
public abstract IPublishedContent GetById(int contentId);
///
/// Gets contents at root.
///
/// The contents.
public abstract IEnumerable GetAtRoot();
///
/// Gets a content resulting from an XPath query.
///
/// The XPath query.
/// Optional XPath variables.
/// The content, or null.
///
/// If is null, or is empty, or contains only one single
/// value which itself is null, then variables are ignored.
/// The XPath expression should reference variables as $var.
///
public abstract IPublishedContent GetSingleByXPath(string xpath, params XPathVariable[] vars);
///
/// Gets contents resulting from an XPath query.
///
/// The XPath query.
/// Optional XPath variables.
/// The contents.
///
/// If is null, or is empty, or contains only one single
/// value which itself is null, then variables are ignored.
/// The XPath expression should reference variables as $var.
///
public abstract IEnumerable GetByXPath(string xpath, params XPathVariable[] vars);
///
/// Gets an XPath navigator that can be used to navigate contents.
///
/// The XPath navigator.
public abstract XPathNavigator GetXPathNavigator();
///
/// Gets a value indicating whether the underlying non-contextual cache contains published content.
///
/// A value indicating whether the underlying non-contextual cache contains published content.
public abstract bool HasContent();
}
}