using System; using System.Threading.Tasks; using Umbraco.Cms.Core.Models.PublishedContent; namespace Umbraco.Cms.Core.Routing { /// /// Routes requests. /// public interface IPublishedRouter { /// /// Creates a published request. /// /// The current request Uri. /// A published request builder. Task CreateRequestAsync(Uri uri); /// /// Sends a through the routing pipeline and builds a result. /// /// The request. /// The options. /// The built instance. Task RouteRequestAsync(IPublishedRequestBuilder request, RouteRequestOptions options); /// /// Updates the request to use the specified item, or NULL /// /// The request. /// /// /// A new based on values from the original /// and with the re-routed values based on the passed in /// /// /// This method is used for 2 cases: /// - When the rendering content needs to change due to Public Access rules. /// - When there is nothing to render due to circumstances such as no template files. In this case, NULL is used as the parameter. /// /// /// This method is invoked when the pipeline decides it cannot render /// the request, for whatever reason, and wants to force it to be re-routed /// and rendered as if no document were found (404). /// This occurs if there is no template found and route hijacking was not matched. /// In that case it's the same as if there was no content which means even if there was /// content matched we want to run the request through the last chance finders. /// /// Task UpdateRequestAsync(IPublishedRequest request, IPublishedContent publishedContent); } }