wiki:ApertureDataCrawlerListener

Version 1 (modified by sauermann, 19 years ago) (diff)

--

/**
 * A listener for events from a DataCrawler.
 **/
public interface DataCrawlerListener {

	/**
	 * Notification that the specified DataCrawler has started
	 * scanning its domain for data objects.
	 *
	 * @param dataSource The concerning data source.
	 **/
	public void scanStarted(DataCrawler dataCrawler);

	/**
	 * Notification that the specified DataCrawler has stopped
	 * scanning its DataSource for DataObjects. The crawler might
	 * have completed scanning its domain, it might have been
	 * requested to stop by someone or it might have stopped
     * because of a fatal exception.
	 *
	 * @param dataSource The concerning DataCrawler.
	 * @param exitCode The status with which the scan method stopped.
	 **/
	public void scanStopped(DataCrawler dataCrawler, DataCrawler.ExitCode exitCode);

	/**
	 * Notification that the DataCrawler is going to start scanning
	 * the specified data object.
	 *
	 * @param url The url of the data object that is going to be scanned.
	 **/
	public void scanningObject(DataCrawler dataCrawler, String url);

	/**
	 * Notification that the DataCrawler has found a new or changed
	 * DataObject in its scan domain.
	 *
	 * @param dataObject The DataObject that has been constructed.
	 * @param newObject Flag indicating whether the scanned object is
	 * new (true) or that it has been scanned before but has
	 * changed (false).
	 **/
	public void objectScanned(DataCrawler dataCrawler, DataObject dataObject, boolean newObject);

	/**
	 * Notification that the DataCrawler has found a data object that
	 * has not been modified since the previous scan.
	 *
	 * @param url The url of the unmodified data object.
	 **/
	public void objectNotModified(DataCrawler dataCrawler, String url);

	/**
	 * Notification that the data object with the specified
	 * url that was found in an earlier scan could no longer
	 * be found in this scan. This may indicate that the physical
     * resource no longer exists or that it now falls outside the defined domain.
	 *
	 * @param id The id of the data object that could no longer be found.
	 **/
	public void objectRemoved(DataCrawler dataCrawler, String url);

	/**
	 * Notification that the specified DataCrawler has started
	 * clearing its scan results cache.
	 *
	 * @param dataSource The concerning DataCrawler.
	 **/
	public void clearStarted(DataCrawler dataCrawler);

	/**
	 * Notification that the specified DataCrawler has finished
	 * clearing its scan results cache.
	 *
	 * @param dataSource The concerning DataCrawler.
	 **/
	public void clearFinished(DataCrawler dataCrawler);

	/**
	 * Notification that the data object with the specified url
	 * is going to be removed from the DataCrawler's scan results cache.
	 * This method is typically called at the start of a full rescan.
	 **/
	public void clearingObject(DataCrawler dataCrawler, String url);
}