public ResourceXmlConfigurationProvider(ICacheProvider cacheProvider, string configurationPath, IVirtualPathResolver virtualPathResolver, IResourceCacher resourceCacher)
        {
            if (cacheProvider == null)
            {
                throw new ArgumentNullException("cacheProvider");
            }

            if (resourceCacher == null)
            {
                throw new ArgumentNullException("resourceCacher");
            }

            if (string.IsNullOrEmpty(configurationPath) && virtualPathResolver == null)
            {
                throw new ArgumentNullException("configurationPath");                    
            }

            m_CacheProvider = cacheProvider;
            m_VirtualPathResolver = virtualPathResolver;
            m_ResourceCacher = resourceCacher;

            m_XmlConfigurationPathProvider = new Lazy<string>(
                () =>
                    {
                        if (string.IsNullOrWhiteSpace(configurationPath))
                        {
                            configurationPath = m_VirtualPathResolver.Resolve("~/App_Data/WebResources.xml");
                        }

                        m_ResourceCacher.AddDependentFile(configurationPath);

                        return configurationPath;
                    },
                true);
        }
 public IdentityService(ILearnWithQBUow uow, IEncryptionService encryptionService, ISessionService sessionService, ICacheProvider cacheProvider)
     : base(cacheProvider)
 {
     this.uow = uow;
     this.sessionService = sessionService;
     this.encryptionService = encryptionService;
 }
Example #3
0
 public AlbumCacheTask(ILastfmClientFactory lastfmFactory, IS3ClientFactory s3Factory, ICacheProvider cacheProvider, ILogger<AlbumCacheTask> logger)
 {
     this.s3Client = s3Factory.CreateS3Client();
     this.lastfmClient = lastfmFactory.CreateLastfmClient();
     this.cacheProvider = cacheProvider;
     this.logger = logger;
 }
Example #4
0
 public AppContext(ILogger logger, ICacheProvider cache)
 {
     //Environment = new EnvironmentPH();
     Logger = logger;
     Cache = cache;
     Settings = new AppSettings();
 }
Example #5
0
      public static void GenerateAllCourses(ICourseStorage courseStorage, ICacheProvider cacheProvider)
      {

         var path = (new System.Uri(Assembly.GetExecutingAssembly().CodeBase)).AbsolutePath;
         path = path.Replace("IUDICO.LMS/Plugins/IUDICO.DataGenerator.DLL", "IUDICO.DataGenerator/Content/Courses/");

         if (Directory.Exists(path))
         {
            var files = Directory.GetFiles(path, "*.zip",SearchOption.TopDirectoryOnly);

            foreach (var file in files)
            {
               var name = Path.GetFileNameWithoutExtension(file);

               if (!courseStorage.GetCourses().Any(c => c.Name == name && c.Owner == "prof3"))
               {
                  courseStorage.Import(file, "prof3");
                  Course course = courseStorage.GetCourses().SingleOrDefault(c => c.Name == name && c.Owner == "prof3");
                  if (course != null && course.Locked.Value)
                  {
                     courseStorage.Parse(course.Id);
                     cacheProvider.Invalidate("course-" + course.Id, "courses");
                  }
               }
            }
         }
      }
 public IdentityService(IVideoOnDemandUow uow, IEncryptionService encryptionService, ISessionService sessionService, ICacheProvider cacheProvider)
     : base(cacheProvider)
 {
     this.uow = uow;
     this.sessionService = sessionService;
     this.encryptionService = encryptionService;
 }
 public CachedUserService(IUserService userService, ICacheProvider cacheProvider, IUserStorePathProvider userStorePathProvider)
 {
     _userService = userService;
     _cacheProvider = cacheProvider;
     _optoutCacheFileName = userStorePathProvider.GetOptoutFileName();
     _optinCacheFileName = userStorePathProvider.GetOptinFileName();
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CacheInterceptor" /> class.
 /// </summary>
 /// <param name="cacheProvider">The cache provider.</param>
 /// <param name="cachingIsEnabled">if set to <c>true</c> caching is enabled.</param>
 /// <param name="cacheTimeoutSeconds">The cache timeout seconds.</param>
 public CacheInterceptor(ICacheProvider cacheProvider, bool cachingIsEnabled, int cacheTimeoutSeconds, bool logCacheHits)
 {
     this.cacheProvider = cacheProvider;
     this.cachingIsEnabled = cachingIsEnabled;
     this.cacheTimeout = TimeSpan.FromSeconds(cacheTimeoutSeconds);
     this.logCacheHits = logCacheHits;
 }
        public AspNetDatingChatRoomProvider(IChatUserProvider chatUserProvider, ICacheProvider cacheProvider)
        {
            this.chatUserProvider = chatUserProvider;
            this.cacheProvider = cacheProvider;

            mainChatRoom = new Room
            {
                Id = "-1",
                MaxUsers = MaxUsers,
                Name = "Main Chat",
                Password = null,
                Topic = "Welcome to chat!",
                Visible = true
            };

            messengerChatRoom = new Room
            {
                Id = "-2",
                MaxUsers = Int32.MaxValue,
                Name = "Messenger",
                Password = null,
                Topic = "Welcome to chat!",
                Visible = false
            };
        }
Example #10
0
 /// <summary>
 /// Creates a new Tvdb handler
 /// </summary>
 /// <param name="_apiKey"></param>
 public TvdbHandler(String _apiKey)
 {
     m_apiKey = _apiKey; //store api key
       TvdbLinkCreator.ActiveMirror = new TvdbMirror(0, new Uri(TvdbLinkCreator.BASE_SERVER), 7);
       m_downloader = new TvdbDownloader(m_apiKey);
       m_cacheProvider = null;
 }
Example #11
0
        protected internal CacheAspect(ICacheProvider cacheProvider)
        {
            if (cacheProvider == null)
                throw new ArgumentNullException("cacheProvider");

            this.Cache = cacheProvider;
        }
 public IdentityService(IWeddingBiddersUow uow, IEncryptionService encryptionService, ISessionService sessionService, ICacheProvider cacheProvider)
     : base(cacheProvider)
 {
     this.uow = uow;
     this.sessionService = sessionService;
     this.encryptionService = encryptionService;
 }
Example #13
0
 private HttpResourceProvider(ICacheProvider cacheProvider, string applicationName, string resourceSet, Uri lemonadeServiceUri)
 {
     _cacheProvider = cacheProvider;
     _applicationName = applicationName;
     _resourceSet = resourceSet;
     _restClient = new RestClient(lemonadeServiceUri);
 }
 public void FixtureSetup()
 {
     XmlConfigurator.Configure();
     props = new Dictionary<string, string>();
     provider = new VelocityProvider();
     provider.Start(props);
 }
 public RespiratoryController([Named("FileDependency")]ICacheProvider cache, IReadEquationData<Equation> readEquationData,IMathExpressionParser mathExpressionParser,IMyLogger logger)
 {
     this.myLogger = logger;
     this.Cache = cache;
     this.ReadEquationData = readEquationData;
     this.MathExpressionParser = mathExpressionParser;
 }
Example #16
0
 private CustomCacheManager()
 {
     if (_cache == null)
     {
         _cache = CacheBuilder.CurrentClassCache;
     }
 }
Example #17
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		/// <param name="container">The current cache provider</param>
		public AppCache(ICacheProvider provider) {
			Authors = new ModelCache<Models.Author>(provider, a => a.Id.Value, a => a.Email);
			Categories = new ModelCache<Models.Category>(provider, c => c.Id.Value, c => c.Slug);
			Params = new ModelCache<Models.Param>(provider, p => p.Id.Value, p => p.InternalId);
			Posts = new ModelCache<Models.Post>(provider, p => p.Id.Value, p => p.Slug);
			Tags = new ModelCache<Models.Tag>(provider, t => t.Id.Value, t => t.Slug);
		}
 public void FixtureSetup()
 {
     XmlConfigurator.Configure();
     props = new Dictionary<string, string> {{"compression_enabled", "false"}, {"expiration", "20"}};
     provider = new MemCacheProvider();
     provider.Start(props);
 }
Example #19
0
        public static void PreStartInitialise()
        {
            switch (WebConfigSettings.CacheProviderType)
            {

            #if !NET35
                case CacheTypes.AppFabricCache:

                    _cache = new AppFabricCacheAdapter();

                    break;

            #endif
                case CacheTypes.MemoryCache:
                default:
                    _cache = new MemoryCacheAdapter();

                    // http://msdn.microsoft.com/en-us/library/wcxyzt4d.aspx
                    //_cache = Activator.CreateInstance(Type.GetType(WebConfigSettings.CacheProviderType, _logger)) as ICache;

                    break;

            }

            _cacheProvider = new CacheProvider(_cache);
        }
 public void FixtureSetup()
 {
     XmlConfigurator.Configure();
     props = new Dictionary<string, string>();
     provider = new CouchbaseCacheProvider();
     provider.Start(props);
 }
Example #21
0
 public BlogController(ILogger<BlogController> logger, IPostManager postManager, IPortfolioManager portfolioManager, ICacheProvider cacheProvider)
 {
     this.logger = logger;
     this.cacheProvider = cacheProvider;
     this.postManager = postManager;
     this.portfolioManager = portfolioManager;
 }
Example #22
0
      protected FakeCacheProvider()
      {
         this.mockCacheProvider = new Mock<ICacheProvider>();

         this.Setup();

         this.CacheProvider = this.mockCacheProvider.Object;
      }
Example #23
0
 public CouchPotatoController(ISettingsService<CouchPotatoSettingsDto> settingsService, IThirdPartyService api, ILogger logger, ICacheProvider cache)
 {
     SettingsService = settingsService;
     Api = api;
     Logger = logger;
     Settings = SettingsService.GetSettings();
     Cache = cache;
 }
Example #24
0
 public HomeController(IThemeProvider themeProvider, ICacheProvider cacheProvider,
                       IAppSecurityFacade appSecurityFacade, IAppAuthenticationFacade appAuthenticationFacade)
 {
     _themeProvider = themeProvider;
     _cacheProvider = cacheProvider;
     _appSecurityFacade = appSecurityFacade;
     _appAuthenticationFacade = appAuthenticationFacade;
 }
        public RoleService(ICacheProvider cacheProvider, IRepositoryFactory repositoryFactory)
        {
            _repositoryFactory = repositoryFactory;

            _cacheProvider = cacheProvider;

            _roleRepository = _repositoryFactory.GetRepository<BORole, BORoleCollection>();
        }
 public RoleManagementService(IUnitOfWork uow, ICacheProvider cache)
 {
     _uow = uow;
     _role = uow.Set<Role>();
     _userInRole = uow.Set<UserInRole>();
     _actionRole = uow.Set<ActionRole>();
     _cache = cache;
 }
 public InventoryTransactionRepository(CokeDataContext ctx, IInventoryRepository inventoryRepository, ICacheProvider cacheProvider)
 {
    
     _ctx = ctx;
     _inventoryRepository = inventoryRepository;
     _cacheProvider = cacheProvider;
     
 }
Example #28
0
 public PageService(IDocumentSession session, IFolderService folderService, ITemplateService templateService,
                    ICacheProvider cacheProvider)
     : base(session)
 {
     this.folderService = folderService;
     this.templateService = templateService;
     this.cacheProvider = cacheProvider;
 }
Example #29
0
 public Gist(
     ILogProvider logProvider,
     ICacheProvider cacheProvider,
     IAuthProvider authProvider)
     : base(
         logProvider,
         cacheProvider,
         authProvider) { }
 /// <summary>
 /// Factory method to set pre-constructed provider, typically for test scenarios
 /// </summary>
 /// <param name="provider">Desired ICacheProvider instance</param>
 /// <returns></returns>
 public static ICacheProvider SetCacheProvider(string providerType)
 {
     lock (syncProvider)
     {
         cacheProvider = ActivateProvider(providerType);
         return cacheProvider;
     }
 }
 public SomeClass(ICacheProvider cacheProvider)
 {
     _cacheProvider = cacheProvider;
 }
 public SonarrCacher(ISettingsService <SonarrSettings> sonarrSettings, ISonarrApi sonarrApi, ICacheProvider cache, IJobRecord rec)
 {
     SonarrSettings = sonarrSettings;
     SonarrApi      = sonarrApi;
     Job            = rec;
     Cache          = cache;
 }
Example #33
0
 public PingController(ICacheProvider <Ping> provider)
 {
     _cacheProvider = provider;
 }
Example #34
0
 public ApiThrottleService(ICacheProvider cache, IOptions <ApiThrottleOptions> options, IStorageProvider storage)
 {
     _cache   = cache;
     _options = options.Value;
     _storage = storage;
 }
Example #35
0
        /// <summary>
        /// Get the current forum topic based on the id in the context
        /// </summary>
        /// <param name="context"></param>
        /// <param name="cache"></param>
        /// <param name="memberData"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        /// <remarks>
        /// So that we don't have to look this up multiple times in a single request, this will use the given ICacheProvider to cache it
        /// </remarks>
        public ReadOnlyTopic CurrentTopic(HttpContextBase context, ICacheProvider cache, MemberData memberData, IPublishedContent content)
        {
            var topic = (ReadOnlyTopic)cache.GetCacheItem(typeof(TopicService) + "-CurrentTopic", () =>
            {
                var contextId = context.Items["topicID"] as string;
                if (contextId != null)
                {
                    int topicId;
                    if (int.TryParse(contextId, out topicId))
                    {
                        return(QueryById(topicId));
                    }
                }
                return(null);
            });

            if (topic == null)
            {
                return(null);
            }

            topic.MemberData = memberData;
            if (content != null)
            {
                topic.ForumNewTopicsAllowed = content.NewTopicsAllowed();
                topic.MainNotification      = content.GetPropertyValue <string>("mainNotification");
                if (string.IsNullOrWhiteSpace(topic.MainNotification))
                {
                    topic.MainNotification = "This forum is in read only mode, you can no longer reply";
                }
                topic.ForumName = content.Name;
                topic.ForumUrl  = content.Url;
            }

            if (memberData != null && memberData.Member != null)
            {
                topic.Subscribed = Utils.IsSubscribedToForumTopic(topic.Id, memberData.Member.Id);
            }

            var currentMember = memberData != null && memberData.Member != null
                ? memberData.Member
                : null;

            var topicAuthorIsCurrentMember = currentMember != null && topic.MemberId == currentMember.Id;

            var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);

            topic.TopicAuthor = topicAuthorIsCurrentMember
                ? currentMember
                : umbracoHelper.TypedMember(topic.MemberId);

            if (topic.TopicAuthor == null)
            {
                return(topic);
            }

            topic.TopicMembers = new List <TopicMember>();
            var author = new TopicMember
            {
                Member = topic.TopicAuthor,
                Roles  = topicAuthorIsCurrentMember ? memberData.Roles : topic.TopicAuthor.GetRoles()
            };

            topic.TopicMembers.Add(author);

            foreach (var comment in topic.Comments)
            {
                if (topic.TopicMembers.Any(x => x.Member.Id == comment.MemberId))
                {
                    continue;
                }

                var commentAuthorIsCurrentMember = currentMember != null && comment.MemberId == currentMember.Id;
                if (commentAuthorIsCurrentMember)
                {
                    var commentAuthor = new TopicMember {
                        Member = currentMember, Roles = memberData.Roles
                    };
                    topic.TopicMembers.Add(commentAuthor);
                }
                else
                {
                    var commentMember = umbracoHelper.TypedMember(comment.MemberId);
                    if (commentMember == null)
                    {
                        continue;
                    }

                    var commenterRoles = commentMember.GetRoles();
                    var commentAuthor  = new TopicMember {
                        Member = commentMember, Roles = commenterRoles
                    };
                    topic.TopicMembers.Add(commentAuthor);
                }
            }

            foreach (var comment in topic.Comments)
            {
                comment.TopicMembers = topic.TopicMembers;
                comment.MemberData   = memberData;
                if (topic.Answer == comment.Id)
                {
                    comment.IsAnswer = true;
                }
                var forumContent = umbracoHelper.TypedContent(topic.ParentId);
                comment.ForumNewTopicsAllowed = forumContent.NewTopicsAllowed();
            }

            return(topic);
        }
Example #36
0
        async public Task SaveFundingConfiguration_GivenValidConfiguration_ReturnsStatusCode(
            string fundingStreamId, string fundingPeriodId)
        {
            FundingStream fundingStream = NewFundingStream(_ => _.WithId(fundingStreamId));
            FundingPeriod fundingPeriod = NewFundingPeriod(_ => _.WithId(fundingPeriodId));

            ILogger logger = CreateLogger();

            HttpStatusCode statusCode = HttpStatusCode.OK;

            ICacheProvider cacheProvider = CreateCacheProvider();

            cacheProvider
            .RemoveAsync <List <FundingConfiguration> >($"{CacheKeys.FundingConfig}{fundingStreamId}")
            .Returns(Task.CompletedTask);

            cacheProvider
            .SetAsync(
                $"{CacheKeys.FundingConfig}{fundingStreamId}-{fundingPeriodId}",
                Arg.Is <FundingConfiguration>(_ => _.FundingStreamId == fundingStreamId && _.FundingPeriodId == fundingPeriodId))
            .Returns(Task.CompletedTask);

            IPolicyRepository policyRepository = CreatePolicyRepository();

            policyRepository
            .GetFundingStreamById(Arg.Is(fundingStreamId))
            .Returns(fundingStream);

            policyRepository
            .GetFundingPeriodById(Arg.Is(fundingPeriodId))
            .Returns(fundingPeriod);

            policyRepository
            .SaveFundingConfiguration(Arg.Is <FundingConfiguration>(x => x.FundingStreamId == fundingStreamId && x.FundingPeriodId == fundingPeriodId))
            .Returns(statusCode);

            FundingConfigurationService fundingConfigurationsService = CreateFundingConfigurationService(
                logger: logger,
                policyRepository: policyRepository,
                cacheProvider: cacheProvider);

            FundingConfigurationViewModel fundingConfigurationViewModel = CreateConfigurationModel();

            //Act
            IActionResult result = await fundingConfigurationsService.SaveFundingConfiguration("Action", "Controller", fundingConfigurationViewModel, fundingStreamId, fundingPeriodId);

            //Assert
            result
            .Should()
            .BeOfType <CreatedAtActionResult>();

            await cacheProvider
            .Received(1)
            .SetAsync(
                $"{CacheKeys.FundingConfig}{fundingStreamId}-{fundingPeriodId}",
                Arg.Is <FundingConfiguration>(_ => _.FundingStreamId == fundingStreamId && _.FundingPeriodId == fundingPeriodId));

            await cacheProvider
            .Received(1)
            .RemoveAsync <List <FundingConfiguration> >($"{CacheKeys.FundingConfig}{fundingStreamId}");
        }
 public DigitalAssetController(IDigitalAssetService digitalAssetService, IUow uow, ICacheProvider cacheProvider)
 {
     _digitalAssetService = digitalAssetService;
     _uow        = uow;
     _repository = uow.DigitalAssets;
     _cache      = cacheProvider.GetCache();
 }
Example #38
0
 /// <summary>
 /// Execute cache operation
 /// </summary>
 /// <param name="cacheProvider">Cache provider</param>
 /// <param name="server">Cache server</param>
 /// <returns>Return sort response</returns>
 protected override async Task <SortResponse> ExecuteCacheOperationAsync(ICacheProvider cacheProvider, CacheServer server)
 {
     return(await cacheProvider.SortAsync(server, this).ConfigureAwait(false));
 }
Example #39
0
        public SourceBackedCache(ICacheProvider <V> cacheProvider)
        {
            Contract.NotNull(cacheProvider, nameof(cacheProvider));

            this.cacheProvider = cacheProvider;
        }
 protected override async Task <SortAndStoreResponse> ExecuteCommandAsync(ICacheProvider cacheProvider, CacheServer server)
 {
     return(await cacheProvider.SortAndStoreAsync(server, this).ConfigureAwait(false));
 }
 public BillingControllerCache()
 {
     _cacheProvider        = CacheManager.Current[Constants.Commons.BillingControllerCacheName, CacheStores.Memory];
     _defaultCachingPeriod = TimeSpan.FromMinutes(1);
 }
Example #42
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VisualStudioJSLintProvider" /> class.
        /// </summary>
        /// <param name="serviceProvider">The service provider.</param>
        /// <param name="errorListProvider">The error list provider.</param>
        /// <param name="jsLintFactory">The JSLint factory.</param>
        /// <param name="fileSystemWrapper">The file system wrapper.</param>
        /// <param name="settingsRepository">The settings repository.</param>
        /// <param name="cacheProvider">The cache provider.</param>
        public VisualStudioJSLintProvider(IServiceProvider serviceProvider, IJSLintErrorListProvider errorListProvider, Func <IJSLintContext> jsLintFactory, IFileSystemWrapper fileSystemWrapper, ISettingsRepository settingsRepository, ICacheProvider cacheProvider)
        {
            this.serviceProvider    = serviceProvider;
            this.errorListProvider  = errorListProvider;
            this.jsLintFactory      = jsLintFactory;
            this.fileSystemWrapper  = fileSystemWrapper;
            this.settingsRepository = settingsRepository;
            this.cacheProvider      = cacheProvider;

            this.statusBar       = this.serviceProvider.GetService <SVsStatusbar, IVsStatusbar>();
            this.solutionService = this.serviceProvider.GetService <SVsSolution, IVsSolution>();
        }
Example #43
0
        public HomeController(IFlightService flightService, IMappingService mappingService, IJobService jobService, ICacheProvider cacheProvider)
        {
            if (flightService == null)
            {
                throw new NullReferenceException("FlightService");
            }

            if (mappingService == null)
            {
                throw new NullReferenceException("MappingService");
            }

            if (jobService == null)
            {
                throw new NullReferenceException("JobService");
            }

            if (cacheProvider == null)
            {
                throw new NullReferenceException("CacheProvider");
            }

            this.cacheProvider  = cacheProvider;
            this.jobService     = jobService;
            this.mappingService = mappingService;
            this.flightService  = flightService;
        }
Example #44
0
 public RefUserProfileItemRepository(SALTEntities context, ICacheProvider <SALTEntities, RefUserProfileItem> cacheProvider, IApplicationCachingConfiguration cachingConfiguration) : base(context, cacheProvider, cachingConfiguration)
 {
 }
Example #45
0
        public override IDictionary <PortIdentifier, List <LedColor> > GenerateColors(List <PortIdentifier> ports, ICacheProvider cache)
        {
            int Wrap(int a, int b) => (a % b + b) % b;

            if (_tick++ >= Config.TickInterval)
            {
                _tick = 0;
                _rotation++;
            }

            var result = new Dictionary <PortIdentifier, List <LedColor> >();

            if (Config.ColorGenerationMethod == ColorGenerationMethod.PerPort)
            {
                foreach (var port in ports)
                {
                    var config = cache.GetPortConfig(port);
                    if (config == null)
                    {
                        continue;
                    }

                    var off    = new LedColor(0, 0, 0);
                    var colors = Enumerable.Range(0, config.LedCount).Select(_ => off).ToList();
                    for (var i = 0; i < Config.Length; i++)
                    {
                        var idx = Wrap(_rotation - i, config.LedCount);
                        colors[idx] = _rippleColors[i];
                    }

                    result.Add(port, colors);
                }
            }
            else if (Config.ColorGenerationMethod == ColorGenerationMethod.SpanPorts)
            {
                var totalLength = ports.Select(p => cache.GetPortConfig(p)).Sum(c => c?.LedCount ?? 0);

                var off    = new LedColor(0, 0, 0);
                var colors = Enumerable.Range(0, totalLength).Select(_ => off).ToList();
                for (var i = 0; i < Config.Length; i++)
                {
                    var idx = Wrap(_rotation - i, totalLength);
                    colors[idx] = _rippleColors[i];
                }

                var offset = 0;
                foreach (var port in ports)
                {
                    var config = cache.GetPortConfig(port);
                    if (config == null)
                    {
                        continue;
                    }

                    result.Add(port, colors.Skip(offset).Take(config.LedCount).ToList());
                    offset += config.LedCount;
                }
            }

            return(result);
        }
Example #46
0
 public Service(IUow uow, ICacheProvider cacheProvider)
 {
     _uow        = uow;
     _repository = uow.Searchs;
     _cache      = cacheProvider.GetCache();
 }
 public UserService(IUow uow, ICacheProvider cacheProvider)
 {
     _uow        = uow;
     _repository = uow.Users;
     _cache      = cacheProvider.GetCache();
 }
Example #48
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MultiNodeTreePicker2ContentParser"/> class.
 /// </summary>
 /// <param name="contentService">
 /// The content service.
 /// </param>
 /// <param name="cacheProvider">
 /// The cache provider.
 /// </param>
 public MultiNodeTreePicker2ContentParser(IContentService contentService, ICacheProvider cacheProvider)
 {
     this.contentService = contentService;
     this.cache          = cacheProvider;
 }
Example #49
0
 /// <summary>
 /// Execute cache operation
 /// </summary>
 /// <param name="cacheProvider">Cache provider</param>
 /// <param name="server">Cache server</param>
 /// <returns>Return hash scan response</returns>
 protected override async Task <IEnumerable <HashScanResponse> > ExecuteCacheOperationAsync(ICacheProvider cacheProvider, CacheServer server)
 {
     return(await cacheProvider.HashScanAsync(server, this).ConfigureAwait(false));
 }
Example #50
0
 public RadarrCacher(ISettingsService <RadarrSettings> radarrService, IRadarrApi radarrApi, ICacheProvider cache, IJobRecord rec)
 {
     RadarrSettings = radarrService;
     RadarrApi      = radarrApi;
     Job            = rec;
     Cache          = cache;
 }
Example #51
0
 public UpdateTimestampsCache(ICacheProvider provider, IDictionary props)
 {
     log.Info("starting update timestamps cache at region: " + RegionName);
     this.updateTimestamps = provider.BuildCache(RegionName, props);
 }
Example #52
0
 public SettingsJsonRepository(ISqliteConfiguration config, ICacheProvider cacheProvider)
 {
     Db       = config;
     Cache    = cacheProvider;
     TypeName = typeof(SettingsJsonRepository).Name;
 }
Example #53
0
 public CommandsLogic(IEnlirRepository enlirRepository, ICacheProvider cacheProvider, ILogger <CommandsLogic> logger)
 {
     _enlirRepository = enlirRepository;
     _logger          = logger;
     _cacheProvider   = cacheProvider;
 }
Example #54
0
 public MediaLibraryRepo(IMediaServicesConnectionSettings repoSettings, IAdminLogger logger, ICacheProvider cacheProvider)
     : base(repoSettings.MediaLibraryConnection.Uri, repoSettings.MediaLibraryConnection.AccessKey, repoSettings.MediaLibraryConnection.ResourceName, logger, cacheProvider)
 {
     _shouldConsolidateCollections = repoSettings.ShouldConsolidateCollections;
 }
        public SleipnerCacheProxyHandler(T implementation, ICachePolicyProvider <T> cachePolicyProvider, ICacheProvider <T> cache)
        {
            _implementation      = implementation;
            _cachePolicyProvider = cachePolicyProvider;
            _cache = cache;

            _asyncLookupHandler = new AsyncLookupHandler <T>(_implementation, _cachePolicyProvider, _cache);
            _syncLookupHandler  = new SyncLookupHandler <T>(_implementation, _cachePolicyProvider, _cache);

            _taskUpdateSyncronizer = new TaskSyncronizer();
        }
Example #56
0
 public DivisionService(IUow uow, ICacheProvider cacheProvider)
 {
     _uow        = uow;
     _repository = uow.Divisions;
     _cache      = cacheProvider.GetCache();
 }
 public ReportService(IUow uow, ICacheProvider cacheProvider)
 {
     _uow        = uow;
     _repository = uow.Reports;
     _cache      = cacheProvider.GetCache();
 }
Example #58
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MultiNodeTreePicker2ContentParser"/> class.
 /// </summary>
 public MultiNodeTreePicker2ContentParser()
 {
     this.dataTypeService = ApplicationContext.Current.Services.DataTypeService;
     this.contentService  = ApplicationContext.Current.Services.ContentService;
     this.cache           = ApplicationContext.Current.ApplicationCache.StaticCache;
 }
Example #59
0
        public override IDictionary <PortIdentifier, List <LedColor> > GenerateColors(List <PortIdentifier> ports, ICacheProvider cache)
        {
            if (!_spectrumProvider.GetFftData(_fftBuffer, this))
            {
                return(null);
            }

            return(_spectrum.GenerateColors(Config.ColorGenerationMethod, ports, cache, _fftBuffer));
        }
Example #60
0
        public WebTldRuleProvider(string url = "https://publicsuffix.org/list/public_suffix_list.dat", ICacheProvider cacheProvider = null)
        {
            _fileUrl = url;

            if (cacheProvider == null)
            {
                _cacheProvider = new FileCacheProvider();
                return;
            }

            _cacheProvider = cacheProvider;
        }