public CacheLessRuntimeContentService(IContentPathMapper pathMapper, ISearchService searchService)
        {
            SearchService = searchService;

            PathMapper = pathMapper;
            Urls = new List<string>();
            _lock = new object();

            _lastUrlFlush = DateTime.Now;

            _urlPath = Path.Combine(PathMapper.ContentRootFolder("/"), "sitemap-urls.json");

            if (!File.Exists(_urlPath)) return;

            var urls = File.ReadAllText(_urlPath);
            Urls = JsonConvert.DeserializeObject<List<string>>(urls);
        }
        public CachedRuntimeContentService(IContentPathMapper pathMapper, ISearchService searchService) : base(pathMapper, searchService)
        {
            _customCache = MemoryCache.Default;
            _policy = new CacheItemPolicy {SlidingExpiration = TimeSpan.FromHours(1)};

            var scheduler = StdSchedulerFactory.GetDefaultScheduler();
            scheduler.Start();

            var job = JobBuilder.Create<CacheRefresherJob>()
                .WithIdentity("moriyamaCacheRefresherJob", "cacheRefresherJob")
                .Build();

            var trigger = TriggerBuilder.Create()
                .WithIdentity("cacheRefresherJobTrigger", "cacheRefresherJobGroup")
                .StartNow()
                .WithSimpleSchedule(x => x
                .WithIntervalInSeconds(60)
                .RepeatForever())
                .Build();

            scheduler.ScheduleJob(job, trigger);
        }
        public CacheLessRuntimeContentService(string path, string[] domains, IFileProvider fileProvider)
        {
            this._domains = domains;

            //SearchService = searchService;
            this._fileProvider = fileProvider;

            PathMapper = new ContentPathMapper(path, fileProvider);
            Urls       = new List <string>();
            _lock      = new object();

            _lastUrlFlush = DateTime.Now;

            _urlPath = this._fileProvider.Combine(PathMapper.ContentRootFolder("/"), SITEMAP_FILE);

            if (!this._fileProvider.Exists(_urlPath))
            {
                return;
            }

            var urls = this._fileProvider.ReadAllText(_urlPath).Result;

            Urls = JsonConvert.DeserializeObject <IList <string> >(urls);
        }
 public LuceneQueryingContentService(IContentPathMapper pathMapper, ISearchService searchService)
     : base(pathMapper, searchService)
 {
     
 }