KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > search > basic > IBasicQuery


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/search/basic/IBasicQuery.java,v 1.7 2004/07/28 09:35:01 ib Exp $
3  * $Revision: 1.7 $
4  * $Date: 2004/07/28 09:35:01 $
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.basic;
25
26 import org.apache.slide.common.RequestedProperties;
27 import org.apache.slide.common.ServiceAccessException;
28 import org.apache.slide.search.BadQueryException;
29 import org.apache.slide.search.InvalidScopeException;
30 import org.apache.slide.search.PropertyProvider;
31 import org.apache.slide.search.QueryScope;
32 import org.apache.slide.search.SearchQueryResult;
33 import org.apache.slide.search.SearchToken;
34 import org.apache.slide.store.AbstractStore;
35 import org.jdom.Element;
36
37 /**
38  * A BasicQuery represents the query and is able to deliver a
39  * SearchQueryResult using the execute method. It serves as a base class for
40  * store specific implementations. It hosts the information about the SELECT,
41  * FROM, WHERE, ORDERBY and LIMIT. It also holds a tree of
42  * BasicSearchExpressions.
43  *
44  * @version $Revision: 1.7 $
45  */

46 public interface IBasicQuery {
47     
48     /**
49      * Method getStore
50      *
51      * @return an AbstractStore
52      *
53      */

54     public AbstractStore getStore ();
55     
56     /**
57      * Method getSlidePath
58      *
59      * @return a String
60      *
61      * @throws InvalidScopeException
62      *
63      */

64     String JavaDoc getSlidePath () throws InvalidScopeException;
65     
66     /**
67      * Method getSearchToken
68      *
69      * @return a SearchToken
70      *
71      */

72     SearchToken getSearchToken ();
73     
74     /**
75      * Builds the internal structure from the JDOM tree. Concrete implementations
76      * may use parseQueryElementWithoutExpression to create most of the
77      * objects describing the query.
78      *
79      * @param basicSearchElement the (root) expression Element.
80      * @param propertyProvider the PropertyProvider to use (may be
81      * <code>null</code>).
82      *
83      * @throws BadQueryException
84      */

85     void parseQueryElement (Element basicSearchElement, PropertyProvider propertyProvider) throws BadQueryException;
86         
87     /**
88      * Executes a request. A store specific implementation should overwrite
89      * this to optimize the execution.
90      *
91      * @return a SearchQueryResult
92      *
93      * @throws ServiceAccessException
94      *
95      */

96     SearchQueryResult execute () throws ServiceAccessException;
97     
98         
99     /**
100      * QueryScope accessor
101      *
102      * @return the Scope
103      *
104      */

105     public QueryScope getScope ();
106     
107     /**
108      * Method getSelectedProperties
109      *
110      * @return a SelectedPropertyList
111      */

112     RequestedProperties requestedProperties ();
113     
114     /**
115      * Method getExpression
116      *
117      * @return a BasicExpression
118      *
119      */

120     IBasicExpression getExpression ();
121     
122     /**
123      * Method isLimitDefined
124      *
125      * @return true if <limit> was specified
126      */

127     boolean isLimitDefined ();
128     
129     /**
130      * Method getLimit
131      *
132      * @return the value of <limit>
133      */

134     int getLimit ();
135     
136     /**
137      * Method getPropertyProvider
138      *
139      * @return a PropertyProvider
140      *
141      */

142     PropertyProvider getPropertyProvider ();
143     
144
145     /**
146      * Method init
147      *
148      * @param token a SearchToken
149      *
150      */

151     void init (SearchToken token);
152         
153     
154     /**
155      * Method getContentExpressionFactory
156      *
157      * @return the content store / indexer specific ExpressionFactory
158      *
159      */

160     IBasicExpressionFactory getContentExpressionFactory ();
161     
162     /**
163      * Method getPropertiesExpressionFactory
164      *
165      * @return the properties store / indexer specific ExpressionFactory
166      *
167      */

168     IBasicExpressionFactory getPropertiesExpressionFactory ();
169 }
170     
171
Popular Tags