예제 #1
0
        public HostedSolution(
            IConfiguration configuration,
            ConnectionStringSettings connectionString,
            TariffServiceStorage tariffServiceStorage,
            IOptionsMonitor <ILog> options,
            TenantUtil tenantUtil,
            TenantDomainValidator tenantDomainValidator,
            TenantDbContext tenantDbContext,
            UserDbContext userDbContext,
            CoreDbContext coreDbContext,
            string region)
        {
            tenantService = new DbTenantService(tenantDbContext, tenantDomainValidator);
            var baseSettings = new CoreBaseSettings(configuration);

            coreSettings = new CoreSettings(tenantService, baseSettings, configuration);

            userService         = new EFUserService(userDbContext);
            quotaService        = new DbQuotaService(coreDbContext);
            tariffService       = new TariffService(quotaService, tenantService, baseSettings, coreSettings, configuration, coreDbContext, tariffServiceStorage, options);
            clientTenantManager = new TenantManager(tenantService, quotaService, tariffService, null, baseSettings, coreSettings);
            settingsManager     = new DbSettingsManager(connectionString);
            TenantUtil          = tenantUtil;
            Region = region ?? string.Empty;
        }
예제 #2
0
        private TariffService(
            IQuotaService quotaService,
            ITenantService tenantService,
            CoreBaseSettings coreBaseSettings,
            CoreSettings coreSettings,
            IConfiguration configuration,
            TariffServiceStorage tariffServiceStorage,
            IOptionsMonitor <ILog> options)

        {
            log = options.CurrentValue;
            this.quotaService    = quotaService;
            this.tenantService   = tenantService;
            CoreSettings         = coreSettings;
            Configuration        = configuration;
            TariffServiceStorage = tariffServiceStorage;
            Options          = options;
            CoreBaseSettings = coreBaseSettings;
            CacheExpiration  = DEFAULT_CACHE_EXPIRATION;
            test             = configuration["core:payment:test"] == "true";
            int.TryParse(configuration["core:payment:delay"], out paymentDelay);

            cache  = TariffServiceStorage.Cache;
            notify = TariffServiceStorage.Notify;
        }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="quotaService"></param>
 /// <param name="db"></param>
 /// <param name="userInDeptRolesService"></param>
 /// <param name="userManager"></param>
 public ConfirmQuotaController(IQuotaService quotaService, IUnitOfWork db, IUserInDeptRolesService userInDeptRolesService, IApplicationUserManager userManager)
 {
     _db = db;
     _userInDeptRolesService = userInDeptRolesService;
     _userManager            = userManager;
     _quotaService           = quotaService;
 }
예제 #4
0
        public TariffService(
            IQuotaService quotaService,
            ITenantService tenantService,
            CoreBaseSettings coreBaseSettings,
            CoreSettings coreSettings,
            IConfiguration configuration,
            DbContextManager <CoreDbContext> coreDbContextManager,
            TariffServiceStorage tariffServiceStorage,
            IOptionsMonitor <ILog> options)
            : this()

        {
            Log                  = options.CurrentValue;
            QuotaService         = quotaService;
            TenantService        = tenantService;
            CoreSettings         = coreSettings;
            Configuration        = configuration;
            TariffServiceStorage = tariffServiceStorage;
            Options              = options;
            CoreBaseSettings     = coreBaseSettings;
            Test                 = configuration["core:payment:test"] == "true";
            int.TryParse(configuration["core:payment:delay"], out var paymentDelay);

            PaymentDelay = paymentDelay;

            Cache         = TariffServiceStorage.Cache;
            Notify        = TariffServiceStorage.Notify;
            CoreDbContext = coreDbContextManager.Value;
        }
예제 #5
0
        public CachedQuotaService(IQuotaService service)
        {
            if (service == null)
            {
                throw new ArgumentNullException("service");
            }

            this.service    = service;
            cache           = AscCache.Memory;
            interval        = new TrustInterval();
            CacheExpiration = TimeSpan.FromMinutes(10);

            cacheNotify = AscCache.Notify;
            cacheNotify.Subscribe <QuotaCacheItem>((i, a) =>
            {
                if (i.Key == KEY_QUOTA_ROWS)
                {
                    interval.Expire();
                }
                else if (i.Key == KEY_QUOTA)
                {
                    cache.Remove(KEY_QUOTA);
                }
            });
        }
예제 #6
0
 public TariffService(ConnectionStringSettings connectionString, IQuotaService quotaService, ITenantService tenantService)
     : base(connectionString, null)
 {
     this.quotaService    = quotaService;
     this.tenantService   = tenantService;
     this.cache           = new AspCache();
     this.CacheExpiration = TimeSpan.FromSeconds(30);
 }
 public FlexsController(IUnitOfWorkWebAPI _uow,
                        IQuotaService _quotaService,
                        IEmailSender _emailSender)
 {
     uow          = _uow;
     quotaService = _quotaService;
     emailSender  = _emailSender;
 }
 public ClientPaymentManager(IConfigurationClient config, IQuotaService quotaService, ITariffService tariffService)
 {
     this.config        = config;
     this.quotaService  = quotaService;
     this.tariffService = tariffService;
     partnerUrl         = (ConfigurationManager.AppSettings["core.payment-partners"] ?? "https://partners.onlyoffice.com/api").TrimEnd('/');
     partnerKey         = (ConfigurationManager.AppSettings["core.machinekey"] ?? "C5C1F4E85A3A43F5B3202C24D97351DF");
 }
 public ClientPaymentManager(IConfigurationClient config, IQuotaService quotaService, ITariffService tariffService)
 {
     this.config = config;
     this.quotaService = quotaService;
     this.tariffService = tariffService;
     partnerUrl = (ConfigurationManager.AppSettings["core.payment-partners"] ?? "https://partners.onlyoffice.com/api").TrimEnd('/');
     partnerKey = (ConfigurationManager.AppSettings["core.machinekey"] ?? "C5C1F4E85A3A43F5B3202C24D97351DF");
 }
예제 #10
0
 public CachedQuotaService(DbQuotaService service, QuotaServiceCache quotaServiceCache)
 {
     this.service      = service ?? throw new ArgumentNullException("service");
     QuotaServiceCache = quotaServiceCache;
     cache             = quotaServiceCache.Cache;
     interval          = new TrustInterval();
     CacheExpiration   = TimeSpan.FromMinutes(10);
     cacheNotify       = quotaServiceCache.CacheNotify;
 }
예제 #11
0
 public TariffService(ConnectionStringSettings connectionString, IQuotaService quotaService, ITenantService tenantService)
     : base(connectionString, "tenant")
 {
     this.quotaService = quotaService;
     this.tenantService = tenantService;
     this.config = new CoreConfiguration(tenantService);
     this.cache = AscCache.Default;
     this.CacheExpiration = DEFAULT_CACHE_EXPIRATION;
     this.test = ConfigurationManager.AppSettings["core.payment-test"] == "true";
 }
예제 #12
0
 public HostedSolution(ConnectionStringSettings connectionString, string region)
 {
     tenantService       = new DbTenantService(connectionString);
     userService         = new DbUserService(connectionString);
     quotaService        = new DbQuotaService(connectionString);
     tariffService       = new TariffService(connectionString, quotaService, tenantService);
     clientTenantManager = new TenantManager(tenantService, quotaService, tariffService);
     Region = region ?? string.Empty;
     DbId   = connectionString.Name;
 }
예제 #13
0
 public PaymentManager(CoreSettings config, TenantManager tenantManager, IQuotaService quotaService, ITariffService tariffService, IConfiguration configuration)
 {
     this.config        = config;
     TenantManager      = tenantManager;
     this.quotaService  = quotaService;
     this.tariffService = tariffService;
     Configuration      = configuration;
     partnerUrl         = (Configuration["core:payment:partners"] ?? "https://partners.onlyoffice.com/api").TrimEnd('/');
     partnerKey         = (Configuration["core:machinekey"] ?? "C5C1F4E85A3A43F5B3202C24D97351DF");
 }
예제 #14
0
 public TariffService(ConnectionStringSettings connectionString, IQuotaService quotaService, ITenantService tenantService)
     : base(connectionString, "tenant")
 {
     this.quotaService  = quotaService;
     this.tenantService = tenantService;
     config             = new CoreConfiguration(tenantService);
     CacheExpiration    = DEFAULT_CACHE_EXPIRATION;
     test = ConfigurationManagerExtension.AppSettings["core.payment-test"] == "true";
     int.TryParse(ConfigurationManagerExtension.AppSettings["core.payment-delay"], out paymentDelay);
 }
예제 #15
0
 public TariffService(ConnectionStringSettings connectionString, IQuotaService quotaService, ITenantService tenantService)
     : base(connectionString, "tenant")
 {
     this.quotaService    = quotaService;
     this.tenantService   = tenantService;
     this.config          = new CoreConfiguration(tenantService);
     this.cache           = AscCache.Default;
     this.CacheExpiration = DEFAULT_CACHE_EXPIRATION;
     this.test            = ConfigurationManager.AppSettings["core.payment-test"] == "true";
 }
예제 #16
0
 public HostedSolution(ConnectionStringSettings connectionString, string region)
 {
     tenantService = new DbTenantService(connectionString);
     userService = new DbUserService(connectionString);
     quotaService = new DbQuotaService(connectionString);
     tariffService = new TariffService(connectionString, quotaService, tenantService);
     clientTenantManager = new TenantManager(tenantService, quotaService, tariffService);
     Region = region ?? string.Empty;
     DbId = connectionString.Name;
 }
예제 #17
0
 public TenantManager(
     ITenantService tenantService,
     IQuotaService quotaService,
     ITariffService tariffService,
     IHttpContextAccessor httpContextAccessor,
     CoreBaseSettings coreBaseSettings,
     CoreSettings coreSettings) : this(tenantService, quotaService, tariffService, coreBaseSettings, coreSettings)
 {
     HttpContextAccessor = httpContextAccessor;
 }
        public ClientTenantManager(ITenantService tenantService, IQuotaService quotaService, ITariffService tariffService)
        {
            this.tenantService = tenantService;
            this.quotaService = quotaService;
            this.tariffService = tariffService;

            thisCompAddresses.Add("localhost");
            thisCompAddresses.Add(Dns.GetHostName().ToLowerInvariant());
            thisCompAddresses.AddRange(Dns.GetHostAddresses("localhost").Select(a => a.ToString()));
            thisCompAddresses.AddRange(Dns.GetHostAddresses(Dns.GetHostName()).Select(a => a.ToString()));
        }
예제 #19
0
        public TenantManager(ITenantService tenantService, IQuotaService quotaService, ITariffService tariffService)
        {
            this.tenantService = tenantService;
            this.quotaService  = quotaService;
            this.tariffService = tariffService;

            thisCompAddresses.Add("localhost");
            thisCompAddresses.Add(Dns.GetHostName().ToLowerInvariant());
            thisCompAddresses.AddRange(Dns.GetHostAddresses("localhost").Select(a => a.ToString()));
            thisCompAddresses.AddRange(Dns.GetHostAddresses(Dns.GetHostName()).Select(a => a.ToString()));
        }
        public CachedQuotaService(IQuotaService service)
        {
            if (service == null) throw new ArgumentNullException("service");

            this.service = service;
            this.cache = new AspCache();
            this.interval = new TrustInterval();
            this.syncQuotaRows = 0;

            CacheExpiration = TimeSpan.FromMinutes(10);
        }
예제 #21
0
 public TenantManager(
     ITenantService tenantService,
     IQuotaService quotaService,
     ITariffService tariffService,
     CoreBaseSettings coreBaseSettings,
     CoreSettings coreSettings)
 {
     TenantService    = tenantService;
     QuotaService     = quotaService;
     TariffService    = tariffService;
     CoreBaseSettings = coreBaseSettings;
     CoreSettings     = coreSettings;
 }
예제 #22
0
        public CachedQuotaService(IQuotaService service)
        {
            if (service == null)
            {
                throw new ArgumentNullException("service");
            }

            this.service       = service;
            this.cache         = new AspCache();
            this.interval      = new TrustInterval();
            this.syncQuotaRows = 0;

            CacheExpiration = TimeSpan.FromMinutes(10);
        }
예제 #23
0
        public TariffService(
            IQuotaService quotaService,
            ITenantService tenantService,
            CoreBaseSettings coreBaseSettings,
            CoreSettings coreSettings,
            IConfiguration configuration,
            CoreDbContext coreDbContext,
            TariffServiceStorage tariffServiceStorage,
            IOptionsMonitor <ILog> options)
            : this(quotaService, tenantService, coreBaseSettings, coreSettings, configuration, tariffServiceStorage, options)

        {
            CoreDbContext = coreDbContext;
        }
예제 #24
0
 public TenantManager(
     ITenantService tenantService,
     IQuotaService quotaService,
     ITariffService tariffService,
     IHttpContextAccessor httpContextAccessor,
     CoreBaseSettings coreBaseSettings,
     CoreSettings coreSettings)
 {
     TenantService    = tenantService;
     QuotaService     = quotaService;
     TariffService    = tariffService;
     CoreBaseSettings = coreBaseSettings;
     CoreSettings     = coreSettings;
     HttpContext      = httpContextAccessor?.HttpContext;
 }
예제 #25
0
        //TODO:fix
        public HostedSolution(
            IConfiguration configuration,
            TenantDomainValidator tenantDomainValidator,
            TimeZoneConverter timeZoneConverter,
            DbRegistry dbRegistry,
            ConnectionStringSettings connectionString,
            TariffServiceStorage tariffServiceStorage,
            IOptionsMonitor <ILog> options,
            string region)
        {
            tenantService = new DbTenantService(null, null, null);
            var baseSettings = new CoreBaseSettings(configuration);

            coreSettings = new CoreSettings(tenantService, baseSettings, configuration);

            userService         = new DbUserService(null);
            quotaService        = new DbQuotaService(null);
            tariffService       = new TariffService(quotaService, tenantService, baseSettings, coreSettings, configuration, null, tariffServiceStorage, options);
            clientTenantManager = new TenantManager(tenantService, quotaService, tariffService, null, baseSettings, coreSettings);
            settingsManager     = new DbSettingsManager(connectionString);
            Region = region ?? string.Empty;
            DbId   = connectionString.Name;
        }
예제 #26
0
 public QuotasController(QuotaService quotaService)
 {
     _quotaService = quotaService;
 }
예제 #27
0
 public QuotaViewModel(YesContext db, IQuotaService qs, QuotaObserverManager qom)
 {
     _db  = db;
     _qs  = qs;
     _qom = qom;
 }
예제 #28
0
 public QuotaController(IQuotaService quotaService, IUnitOfWork db)
 {
     _db           = db;
     _quotaService = quotaService;
 }
예제 #29
0
 public RequestsController(IUnitOfWorkWebAPI _uow,
                           IQuotaService _quotaService)
 {
     uow          = _uow;
     quotaService = _quotaService;
 }