SMILA (incubation) API documentation

org.eclipse.smila.connectivity.framework.impl
Class CrawlerControllerImpl

java.lang.Object
  extended by org.eclipse.smila.connectivity.framework.impl.AbstractController
      extended by org.eclipse.smila.connectivity.framework.impl.CrawlerControllerImpl
All Implemented Interfaces:
CrawlerController, ControllerCallback, CrawlerControllerCallback

public class CrawlerControllerImpl
extends AbstractController
implements CrawlerController, CrawlerControllerCallback

Basic Implementation of a CrawlerController.


Field Summary
 
Fields inherited from interface org.eclipse.smila.connectivity.framework.CrawlerController
PERFORMANCE_AGENT_LOCATION
 
Constructor Summary
CrawlerControllerImpl()
          Default Constructor.
 
Method Summary
 java.util.Collection<java.lang.String> getAvailableConfigurations()
          returns all available Crawler data source configurations.
 java.util.Collection<java.lang.String> getAvailableCrawlers()
          returns the CrawlerController known Crawlers.
 java.util.Map<java.lang.String,CrawlState> getCrawlerTasksState()
          Gets the status of all crawler tasks as a map of data source id and crawler state.
 boolean hasActiveCrawls()
          Checks if there are any active crawls.
 int startCrawl(java.lang.String dataSourceId)
          Starts a crawl of the given dataSourceId.
 void stopCrawl(java.lang.String dataSourceId)
          Stops an active crawl of the given dataSourceId.
 void unregister(java.lang.String dataSourceId)
          Removes a CrawlThread for the given DataSourceId from the list of active CrawlThreads.
 
Methods inherited from class org.eclipse.smila.connectivity.framework.impl.AbstractController
addComponentFactory, createInstance, doCheckForUpdate, doDeltaDelete, doDeltaIndexing, getAvailableFactories, getCompoundManager, getConfiguration, getConfigurations, getConnectivityManager, getDeltaIndexingManager, removeComponentFactory, setCompoundManager, setConnectivityManager, setDeltaIndexingManager, unsetCompoundManager, unsetConnectivityManager, unsetDeltaIndexingManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.smila.connectivity.framework.util.ControllerCallback
doCheckForUpdate, doDeltaDelete, doDeltaIndexing
 

Constructor Detail

CrawlerControllerImpl

public CrawlerControllerImpl()
Default Constructor.

Method Detail

startCrawl

public int startCrawl(java.lang.String dataSourceId)
               throws ConnectivityException
Starts a crawl of the given dataSourceId. This method creates a new Thread. If it is called for a dataSourceId that is currently crawled a ConnectivityException is thrown. Returns the hashCode of the crawler instance used for performance counter.

Specified by:
startCrawl in interface CrawlerController
Parameters:
dataSourceId - the ID of the data source to crawl
Returns:
- the hashcode of the crawler instance as int value
Throws:
ConnectivityException - if any error occurs
See Also:
CrawlerController.startCrawl(java.lang.String)

stopCrawl

public void stopCrawl(java.lang.String dataSourceId)
               throws ConnectivityException
Stops an active crawl of the given dataSourceId.

Specified by:
stopCrawl in interface CrawlerController
Parameters:
dataSourceId - the ID of the data source to stop the crawl
Throws:
ConnectivityException - if any error occurs
See Also:
CrawlerController.stopCrawl(java.lang.String)

hasActiveCrawls

public boolean hasActiveCrawls()
                        throws ConnectivityException
Checks if there are any active crawls.

Specified by:
hasActiveCrawls in interface CrawlerController
Returns:
true if there are active crawls, false otherwise
Throws:
ConnectivityException - if any error occurs
See Also:
CrawlerController.hasActiveCrawls()

getCrawlerTasksState

public java.util.Map<java.lang.String,CrawlState> getCrawlerTasksState()
Gets the status of all crawler tasks as a map of data source id and crawler state.

Specified by:
getCrawlerTasksState in interface CrawlerController
Returns:
a map of data source id and crawler state.
See Also:
org.eclipse.smila.connectivity.framework.CrawlerController#getAgentTasksState()

unregister

public void unregister(java.lang.String dataSourceId)
Removes a CrawlThread for the given DataSourceId from the list of active CrawlThreads.

Specified by:
unregister in interface CrawlerControllerCallback
Parameters:
dataSourceId - the ID of the data source to crawl
See Also:
CrawlerControllerCallback.unregister(java.lang.String)

getAvailableCrawlers

public java.util.Collection<java.lang.String> getAvailableCrawlers()
returns the CrawlerController known Crawlers.

Specified by:
getAvailableCrawlers in interface CrawlerController
Returns:
Collection with Strings
See Also:
CrawlerController.getAvailableCrawlers()

getAvailableConfigurations

public java.util.Collection<java.lang.String> getAvailableConfigurations()
returns all available Crawler data source configurations.

Specified by:
getAvailableConfigurations in interface CrawlerController
Returns:
List with Strings of all available Crawler data source configurations
See Also:
CrawlerController.getAvailableConfigurations()

SMILA (incubation) API documentation