2017-09-29 15:51:33 +02:00
|
|
|
|
using System.Collections.Generic;
|
2016-05-26 17:12:04 +02:00
|
|
|
|
using Umbraco.Core.Models.Membership;
|
2018-04-18 19:46:47 +02:00
|
|
|
|
using Umbraco.Core.Models.PublishedContent;
|
2016-05-26 17:12:04 +02:00
|
|
|
|
using Umbraco.Web.Cache;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.PublishedCache
|
|
|
|
|
|
{
|
2017-10-31 12:48:24 +01:00
|
|
|
|
abstract class PublishedSnapshotServiceBase : IPublishedSnapshotService
|
2016-05-26 17:12:04 +02:00
|
|
|
|
{
|
2018-04-29 20:02:38 +02:00
|
|
|
|
protected PublishedSnapshotServiceBase(IPublishedSnapshotAccessor publishedSnapshotAccessor, ICurrentVariationAccessor variationAccessor)
|
2016-05-26 17:12:04 +02:00
|
|
|
|
{
|
2017-10-31 12:48:24 +01:00
|
|
|
|
PublishedSnapshotAccessor = publishedSnapshotAccessor;
|
2018-04-29 20:02:38 +02:00
|
|
|
|
VariationAccessor = variationAccessor;
|
2016-05-26 17:12:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-10-31 12:48:24 +01:00
|
|
|
|
public IPublishedSnapshotAccessor PublishedSnapshotAccessor { get; }
|
2018-04-29 20:02:38 +02:00
|
|
|
|
public ICurrentVariationAccessor VariationAccessor { get; }
|
2016-06-29 15:28:40 +02:00
|
|
|
|
|
2017-10-31 12:48:24 +01:00
|
|
|
|
// note: NOT setting _publishedSnapshotAccessor.PublishedSnapshot here because it is the
|
2016-05-30 19:54:36 +02:00
|
|
|
|
// responsibility of the caller to manage what the 'current' facade is
|
2018-04-27 11:38:50 +10:00
|
|
|
|
public abstract IPublishedSnapshot CreatePublishedSnapshot(string previewToken);
|
2016-05-26 17:12:04 +02:00
|
|
|
|
|
2018-04-27 11:38:50 +10:00
|
|
|
|
protected IPublishedSnapshot CurrentPublishedSnapshot => PublishedSnapshotAccessor.PublishedSnapshot;
|
2016-06-29 15:28:40 +02:00
|
|
|
|
|
2016-06-30 10:30:43 +02:00
|
|
|
|
public abstract bool EnsureEnvironment(out IEnumerable<string> errors);
|
|
|
|
|
|
|
2016-05-26 17:12:04 +02:00
|
|
|
|
public abstract string EnterPreview(IUser user, int contentId);
|
|
|
|
|
|
public abstract void RefreshPreview(string previewToken, int contentId);
|
|
|
|
|
|
public abstract void ExitPreview(string previewToken);
|
|
|
|
|
|
public abstract void Notify(ContentCacheRefresher.JsonPayload[] payloads, out bool draftChanged, out bool publishedChanged);
|
|
|
|
|
|
public abstract void Notify(MediaCacheRefresher.JsonPayload[] payloads, out bool anythingChanged);
|
|
|
|
|
|
public abstract void Notify(ContentTypeCacheRefresher.JsonPayload[] payloads);
|
|
|
|
|
|
public abstract void Notify(DataTypeCacheRefresher.JsonPayload[] payloads);
|
|
|
|
|
|
public abstract void Notify(DomainCacheRefresher.JsonPayload[] payloads);
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void Dispose()
|
|
|
|
|
|
{ }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|