Ejemplo n.º 1
0
 public void Remove()
 {
     CacheNotify.Publish(new MailServiceHelperCache()
     {
         Key = MailServiceHelper.CacheKey
     }, CacheNotifyAction.Remove);
 }
Ejemplo n.º 2
0
 public void RemoveMailLogoDataFromCache()
 {
     CacheNotify.Publish(new TenantLogoCacheItem()
     {
         Key = CacheKey
     }, CacheNotifyAction.Remove);
 }
Ejemplo n.º 3
0
 public void SetTenantQuotaRow(TenantQuotaRow row, bool exchange)
 {
     Service.SetTenantQuotaRow(row, exchange);
     CacheNotify.Publish(new QuotaCacheItem {
         Key = QuotaServiceCache.KEY_QUOTA_ROWS
     }, CacheNotifyAction.Any);
 }
Ejemplo n.º 4
0
        public void Set(List <SearchSettingsItem> items)
        {
            if (!SearchByContentEnabled)
            {
                return;
            }

            var settings = SettingsManager.Load <SearchSettings>();

            var settingsItems = settings.Items;
            var toReIndex     = !settingsItems.Any() ? items.Where(r => r.Enabled).ToList() : items.Where(item => settingsItems.Any(r => r.ID == item.ID && r.Enabled != item.Enabled)).ToList();

            settings.Items = items;
            settings.Data  = JsonConvert.SerializeObject(items);
            SettingsManager.Save(settings);

            var action = new ReIndexAction()
            {
                Tenant = TenantManager.GetCurrentTenant().TenantId
            };

            action.Names.AddRange(toReIndex.Select(r => r.ID).ToList());

            CacheNotify.Publish(action, CacheNotifyAction.Any);
        }
Ejemplo n.º 5
0
 public void SetTenantQuotaRow(TenantQuotaRow row, bool exchange)
 {
     Service.SetTenantQuotaRow(row, exchange);
     CacheNotify.Publish(new QuotaCacheItem {
         Key = GetKey(row.Tenant)
     }, CacheNotifyAction.InsertOrUpdate);
 }
Ejemplo n.º 6
0
        public TenantQuota SaveTenantQuota(TenantQuota quota)
        {
            var q = Service.SaveTenantQuota(quota);

            CacheNotify.Publish(new QuotaCacheItem {
                Key = QuotaServiceCache.KEY_QUOTA
            }, CacheNotifyAction.Any);
            return(q);
        }
Ejemplo n.º 7
0
 public void Stop()
 {
     CacheNotify.Unsubscribe(CacheNotifyAction.InsertOrUpdate);
 }
Ejemplo n.º 8
0
 public void Start()
 {
     CacheNotify.Subscribe((n) => SendNotifyMessage(n), CacheNotifyAction.InsertOrUpdate);
     CacheInvoke.Subscribe((n) => InvokeSendMethod(n), CacheNotifyAction.InsertOrUpdate);
 }
Ejemplo n.º 9
0
 public void Dispose()
 {
     CacheNotify.Unsubscribe(CacheNotifyAction.InsertOrUpdate);
     CacheInvoke.Unsubscribe(CacheNotifyAction.InsertOrUpdate);
 }