Exemple #1
0
 public void DeleteCrawledLink(Guid id)
 {
     if (CrawledLinks.ContainsKey(id))
     {
         CrawledLinks.Remove(id);
     }
 }
Exemple #2
0
        public void AddCrawledLink(CrawledLink link, bool removeCorrespondingLinkToCrawl)
        {
            // delete from LinksToCrawl first
            Thread.Sleep(100);
            if (removeCorrespondingLinkToCrawl)
            {
                DeleteLinkToCrawl(link.SessionId, link.SourceUrl, link.TargetUrl);
            }

            link.Id = NextId;
            CrawledLinks.Add(link.Id, link);
        }
Exemple #3
0
        public void ClearCrawledLinks(int sessionId, int crawlerId)
        {
            List <Guid> toRemove = new List <Guid>();

            foreach (var link in CrawledLinks.Values)
            {
                if (link.SessionId == sessionId && link.CrawlerId == crawlerId)
                {
                    toRemove.Add(link.Id);
                }
            }
            foreach (var id in toRemove)
            {
                CrawledLinks.Remove(id);
            }
        }
Exemple #4
0
 public int GetCountOfCrawledLinks(int sessionId, int crawlerId)
 {
     return(CrawledLinks.Count());
 }