KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > cache > QueryCacheItem


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  */

20 package org.enhydra.dods.cache;
21
22 import java.util.ArrayList JavaDoc;
23 import java.util.Collection JavaDoc;
24 import com.lutris.dods.builder.generator.dataobject.GenericDO;
25 import com.lutris.appserver.server.sql.CoreDataStruct;
26
27 /**
28  *
29  * This interface stores one query and its necessary data, for query array.
30  *
31  * @author Tanja Jovanovic
32  * @author Nenad Vico
33  * @version 2.0 15.06.2003.
34  *
35  */

36 public interface QueryCacheItem {
37
38     /**
39      * Returns query id (String it the form:
40      * "query_database_name.String_presentation_of_query").
41      *
42      * @return Query id.
43      */

44     public String JavaDoc getQueryId();
45
46     /**
47      * Sets query id (String it the form:
48      * "query_database_name.String_presentation_of_query").
49      *
50      * @param queryId <code>String</code> that unique represents query.
51      */

52     public void setQueryId(String JavaDoc queryId);
53
54     /**
55      * Returns OIds (Collection of object IDs which are results of the query).
56      *
57      * @return Collection of object IDs which are results of the query.
58      */

59     public Collection JavaDoc getOIds();
60
61     /**
62      * Returns number of cached query results.
63      *
64      * @return Number of cached query results.
65      */

66     public int getResultNum();
67
68     /**
69      * Returns true if all query results are cached, otherwise false.
70      *
71      * @return true if all query results are cached, otherwise false.
72      */

73     public boolean isCompleteResult();
74
75     /**
76      * Sets new boolean value about the cached query results (true if all query
77      * results are cached, otherwise false).
78      *
79      * @param newCompleteRes true if all query results are cached, otherwise
80      * false.
81      */

82     public void setCompleteResult(boolean newCompleteRes);
83
84     /**
85      * Returns true if there have been performed inserts, updates or deletes
86      * concerning results of this query, otherwise false.
87      *
88      * @return true if there have been performed inserts, updates or deletes
89      * concerning results of this query, otherwise false.
90      */

91     public boolean isModifiedQuery();
92
93     /**
94      * Sets flag coccerning information whether the query is modified.
95      *
96      * @param mod true if there have been performed inserts, updates or deletes
97      * concerning results of this query, otherwise false.
98      */

99     public void setModifiedQuery(boolean mod);
100     
101     /**
102      * Returns time needed for query execution.
103      *
104      * @return Time needed for query execution.
105      */

106     public int getTime();
107
108     /**
109      * Sets time needed for query execution.
110      *
111      * @param time Time needed for query execution.
112      */

113     public void setTime(int time);
114
115     /**
116      * Returns array of query conditions conds.
117      *
118      * @return Array of query conditions.
119      */

120     public ArrayList JavaDoc getConds();
121
122     /**
123      * Sets array of query conditions.
124      *
125      * @param conds Array of query conditions.
126      */

127     public void setConds(ArrayList JavaDoc conds);
128
129     /**
130      * Adds condition to query.
131      *
132      * @param cond <code>Condition</code> that will be added to query.
133      */

134     public void addCond(Condition cond);
135
136     /**
137      * Returns query database.
138      *
139      * @deprecated Use get_OriginDatabase()
140      * @return Query database.
141      */

142     public String JavaDoc getOriginDatabase();
143
144     /**
145      * Returns query database.
146      *
147      * @return Query database.
148      */

149     public String JavaDoc get_OriginDatabase();
150
151     /**
152      * Checks whether data object obj satisfies conditions of this query.
153      *
154      * @param obj Data object for which are checked conditions of this query.
155      * @return true if data object obj satisfies conditions of this query,
156      * otherwise false.
157      */

158     public boolean checkConditions(GenericDO obj);
159
160     /**
161      * Checks whether DataStruct object obj satisfies conditions of this query.
162      *
163      * @param obj DataStruct object for which are checked conditions of this
164      * query.
165      * @return true if DataStruct object obj satisfies conditions of this query,
166      * otherwise false.
167      */

168     public boolean checkConditions(CoreDataStruct obj);
169
170     /**
171      * Inserts data object obj (or updates it if already exists) in array DOs,
172      * if it satisfies this query.
173      *
174      * @param obj Data object which may be inserted (or updated) in array DOs.
175      */

176     public void update(GenericDO obj);
177
178     /**
179      * Inserts DataStruct object obj (or updates it if already exists) in array
180      * DOs, if it satisfies this query.
181      *
182      * @param obj DataStruct object which may be inserted (or updated) in array
183      * DOs.
184      */

185     public void update(CoreDataStruct obj);
186
187     /**
188      * Removes data object obj from array DOs, if present.
189      *
190      * @param obj Data object which will be removed from array DOs.
191      */

192     public void delete(GenericDO obj);
193
194     /**
195      * Removes DataStruct object obj from array DOs, if present.
196      *
197      * @param obj DataStruct object which will be removed from array DOs.
198      */

199     public void delete(CoreDataStruct obj);
200
201     /**
202      * Adds data object obj to array DOs.
203      *
204      * @param obj Data object which will be added to array DOs.
205      */

206     public void add(GenericDO obj);
207
208     /**
209      * Adds DataStruct object obj to array DOs.
210      *
211      * @param obj DataStruct object which will be added to array DOs.
212      */

213     public void add(CoreDataStruct obj);
214 }
215
Popular Tags