KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > storeconfig > StoreDescription


1 /*
2  * Copyright 1999-2001,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.catalina.storeconfig;
18
19 import java.util.ArrayList JavaDoc;
20 import java.util.List JavaDoc;
21
22 /**
23  * Bean of a StoreDescription
24  * @author Peter Rossbach
25  *
26  * <pre>
27  *
28  * &lt;Description
29  * tag=&quot;Context&quot;
30  * standard=&quot;true&quot;
31  * default=&quot;true&quot;
32  * externalAllowed=&quot;true&quot;
33  * storeSeparate=&quot;true&quot;
34  * backup=&quot;true&quot;
35  * childs=&quot;true&quot;
36  * tagClass=&quot;org.apache.catalina.core.StandardContext&quot;
37  * storeFactoryClass=&quot;org.apache.catalina.storeconfig.StandardContextSF&quot;
38  * storeAppenderClass=&quot;org.apache.catalina.storeconfig.StoreContextAppender&quot;&gt;
39  * &lt;TransientAttribute&gt;available&lt;/TransientAttribute&gt;
40  * &lt;TransientAttribute&gt;configFile&lt;/TransientAttribute&gt;
41  * &lt;TransientAttribute&gt;configured&lt;/TransientAttribute&gt;
42  * &lt;TransientAttribute&gt;displayName&lt;/TransientAttribute&gt;
43  * &lt;TransientAttribute&gt;distributable&lt;/TransientAttribute&gt;
44  * &lt;TransientAttribute&gt;domain&lt;/TransientAttribute&gt;
45  * &lt;TransientAttribute&gt;engineName&lt;/TransientAttribute&gt;
46  * &lt;TransientAttribute&gt;name&lt;/TransientAttribute&gt;
47  * &lt;TransientAttribute&gt;publicId&lt;/TransientAttribute&gt;
48  * &lt;TransientAttribute&gt;replaceWelcomeFiles&lt;/TransientAttribute&gt;
49  * &lt;TransientAttribute&gt;saveConfig&lt;/TransientAttribute&gt;
50  * &lt;TransientAttribute&gt;sessionTimeout&lt;/TransientAttribute&gt;
51  * &lt;TransientAttribute&gt;startupTime&lt;/TransientAttribute&gt;
52  * &lt;TransientAttribute&gt;tldScanTime&lt;/TransientAttribute&gt;
53  * &lt;/Description&gt;
54  *
55  *
56  * </pre>
57  */

58 public class StoreDescription {
59
60     private String JavaDoc id;
61
62     private String JavaDoc tag;
63
64     private String JavaDoc tagClass;
65
66     private boolean standard = false;
67
68     private boolean backup = false;
69
70     private boolean externalAllowed = false;
71
72     private boolean myDefault = false;
73
74     private boolean attributes = true;
75
76     private String JavaDoc storeFactoryClass;
77
78     private IStoreFactory storeFactory;
79
80     private String JavaDoc storeWriterClass;
81
82     private boolean childs = false;
83
84     private List JavaDoc transientAttributes;
85
86     private List JavaDoc transientChilds;
87
88     private boolean storeSeparate = false;
89
90     /**
91      * @return Returns the external.
92      */

93     public boolean isExternalAllowed() {
94         return externalAllowed;
95     }
96
97     /**
98      * @param external
99      * The external to set.
100      */

101     public void setExternalAllowed(boolean external) {
102         this.externalAllowed = external;
103     }
104
105     /**
106      * @return Returns the standard.
107      */

108     public boolean isStandard() {
109         return standard;
110     }
111
112     /**
113      * @param standard
114      * The standard to set.
115      */

116     public void setStandard(boolean standard) {
117         this.standard = standard;
118     }
119
120     /**
121      * @return Returns the backup.
122      */

123     public boolean isBackup() {
124         return backup;
125     }
126
127     /**
128      * @param backup
129      * The backup to set.
130      */

131     public void setBackup(boolean backup) {
132         this.backup = backup;
133     }
134
135     /**
136      * @return Returns the myDefault.
137      */

138     public boolean isDefault() {
139         return myDefault;
140     }
141
142     /**
143      * @param myDefault
144      * The myDefault to set.
145      */

146     public void setDefault(boolean aDefault) {
147         this.myDefault = aDefault;
148     }
149
150     /**
151      * @return Returns the storeFactory.
152      */

153     public String JavaDoc getStoreFactoryClass() {
154         return storeFactoryClass;
155     }
156
157     /**
158      * @param storeFactory
159      * The storeFactory to set.
160      */

161     public void setStoreFactoryClass(String JavaDoc storeFactoryClass) {
162         this.storeFactoryClass = storeFactoryClass;
163     }
164
165     /**
166      * @return Returns the storeFactory.
167      */

168     public IStoreFactory getStoreFactory() {
169         return storeFactory;
170     }
171
172     /**
173      * @param storeFactory
174      * The storeFactory to set.
175      */

176     public void setStoreFactory(IStoreFactory storeFactory) {
177         this.storeFactory = storeFactory;
178     }
179
180     /**
181      * @return Returns the storeWriterClass.
182      */

183     public String JavaDoc getStoreWriterClass() {
184         return storeWriterClass;
185     }
186
187     /**
188      * @param storeWriterClass
189      * The storeWriterClass to set.
190      */

191     public void setStoreWriterClass(String JavaDoc storeWriterClass) {
192         this.storeWriterClass = storeWriterClass;
193     }
194
195     /**
196      * @return Returns the tagClass.
197      */

198     public String JavaDoc getTag() {
199         return tag;
200     }
201
202     /**
203      * @param tag
204      * The tag to set.
205      */

206     public void setTag(String JavaDoc tag) {
207         this.tag = tag;
208     }
209
210     /**
211      * @return Returns the tagClass.
212      */

213     public String JavaDoc getTagClass() {
214         return tagClass;
215     }
216
217     /**
218      * @param tagClass
219      * The tagClass to set.
220      */

221     public void setTagClass(String JavaDoc tagClass) {
222         this.tagClass = tagClass;
223     }
224
225     /**
226      * @return Returns the transientAttributes.
227      */

228     public List JavaDoc getTransientAttributes() {
229         return transientAttributes;
230     }
231
232     /**
233      * @param transientAttributes
234      * The transientAttributes to set.
235      */

236     public void setTransientAttributes(List JavaDoc transientAttributes) {
237         this.transientAttributes = transientAttributes;
238     }
239
240     public void addTransientAttribute(String JavaDoc attribute) {
241         if (transientAttributes == null)
242             transientAttributes = new ArrayList JavaDoc();
243         transientAttributes.add(attribute);
244     }
245
246     public void removeTransientAttribute(String JavaDoc attribute) {
247         if (transientAttributes != null)
248             transientAttributes.remove(attribute);
249     }
250
251     /**
252      * @return Returns the transientChilds.
253      */

254     public List JavaDoc getTransientChilds() {
255         return transientChilds;
256     }
257
258     /**
259      * @param transientChilds
260      * The transientChilds to set.
261      */

262     public void setTransientChilds(List JavaDoc transientChilds) {
263         this.transientChilds = transientChilds;
264     }
265
266     public void addTransientChild(String JavaDoc classname) {
267         if (transientChilds == null)
268             transientChilds = new ArrayList JavaDoc();
269         transientChilds.add(classname);
270     }
271
272     public void removeTransientChild(String JavaDoc classname) {
273         if (transientChilds != null)
274             transientChilds.remove(classname);
275     }
276
277     /**
278      * is child transient, please don't save this.
279      *
280      * @param classname
281      * @return is classname attribute?
282      */

283     public boolean isTransientChild(String JavaDoc classname) {
284         if (transientChilds != null)
285             return transientChilds.contains(classname);
286         return false;
287     }
288
289     /**
290      * is attribute transient, please don't save this.
291      *
292      * @param attribute
293      * @return is transient attribute?
294      */

295     public boolean isTransientAttribute(String JavaDoc attribute) {
296         if (transientAttributes != null)
297             return transientAttributes.contains(attribute);
298         return false;
299     }
300
301     /**
302      * Return the real id or TagClass
303      *
304      * @return Returns the id.
305      */

306     public String JavaDoc getId() {
307         if (id != null)
308             return id;
309         else
310             return getTagClass();
311     }
312
313     /**
314      * @param id
315      * The id to set.
316      */

317     public void setId(String JavaDoc id) {
318         this.id = id;
319     }
320
321     /**
322      * @return Returns the attributes.
323      */

324     public boolean isAttributes() {
325         return attributes;
326     }
327
328     /**
329      * @param attributes
330      * The attributes to set.
331      */

332     public void setAttributes(boolean attributes) {
333         this.attributes = attributes;
334     }
335
336     /**
337      * @return
338      */

339     public boolean isStoreSeparate() {
340         return storeSeparate;
341     }
342
343     public void setStoreSeparate(boolean storeSeparate) {
344         this.storeSeparate = storeSeparate;
345     }
346
347     /**
348      * @return Returns the childs.
349      */

350     public boolean isChilds() {
351         return childs;
352     }
353
354     /**
355      * @param childs
356      * The childs to set.
357      */

358     public void setChilds(boolean childs) {
359         this.childs = childs;
360     }
361 }
Popular Tags