public IsirWsConnector(bool noCache, bool ignoreDocuments, bool onlyDocuments, int toEventId) { GlobalStats = new Stats(); Repository = new RepositoryCache(new Repository(GlobalStats), CreateNewInsolvencyProceeding, CreateNewPerson); EventsRepository = new EventsRepository(); IsirClient = noCache ? (IIsirClient) new IsirClient(GlobalStats) : new IsirClientCache(new IsirClient(GlobalStats), GlobalStats); WsClient = noCache ? (IWsClient) new WsClient() : new WsClientCache(new Lazy <IWsClient>(() => new WsClient())); IgnoreDocuments = ignoreDocuments; OnlyDocuments = onlyDocuments; ToEventId = toEventId; }
public IsirClientCache(IIsirClient underlyingClient, Stats globalStats) { GlobalStats = globalStats; UnderlyingClient = underlyingClient; if (File.Exists(CacheFile)) { foreach (var item in File.ReadLines(CacheFile)) { var parts = item.Split(';'); CachedUrls.TryAdd($"{parts[2]} {parts[3]}/{parts[4]}", "https://isir.justice.cz/isir/ueu/evidence_upadcu_detail.do?id=" + parts[8]); CachedSoudy.TryAdd($"{parts[2]} {parts[3]}/{parts[4]}", parts[0]); } } }