File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\search\SearchFactory.java.html

1 package hudson.search;
2
3 import hudson.Extension;
4 import hudson.ExtensionList;
5 import hudson.ExtensionPoint;
6 import jenkins.model.Jenkins;
7
8 /**
9 * Creates a {@link Search} instance for a {@link SearchableModelObject}.
10 *
11 * <p>
12 * This allows you to plug in different backends to the search, such as full-text search,
13 * or more intelligent user-sensitive search, etc. Puts @{@link Extension} annotation
14 * on your implementation to have it registered.
15 *
16 * <p>
17 * Right now, there's no user control over which {@link SearchFactory} takes priority,
18 * but we may do so later.
19 *
20 * @author Kohsuke Kawaguchi
21 * @since 1.469
22 */
23 public abstract class SearchFactory implements ExtensionPoint {
24 /**
25 * Creates a {@link Search} object.
26 *
27 * This method needs to execute quickly (without actually executing any search),
28 * since it is created per incoming HTTP response.
29 *
30 * @param owner
31 * The {@link SearchableModelObject} object for which we are creating the search.
32 * The returned object will provide the search for this object.
33 * @return
34 * null if your factory isn't interested in creating a {@link Search} object.
35 * The next factory will get a chance to act on it.
36 */
37 public abstract Search createFor(SearchableModelObject owner);
38
39 /**
40 * Returns all the registered {@link SearchFactory} instances.
41 */
42 public static ExtensionList<SearchFactory> all() {
43 return Jenkins.getInstance().getExtensionList(SearchFactory.class);
44 }
45 }
46