KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > search > Search


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/search/Search.java,v 1.16 2004/07/28 09:35:10 ib Exp $
3  * $Revision: 1.16 $
4  * $Date: 2004/07/28 09:35:10 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23
24 package org.apache.slide.search;
25
26 import org.apache.slide.common.ServiceAccessException;
27 import org.apache.slide.common.SlideToken;
28 import org.apache.slide.event.VetoException;
29 import org.jdom.Element;
30
31 /**
32  * Search helper.
33  *
34  * @version $Revision: 1.16 $
35  */

36 public interface Search {
37     
38     
39     // ------------------------------------------------------ Interface Methods
40

41     
42
43     /**
44      * Method search
45      *
46      * @param token a SlideToken
47      * @param query a SearchQuery
48      *
49      * @return the SearchQueryResult
50      *
51      * @throws ServiceAccessException DataSource access error
52      */

53     SearchQueryResult search(SlideToken token, SearchQuery query)
54         throws ServiceAccessException, VetoException;
55     
56     
57     /**
58      * Return the allowed query languages.
59      */

60     SearchLanguage[] getSupportedLanguages ();
61     
62     
63     /**
64      * retrieves the language bound to a specific grammarUri.
65      *
66      * @param grammarUri the URI specifying the grammar
67      *
68      * @return the SearchLanguage or null, if not found.
69      *
70      * @throws InvalidQueryException
71      *
72      */

73     SearchLanguage getLanguage (String JavaDoc grammarUri)
74         throws BadQueryException;
75     
76     
77     /**
78      * Creates a SearchQuery.
79      *
80      * @param grammarUri identifier for the SearchLanguage
81      * @param searchRequestElement the JDOM element containing the query
82      * @param token the SlideToken
83      * @param maxDepth may be 0, 1 or INFINIT
84      *
85      * @return the SearchQuery
86      *
87      * @throws BadQueryException
88      */

89     SearchQuery createSearchQuery (String JavaDoc grammarUri,
90                                 Element searchRequestElement,
91                                 SlideToken token,
92                                 int maxDepth)
93         throws BadQueryException;
94     
95     /**
96      * Creates a SearchQuery.
97      *
98      * @param grammarUri identifier for the SearchLanguage.
99      * @param searchRequestElement the JDOM element containing the query
100      * @param token the SlideToken.
101      * @param maxDepth may be 0, 1 or INFINITY.
102      * @param propertyProvider the PropertyProvider to use (may be
103      * <code>null</code>).
104      *
105      * @return the SearchQuery
106      *
107      * @throws BadQueryException
108      */

109     SearchQuery createSearchQuery (String JavaDoc grammarUri,
110                                    Element searchRequestElement,
111                                    SlideToken token,
112                                    int maxDepth,
113                                    PropertyProvider propertyProvider)
114         throws BadQueryException;
115     
116     /**
117      * Creates a SearchQuery.
118      *
119      * @param grammarUri identifier for the SearchLanguage.
120      * @param searchRequestElement the JDOM element containing the query
121      * @param token the SlideToken.
122      * @param maxDepth may be 0, 1 or INFINITY.
123      * @param requestUri the URI of the request.
124      *
125      * @return the SearchQuery
126      *
127      * @throws BadQueryException
128      */

129     SearchQuery createSearchQuery (String JavaDoc grammarUri,
130                                    Element searchRequestElement,
131                                    SlideToken token,
132                                    int maxDepth,
133                                    String JavaDoc requestUri)
134         throws BadQueryException;
135
136     /**
137      * Creates a SearchQuery.
138      *
139      * @param grammarUri identifier for the SearchLanguage.
140      * @param searchRequestElement the JDOM element containing the query
141      * @param token the SlideToken.
142      * @param maxDepth may be 0, 1 or INFINITY.
143      * @param propertyProvider the PropertyProvider to use (may be
144      * <code>null</code>).
145      * @param requestUri the URI of the request.
146      *
147      * @return the SearchQuery
148      *
149      * @throws BadQueryException
150      */

151     SearchQuery createSearchQuery (String JavaDoc grammarUri,
152                                    Element searchRequestElement,
153                                    SlideToken token,
154                                    int maxDepth,
155                                    PropertyProvider propertyProvider,
156                                    String JavaDoc requestUri)
157         throws BadQueryException;
158 }
159
Popular Tags