Product DocsMenu

How to Implement the Run Method

In order for the project to compile, it is important to implement the Run method. The Run method is the main method of a connector; meaning that on a source Rebuild or Refresh, this method is automatically called. All the steps required to crawl the target system must occur in the scope of this method. 

Empty Run Method

protected override void Run()
{
   // Crawl content.
}

Gmail Pop3 Connector Run Method

protected override void Run()
{
   // For the Gmail pop3 server, adding recent: before the username
   // allows for retrieving all the mails received in the last 30 days.
   string recentModeLogin = string.Format("recent:{0}", Context.UserName);
   StartCrawling(recentModeLogin);
}

When this method is overridden, the project can compile and the newly created connector can be added to CES (see Adding an Additional Connector).

The method is empty; therefore, nothing can happen. To crawl specific content, it is important to retrieve the starting addresses.

See also: CustomCrawler classCrawlingContext class, How to Get Source Parameters, How to Implement the Update Method, How to Implement the PerformeInitialize Method