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); }
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; }
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); }
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; }
public Task<ISubscriptionTrackingService> CreateSubscriptionTrackingService( SubscriptionTrackingElement configuration) { return Task.FromResult<ISubscriptionTrackingService>(new InMemorySubscriptionTrackingService()); }