Exemplo n.º 1
0
        /// <summary>
        /// Adds the specified link if not already known
        /// </summary>
        /// <param name="link">The link.</param>
        /// <returns></returns>
        public bool Add(spiderPage page)
        {
            string key = page.getPageSignature(useCription);

            if (items.ContainsKey(key))
            {
                if (items[key].webpage.isCrawled == false)
                {
                    if (page.webpage.isCrawled)
                    {
                        items[key] = page;
                        imbWEMManager.log.log("Temp. spiderPage [" + items[key].name + "] replaced by new instance for domain [" + page.webpage.domain + "]");
                    }
                    else
                    {
                        aceLog.log("---- This page is not crawled yet and it cannot substitute registrated one ----");
                        // throw new aceGeneralException("This page is not crawled yet and it cannot substitute registrated one", null, this, "New page under same key is not crawled");
                    }
                }
                else
                {
                    aceLog.log("---- shouldn't replace existing page if it is crawled yet ----");
                    //throw new aceGeneralException("You shouldn't replace existing page if it is crawled yet", null, this, "Page under same key is crawled");
                }


                return(false);
            }
            else
            {
                items.Add(key, page);
                hashList.Add(key);
                return(true);
            }
        }
Exemplo n.º 2
0
 public bool HasCrossLinkWith(spiderPage whom)
 {
     return(crossLinks.ContainsKey(whom.getPageSignature(true)));
 }