Exemplo n.º 1
0
        /// <summary>
        ///     A CrawlRequest.
        /// </summary>
        /// <param name = "discovery">The Discovery to be crawled.</param>
        /// <param name = "depth">The depth to which this CrawlRequest should crawl.</param>
        /// <param name = "restrictCrawlTo">if set to <c>true</c> [restrict crawl to].</param>
        /// <param name = "restrictDiscoveriesTo">if set to <c>true</c> [restrict discoveries to].</param>
        /// <param name = "priority">The Priority of CrawlRequest.</param>
        public CrawlRequest(Discovery <TArachnodeDAO> discovery, int depth, UriClassificationType restrictCrawlTo, UriClassificationType restrictDiscoveriesTo, double priority, RenderType renderType, RenderType renderTypeForChildren)
        {
            if (depth <= 0)
            {
                throw new ArgumentException("Depth cannot be less than or equal to zero.", "depth");
            }

            //ANODET: This is a bug (Parent) - the user needs to be able to specify a file and a WebPage parent if the user is submitting an explicit Request for a File or an Image...
            Created = DateTime.Now;
            if (restrictCrawlTo >= UriClassificationType.OriginalDirectoryLevelUp || restrictDiscoveriesTo >= UriClassificationType.OriginalDirectoryLevelUp)
            {
                Originator = discovery;
            }
            Parent                = discovery;
            CurrentDepth          = 1;
            Discovery             = discovery;
            IsStorable            = true;
            InsertDiscovery       = true;
            MaximumDepth          = depth;
            RenderType            = renderType;
            RenderTypeForChildren = renderTypeForChildren;
            RestrictCrawlTo       = (short)restrictCrawlTo;
            RestrictDiscoveriesTo = (short)restrictDiscoveriesTo;
            Priority              = priority;
            //WasUsingDesriedMaximumMemoryInMegabytes = MemoryManager.IsUsingDesiredMaximumMemoryInMegabytes();
            Discoveries = new Discoveries <TArachnodeDAO>();
        }
Exemplo n.º 2
0
 /// <summary>
 ///     A CrawlRequest.  (Used by the Engine).
 /// </summary>
 /// <param name = "crawlRequestsRow">The crawl requests row.</param>
 internal CrawlRequest(ArachnodeDataSet.CrawlRequestsRow crawlRequestsRow, Cache <TArachnodeDAO> cache, IArachnodeDAO arachnodeDAO)
 {
     Created = crawlRequestsRow.Created;
     if (crawlRequestsRow.RestrictCrawlTo >= (short)UriClassificationType.OriginalDirectoryLevelUp || crawlRequestsRow.RestrictDiscoveriesTo >= (short)UriClassificationType.OriginalDirectoryLevelUp)
     {
         Originator = cache.GetDiscovery(crawlRequestsRow.AbsoluteUri0, arachnodeDAO);
     }
     Parent                = cache.GetDiscovery(crawlRequestsRow.AbsoluteUri1, arachnodeDAO);
     Discovery             = cache.GetDiscovery(crawlRequestsRow.AbsoluteUri2, arachnodeDAO);
     CurrentDepth          = crawlRequestsRow.CurrentDepth;
     IsStorable            = true;
     InsertDiscovery       = true;
     MaximumDepth          = crawlRequestsRow.MaximumDepth;
     RenderType            = (RenderType)crawlRequestsRow.RenderType;
     RenderTypeForChildren = (RenderType)crawlRequestsRow.RenderTypeForChildren;
     RestrictCrawlTo       = crawlRequestsRow.RestrictCrawlTo;
     RestrictDiscoveriesTo = crawlRequestsRow.RestrictDiscoveriesTo;
     Priority              = crawlRequestsRow.Priority;
     //WasUsingDesriedMaximumMemoryInMegabytes = MemoryManager.IsUsingDesiredMaximumMemoryInMegabytes();
     Discoveries    = new Discoveries <TArachnodeDAO>();
     IsFromDatabase = true;
 }
Exemplo n.º 3
0
 /// <summary>
 ///     A CrawlRequest.
 /// </summary>
 /// <param name = "originator">The discovering CrawlRequest's Orignator Discovery.</param>
 /// <param name = "parent">The discovering CrawlRequest's Discovery.</param>
 /// <param name = "discovery">The Discovery to be crawled.</param>
 /// <param name = "currentDepth">The current depth.</param>
 /// <param name = "maximumDepth">The maximum depth to which this CrawlRequest should crawl.</param>
 /// <param name = "restrictCrawlTo">The restrict crawl to.</param>
 /// <param name = "restrictDiscoveriesTo">The restrict discoveries to.</param>
 /// <param name = "priority">The Priority of CrawlRequest.</param>
 internal CrawlRequest(Discovery <TArachnodeDAO> originator, Discovery <TArachnodeDAO> parent, Discovery <TArachnodeDAO> discovery, int currentDepth, int maximumDepth, short restrictCrawlTo, short restrictDiscoveriesTo, double priority, RenderType renderType, RenderType renderTypeForChildren)
 {
     Created = DateTime.Now;
     if (restrictCrawlTo >= (short)UriClassificationType.OriginalDirectoryLevelUp || restrictDiscoveriesTo >= (short)UriClassificationType.OriginalDirectoryLevelUp)
     {
         Originator = originator;
     }
     Parent                = parent;
     CurrentDepth          = currentDepth;
     Discovery             = discovery;
     IsStorable            = true;
     InsertDiscovery       = true;
     MaximumDepth          = maximumDepth;
     RenderType            = renderType;
     RenderTypeForChildren = renderTypeForChildren;
     RestrictCrawlTo       = restrictCrawlTo;
     RestrictDiscoveriesTo = restrictDiscoveriesTo;
     Priority              = priority;
     //WasUsingDesriedMaximumMemoryInMegabytes = MemoryManager.IsUsingDesiredMaximumMemoryInMegabytes();
     //ANODET: ExpectFileOrImage = expectFileOrImage;
     Discoveries = new Discoveries <TArachnodeDAO>();
 }