public Task<ISubscriptionTrackingService> CreateSubscriptionTrackingService(
     SubscriptionTrackingElement configuration)
 {
     var path = configuration.GetString("path");
     var fsTrackingBaseDir = new DirectoryInfo(GetRootedPath(path));
     var fsTrackingService = new FilesystemSubscriptionTrackingService(fsTrackingBaseDir);
     fsTrackingService.Init();
     return Task.FromResult<ISubscriptionTrackingService>(fsTrackingService);
 }
Exemplo n.º 2
0
 public async Task<ISubscriptionTrackingService> CreateSubscriptionTrackingService(
     SubscriptionTrackingElement configuration)
 {
     var path = configuration.GetString("path");
     var sqliteBaseDir = new DirectoryInfo(GetRootedPath(path));
     var sqliteSubscriptionTrackingService = new SQLiteSubscriptionTrackingService(sqliteBaseDir);
     await sqliteSubscriptionTrackingService.Init();
     return sqliteSubscriptionTrackingService;
 }
Exemplo n.º 3
0
        public static Task<ISubscriptionTrackingService> InitSubscriptionTrackingService(
            SubscriptionTrackingElement config)
        {
            var providerName = config.Provider;
            ISubscriptionTrackingServiceProvider provider;
            if (string.IsNullOrWhiteSpace(providerName))
            {
                Log.Debug("No subscription tracking service provider specified; using default provider...");
                provider = new FilesystemServicesProvider();
            }
            else
            {
                provider = ProviderHelper.GetProvider<ISubscriptionTrackingServiceProvider>(providerName);
            }

            Log.Debug("Initializing subscription tracking service...");
            return provider.CreateSubscriptionTrackingService(config);
        }
Exemplo n.º 4
0
        public async Task<ISubscriptionTrackingService> CreateSubscriptionTrackingService(
            SubscriptionTrackingElement configuration)
        {
            var connectionName = configuration.GetString("connectionName");
            if (string.IsNullOrWhiteSpace(connectionName))
            {
                throw new ConfigurationErrorsException(
                    "Attribute 'connectionName' is required for SQL subscription tracking service");
            }

            var connectionStringSettings = ConfigurationManager.ConnectionStrings[connectionName];
            if (connectionStringSettings == null)
            {
                throw new ConfigurationErrorsException("Connection string settings \"" + connectionName + "\" not found");
            }
            var sqlSubscriptionTrackingService = new SQLSubscriptionTrackingService(connectionStringSettings);
            await sqlSubscriptionTrackingService.Init();
            return sqlSubscriptionTrackingService;
        }
Exemplo n.º 5
0
 public Task<ISubscriptionTrackingService> CreateSubscriptionTrackingService(
     SubscriptionTrackingElement configuration)
 {
     return Task.FromResult<ISubscriptionTrackingService>(new InMemorySubscriptionTrackingService());
 }