Skip to main content
summaryrefslogtreecommitdiffstats
blob: 5c3df8643a68dd75aa97b21f0e9583ef3ba1d890 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*******************************************************************************
 * Copyright (c) 2000, 2015 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.help.search;

import org.eclipse.core.runtime.IStatus;

/**
 * A collector for the search hits (asynchronously) returned by the help search
 * participants.
 * <p>
 * This interface is intended to be implemented by clients and passed to the
 * search engine instance.
 *
 * @since 3.1
 */
public interface ISearchEngineResultCollector {
	/**
	 * Accepts a new search result object.
	 *
	 * @param searchResult
	 *            the new search result
	 */
	void accept(ISearchEngineResult searchResult);

	/**
	 * Accepts an array of new search results.
	 *
	 * @param searchResults
	 *            an array of search result objects
	 */
	void accept(ISearchEngineResult[] searchResults);

	/**
	 * Notifies the collector that an error has occured in the search engine.
	 * The kinds of errors that are reported this way are not abnormal problems
	 * or internal errors. Unexpected problems should be left to the job manager
	 * to handle by throwing a <code>CoreException</code>. Use this method to
	 * report errors that are expected to occur from time to time (e.g., server
	 * down, server timeout, incorrect URL etc.).
	 *
	 * @param status
	 *            the reported error status
	 */
	void error(IStatus status);
}

Back to the top