Ejemplo n.º 1
0
        public MailSender(
            IConfiguration configuration,
            TenantManager tenantManager,
            SettingsManager settingsManager,
            DistributedTaskQueueOptionsManager progressQueueOptionsManager,
            SendBatchEmailsOperation sendBatchEmailsOperation,
            CoreConfiguration coreConfiguration,
            IOptionsMonitor <ILog> logger
            )
        {
            _sendBatchEmailsOperation = sendBatchEmailsOperation;
            _tenantID          = tenantManager.GetCurrentTenant().TenantId;
            _mailQueue         = progressQueueOptionsManager.Get <SendBatchEmailsOperation>();
            _coreConfiguration = coreConfiguration;
            _logManager        = logger;

            int parsed;

            if (int.TryParse(configuration["crm:mailsender:quotas"], out parsed))
            {
                quotas = parsed;
            }

            _tenantManager   = tenantManager;
            _settingsManager = settingsManager;

            //            LogManager = logger.Get();
        }
Ejemplo n.º 2
0
 public StorageUploader(IServiceProvider serviceProvider, TempStream tempStream, ICacheNotify <MigrationProgress> cacheMigrationNotify, DistributedTaskQueueOptionsManager options)
 {
     ServiceProvider      = serviceProvider;
     TempStream           = tempStream;
     CacheMigrationNotify = cacheMigrationNotify;
     Queue = options.Get(nameof(StorageUploader));
 }
Ejemplo n.º 3
0
 public ImportFromCSV(TenantManager tenantProvider,
                      DistributedTaskQueueOptionsManager progressQueueOptionsManager,
                      ImportDataOperation importDataOperation)
 {
     _tenantId            = tenantProvider.GetCurrentTenant().TenantId;
     _importQueue         = progressQueueOptionsManager.Get <ImportDataOperation>();
     _importDataOperation = importDataOperation;
 }
Ejemplo n.º 4
0
 public FileMarkerHelper(
     IServiceProvider serviceProvider,
     IOptionsMonitor <ILog> optionsMonitor,
     DistributedTaskQueueOptionsManager distributedTaskQueueOptionsManager)
 {
     ServiceProvider = serviceProvider;
     Log             = optionsMonitor.CurrentValue;
     Tasks           = distributedTaskQueueOptionsManager.Get <AsyncTaskData <T> >();
 }
Ejemplo n.º 5
0
 static HelpDownloader()
 {
     Tasks   = new DistributedTaskQueue("HelpDownloader", 1);
     LockObj = new object();
     if (!bool.TryParse(WebConfigurationManager.AppSettings["web.help-center.download"] ?? "false", out DownloadEnabled))
     {
         DownloadEnabled = false;
     }
 }
Ejemplo n.º 6
0
 public PdfQueueWorker(DistributedTaskQueueOptionsManager queueOptions,
                       PdfProgressItem pdfProgressItem,
                       TenantManager tenantProvider,
                       SecurityContext securityContext)
 {
     _queue           = queueOptions.Get <PdfProgressItem>();
     _pdfProgressItem = pdfProgressItem;
     _tenantId        = tenantProvider.GetCurrentTenant().TenantId;
     _userId          = securityContext.CurrentAccount.ID;
 }
Ejemplo n.º 7
0
        static LdapNotifyHelper()
        {
            var container = AutofacConfigLoader.Load("ldap");

            if (container != null)
            {
                Builder = container.Build();
            }

            clients   = new Dictionary <int, Tuple <INotifyClient, LdapNotifySource> >();
            ldapTasks = new DistributedTaskQueue("ldapAutoSyncOperations");
        }
Ejemplo n.º 8
0
 public StaticUploader(
     IServiceProvider serviceProvider,
     TenantManager tenantManager,
     SettingsManager settingsManager,
     StorageSettingsHelper storageSettingsHelper,
     ICache cache,
     DistributedTaskQueueOptionsManager options)
 {
     Cache                 = cache;
     ServiceProvider       = serviceProvider;
     TenantManager         = tenantManager;
     SettingsManager       = settingsManager;
     StorageSettingsHelper = storageSettingsHelper;
     Queue                 = options.Get <UploadOperationProgress>();
 }
Ejemplo n.º 9
0
 public VoipEngine(DaoFactory daoFactory,
                   CrmSecurity crmSecurity,
                   TenantUtil tenantUtil,
                   DistributedTaskQueueOptionsManager optionsManager,
                   SecurityContext securityContext,
                   IOptionsMonitor <ILog> logger,
                   TenantManager tenantManager,
                   VoipDao voipDao)
 {
     _crmSecurity     = crmSecurity;
     _tenantUtil      = tenantUtil;
     _securityContext = securityContext;
     _queue           = optionsManager.Get <QueueItem>();
     _logger          = logger.Get("ASC.CRM");
     _tenantManager   = tenantManager;
     _voipDao         = voipDao;
     _daoFactory      = daoFactory;
 }
Ejemplo n.º 10
0
        public ContactPhotoManager(Global global,
                                   WebImageSupplier webImageSupplier,
                                   IOptionsMonitor <ILog> logger,
                                   ICache cache,
                                   ICacheNotify <ContactPhotoManagerCacheItem> cacheNotify,
                                   DistributedTaskQueueOptionsManager optionsQueue)
        {
            _global           = global;
            _webImageSupplier = webImageSupplier;
            _cacheNotify      = cacheNotify;
            _cache            = cache;
            _resizeQueue      = optionsQueue.Get <ResizeWorkerItem>();
            _logger           = logger.Get("ASC.CRM");

            _cacheNotify.Subscribe((x) =>
            {
                _cache.Remove($"contact_photo_cache_key_id_{x.Id}");
            }, CacheNotifyAction.Remove);
        }
Ejemplo n.º 11
0
        private readonly DistributedTaskQueue ResizeQueue;//TODO: configure

        public UserPhotoManager(
            UserManager userManager,
            WebImageSupplier webImageSupplier,
            TenantManager tenantManager,
            StorageFactory storageFactory,
            UserPhotoManagerCache userPhotoManagerCache,
            IOptionsMonitor <ILog> options,
            DistributedTaskQueueOptionsManager optionsQueue,
            SettingsManager settingsManager,
            IServiceProvider serviceProvider)
        {
            ResizeQueue           = optionsQueue.Get <ResizeWorkerItem>();
            UserManager           = userManager;
            WebImageSupplier      = webImageSupplier;
            TenantManager         = tenantManager;
            StorageFactory        = storageFactory;
            UserPhotoManagerCache = userPhotoManagerCache;
            SettingsManager       = settingsManager;
            ServiceProvider       = serviceProvider;
            Log = options.Get("ASC.Web.Photo");
        }
Ejemplo n.º 12
0
 public FileOperationsManager(DistributedTaskCacheNotify distributedTaskCacheNotify, IServiceProvider serviceProvider)
 {
     tasks           = new DistributedTaskQueue(distributedTaskCacheNotify, "fileOperations", 10);
     ServiceProvider = serviceProvider;
 }
Ejemplo n.º 13
0
 public MailBoxManager(ILogger logger)
 {
     _log            = logger;
     _mailOperations = new DistributedTaskQueue("mailOperations", MailOperationsLimit);
 }
Ejemplo n.º 14
0
 static LdapNotifyHelper()
 {
     clients   = new Dictionary <int, Tuple <INotifyClient, LdapNotifySource> >();
     ldapTasks = new DistributedTaskQueue("ldapAutoSyncOperations");
 }
Ejemplo n.º 15
0
 public EncryptionWorker(FactoryOperation factoryOperation, DistributedTaskQueueOptionsManager options)
 {
     Locker           = new object();
     FactoryOperation = factoryOperation;
     Queue            = options.Get <EncryptionOperation>();
 }
Ejemplo n.º 16
0
 public FileOperationsManager(TempStream tempStream, DistributedTaskQueueOptionsManager distributedTaskQueueOptionsManager, IServiceProvider serviceProvider)
 {
     tasks           = distributedTaskQueueOptionsManager.Get <FileOperation>();
     TempStream      = tempStream;
     ServiceProvider = serviceProvider;
 }
Ejemplo n.º 17
0
 public DocbuilderReportsUtility(DistributedTaskCacheNotify distributedTaskCacheNotify)
 {
     tasks  = new DistributedTaskQueue(distributedTaskCacheNotify, "DocbuilderReportsUtility", 10);
     Locker = new object();
 }
Ejemplo n.º 18
0
 public OperationEngine()
 {
     _mailOperations = new DistributedTaskQueue("mailOperations", Defines.MailOperationsLimit);
 }
Ejemplo n.º 19
0
 static DocbuilderReportsUtility()
 {
     tasks  = new DistributedTaskQueue("DocbuilderReportsUtility", 10);
     Locker = new object();
 }
 public DocbuilderReportsUtility(DistributedTaskQueueOptionsManager distributedTaskQueueOptionsManager)
 {
     tasks  = distributedTaskQueueOptionsManager.Get("DocbuilderReportsUtility");
     Locker = new object();
 }