Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
 }
Exemplo n.º 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;
        }
Exemplo n.º 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);
                }
            });
        }
Exemplo n.º 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");
 }
Exemplo n.º 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;
 }
Exemplo n.º 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";
 }
Exemplo n.º 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;
 }
Exemplo n.º 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");
 }
Exemplo n.º 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);
 }
Exemplo n.º 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";
 }
Exemplo n.º 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;
 }
Exemplo n.º 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()));
        }
Exemplo n.º 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);
        }
Exemplo n.º 21
0
 public TenantManager(
     ITenantService tenantService,
     IQuotaService quotaService,
     ITariffService tariffService,
     CoreBaseSettings coreBaseSettings,
     CoreSettings coreSettings)
 {
     TenantService    = tenantService;
     QuotaService     = quotaService;
     TariffService    = tariffService;
     CoreBaseSettings = coreBaseSettings;
     CoreSettings     = coreSettings;
 }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
 }
Exemplo n.º 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;
        }
Exemplo n.º 26
0
 public QuotasController(QuotaService quotaService)
 {
     _quotaService = quotaService;
 }
Exemplo n.º 27
0
 public QuotaViewModel(YesContext db, IQuotaService qs, QuotaObserverManager qom)
 {
     _db  = db;
     _qs  = qs;
     _qom = qom;
 }
Exemplo n.º 28
0
 public QuotaController(IQuotaService quotaService, IUnitOfWork db)
 {
     _db           = db;
     _quotaService = quotaService;
 }
Exemplo n.º 29
0
 public RequestsController(IUnitOfWorkWebAPI _uow,
                           IQuotaService _quotaService)
 {
     uow          = _uow;
     quotaService = _quotaService;
 }