01: package org.columba.core.search.api;
02:
03: import java.util.Iterator;
04: import java.util.List;
05:
06: /**
07: * Search Provider Registry.
08: *
09: * @author frd
10: */
11: public interface ISearchManager {
12:
13: public void registerProvider(ISearchProvider p);
14:
15: public void unregisterProvider(ISearchProvider p);
16:
17: public ISearchProvider getProvider(String technicalName);
18:
19: public Iterator<ISearchProvider> getAllProviders();
20:
21: /**
22: * Execute query and retrieve pageable search result for given search term.
23: * <p>
24: * The query returns <code>resultCount</code> individual results, from
25: * a given <code>startIndex</code>. Paging should be supported, so its
26: * up to the underlying implementation to use an intelligent caching
27: * strategy or whatsoever.
28: *
29: * @param searchTerm search term
30: * @param searchInside search inside previous search results
31: * @param startIndex start index of search results
32: * @param resultCount total count of results
33: */
34: public void executeSearch(String searchTerm, boolean searchInside,
35: int startIndex, int resultCount);
36:
37: /**
38: * Execute query and retrieve pageable search result for given search term.
39: * <p>
40: * The query returns <code>resultCount</code> individual results, from
41: * a given <code>startIndex</code>. Paging should be supported, so its
42: * up to the underlying implementation to use an intelligent caching
43: * strategy or whatsoever.
44: *
45: * @param searchTerm
46: * @param providerName
47: * @param startIndex start index of search results
48: * @param resultCount total count of results
49: *
50: */
51: public void executeSearch(String searchTerm, String providerName,
52: boolean searchInside, int startIndex, int resultCount);
53:
54: /**
55: * Execute query and retrieve pageable search result for given search term.
56: * <p>
57: * The query returns <code>resultCount</code> individual results, from
58: * a given <code>startIndex</code>. Paging should be supported, so its
59: * up to the underlying implementation to use an intelligent caching
60: * strategy or whatsoever.
61: *
62: * @param searchTerm
63: * @param providerName
64: * @param criteriaName
65: * @param startIndex start index of search results
66: * @param resultCount total count of results
67: *
68: */
69: public void executeSearch(String searchTerm, String providerName,
70: String criteriaName, boolean searchInside, int startIndex,
71: int resultCount);
72:
73: public void executeSearch(List<ISearchRequest> requests,
74: boolean allCriteria, boolean searchInside, int startIndex,
75: int resultCount);
76:
77: /**
78: * Clear a search and discard all cached data for this <code>searchTerm</code>.
79: *
80: * @param searchTerm search term
81: */
82: public void clearSearch(String searchTerm);
83:
84: public void reset();
85:
86: public void addResultListener(IResultListener listener);
87:
88: public void removeResultListener(IResultListener listener);
89: }
|