KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > cofax > DummyDataStore


1 /*
2  * DummyDataStore is part of the Cofax content management system library.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Please see http://www.cofax.org for contact information and other related informaion.
19  */

20
21 package org.cofax;
22
23 import java.util.*;
24
25 /**
26  * Provides an empty data store for use if no database connectivity is desired.
27  * A subclass of <code>DataStore</code>.
28  *
29  * <p>
30  * There is no mention of the <code>DummyDataStore</code> class in
31  * <code>CofaxServlet</code>. <code>DataStore</code> classes are listed in
32  * the configuration.
33  * </p>
34  *
35  * @author Karl Martino
36  * @version 1.9.6
37  */

38
39 public class DummyDataStore extends DataStore {
40
41     /**
42      * Empty init() method
43      */

44     public void init(String JavaDoc configFile) {
45
46         return;
47
48     }
49
50     /**
51      * Empty init() method
52      */

53     public void init(Properties dbProps) {
54
55         return;
56
57     }
58
59     /**
60      * Empty init() method
61      */

62     public void initPool() {
63
64         return;
65
66     }
67
68     /**
69      * Empty setCache method
70      */

71     public void setCache(Object JavaDoc cache, int whichCache) {
72
73         return;
74
75     }
76
77     public void clearCache(int whichCache) {
78
79         return;
80
81     }
82
83     public Object JavaDoc getCacheValue(Object JavaDoc key, int whichCache) {
84
85         return null;
86
87     }
88
89     /**
90      * Empty connect method always reports success
91      */

92     public final boolean connect() {
93
94         setLastError("");
95
96         return true;
97
98     }
99
100     /**
101      * Empty connect method always reports success
102      */

103     public final boolean connectFromPool() {
104
105         setLastError("");
106
107         return true;
108
109     }
110
111     /**
112      * Empty getPackageTag method, always returns an empty string.
113      */

114     public final String JavaDoc getPackageTag(String JavaDoc tag, HashMap params, String JavaDoc servPage, String JavaDoc servAddr) {
115
116         return "";
117
118     }
119
120     /**
121      * Empty getPackageData routine, returns an empty ArrayList
122      */

123     public final List getPackageData(String JavaDoc tag, String JavaDoc tagStatement, String JavaDoc servPage, String JavaDoc servAddr) {
124
125         ArrayList articles = new ArrayList();
126
127         return articles;
128
129     } // getPackageData
130

131     /**
132      * Empty disconnect method
133      */

134     public final boolean disConnect() {
135
136         return true;
137
138     }
139
140     /**
141      * Empty destroy method
142      */

143     public void destroy() {
144
145         return;
146
147     }
148
149     public boolean insertArticle(HashMap article, String JavaDoc approvedBy, String JavaDoc xmlFileType, ArrayList mappings, ArrayList relatedLinks) {
150         return true;
151     }
152
153     public List getPackageData(HashMap data, String JavaDoc tagName, String JavaDoc tagData, boolean init) {
154         ArrayList list = new ArrayList();
155         return (list);
156     }
157
158     public String JavaDoc getPoolConnectionStats(String JavaDoc name) {
159
160         return ("");
161
162     }
163
164     public String JavaDoc getURL() {
165         return "";
166     }
167
168     public String JavaDoc getUser() {
169         return "";
170     }
171
172     public String JavaDoc getPassword() {
173         return "";
174     }
175
176     public int getMaxConns() {
177         return 0;
178     }
179
180     public int getInitConns() {
181         return 0;
182     }
183
184     public int getTimeOut() {
185         return 0;
186     }
187
188     public int getConUsageLimit() {
189         return 0;
190     }
191
192     public long getKillTime() {
193         return 0;
194     }
195
196     public void setURL(String JavaDoc in) {
197     }
198
199     public void setUser(String JavaDoc in) {
200     }
201
202     public void setPassword(String JavaDoc in) {
203     }
204
205     public void setMaxConns(int in) {
206     }
207
208     public void setInitConns(int in) {
209     }
210
211     public void setTimeOut(int in) {
212     }
213
214     public void setConUsageLimit(int in) {
215     }
216
217     public void setKillTime(long in) {
218     }
219
220     /**
221      * Hashmap into which package tags may be placed into memory upon
222      * initialization.
223      */

224     public HashMap dbPackageTags;
225
226     /**
227      * Hashmap into which the cache results parameter (1,0) is thrown upon
228      * initialization.
229      */

230     public HashMap dbPackageTagsCacheCommand;
231
232     /**
233      * Hashmap into which package tag results are cached.
234      */

235     public HashMap dbPackageTagsCache;
236
237     public HashMap searchArticles(HashMap htParams) {
238         HashMap htReturn = new HashMap();
239         htReturn.put("SQLState", "");
240         htReturn.put("thisSearch", "");
241         return htReturn;
242     }
243
244     public String JavaDoc selectPackagetags() {
245         return ("select TAG_NAME, TAG_VALUE from goon.dbo.tbltoolspackagetags");
246     }
247
248     public String JavaDoc selectPackagetagsCache() {
249         return ("select TAG_VALUE, CACHE from goon.dbo.tbltoolspackagetags");
250     }
251
252 }
253
Popular Tags