KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_rar > deployment > xml > JonasConnectionDefinition


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or 1any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: Eric Hardesty
23  * --------------------------------------------------------------------------
24  * $Id: JonasConnectionDefinition.java,v 1.3 2004/03/18 06:28:09 ehardesty Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_rar.deployment.xml;
28
29 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
31 import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
32
33 /**
34  * This class defines the implementation of the element jonas-connection-definition
35  *
36  * @author Eric Hardesty
37  */

38
39 public class JonasConnectionDefinition extends AbsElement implements TopLevelElement {
40
41     /**
42      * id
43      */

44     private String JavaDoc id = null;
45
46     /**
47      * description
48      */

49     private JLinkedList descriptionList = null;
50
51     /**
52      * jndi-name
53      */

54     private String JavaDoc jndiName = null;
55
56     /**
57      * log-enabled
58      */

59     private String JavaDoc logEnabled = null;
60
61     /**
62      * log-topic
63      */

64     private String JavaDoc logTopic = null;
65
66     /**
67      * pool-params
68      */

69     private PoolParams poolParams = null;
70
71     /**
72      * jdbc-conn-params
73      */

74     private JdbcConnParams jdbcConnParams = null;
75
76     /**
77      * jonas-config-property
78      */

79     private JLinkedList jonasConfigPropertyList = null;
80
81
82     /**
83      * Constructor
84      */

85     public JonasConnectionDefinition() {
86         super();
87         descriptionList = new JLinkedList("description");
88         jonasConfigPropertyList = new JLinkedList("jonas-config-property");
89     }
90
91     /**
92      * Gets the id
93      * @return the id
94      */

95     public String JavaDoc getId() {
96         return id;
97     }
98
99     /**
100      * Set the id
101      * @param id id
102      */

103     public void setId(String JavaDoc id) {
104         this.id = id;
105     }
106
107     /**
108      * Gets the description
109      * @return the description
110      */

111     public JLinkedList getDescriptionList() {
112         return descriptionList;
113     }
114
115     /**
116      * Set the description
117      * @param descriptionList description
118      */

119     public void setDescriptionList(JLinkedList descriptionList) {
120         this.descriptionList = descriptionList;
121     }
122
123     /**
124      * Add a new description element to this object
125      * @param description the description String
126      */

127     public void addDescription(String JavaDoc description) {
128         descriptionList.add(description);
129     }
130
131     /**
132      * Gets the jndi-name
133      * @return the jndi-name
134      */

135     public String JavaDoc getJndiName() {
136         return jndiName;
137     }
138
139     /**
140      * Set the jndiname
141      * @param jndiName jndiname
142      */

143     public void setJndiName(String JavaDoc jndiName) {
144         this.jndiName = jndiName;
145     }
146
147     /**
148      * Gets the log-enabled
149      * @return the log-enabled
150      */

151     public String JavaDoc getLogEnabled() {
152         return logEnabled;
153     }
154
155     /**
156      * Set the log-enabled
157      * @param logEnabled logEnabled
158      */

159     public void setLogEnabled(String JavaDoc logEnabled) {
160         this.logEnabled = logEnabled;
161     }
162
163     /**
164      * Gets the log-topic
165      * @return the log-topic
166      */

167     public String JavaDoc getLogTopic() {
168         return logTopic;
169     }
170
171     /**
172      * Set the log-topic
173      * @param logTopic logTopic
174      */

175     public void setLogTopic(String JavaDoc logTopic) {
176         this.logTopic = logTopic;
177     }
178
179     /**
180      * Gets the pool-params
181      * @return the pool-params
182      */

183     public PoolParams getPoolParams() {
184         return poolParams;
185     }
186
187     /**
188      * Set the pool-params
189      * @param poolParams poolParams
190      */

191     public void setPoolParams(PoolParams poolParams) {
192         this.poolParams = poolParams;
193     }
194
195     /**
196      * Gets the jdbc-conn-params
197      * @return the jdbc-conn-params
198      */

199     public JdbcConnParams getJdbcConnParams() {
200         return jdbcConnParams;
201     }
202
203     /**
204      * Set the jdbc-conn-params
205      * @param jdbcConnParams jdbcConnParams
206      */

207     public void setJdbcConnParams(JdbcConnParams jdbcConnParams) {
208         this.jdbcConnParams = jdbcConnParams;
209     }
210
211     /**
212      * Gets the jonas-config-property
213      * @return the jonas-config-property
214      */

215     public JLinkedList getJonasConfigPropertyList() {
216         return jonasConfigPropertyList;
217     }
218
219     /**
220      * Set the jonas-config-property
221      * @param jonasConfigPropertyList jonasConfigProperty
222      */

223     public void setJonasConfigPropertyList(JLinkedList jonasConfigPropertyList) {
224         this.jonasConfigPropertyList = jonasConfigPropertyList;
225     }
226
227     /**
228      * Add a new jonas-config-property element to this object
229      * @param jonasConfigProperty the jonasConfigPropertyobject
230      */

231     public void addJonasConfigProperty(JonasConfigProperty jonasConfigProperty) {
232         jonasConfigPropertyList.add(jonasConfigProperty);
233     }
234
235     /**
236      * Represents this element by it's XML description.
237      * @param indent use this indent for prefixing XML representation.
238      * @return the XML description of this object.
239      */

240     public String JavaDoc toXML(int indent) {
241         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
242         sb.append(indent(indent));
243         sb.append("<jonas-connection-definition>\n");
244
245         indent += 2;
246
247         // id
248
sb.append(xmlElement(id, "id", indent));
249         // description
250
sb.append(descriptionList.toXML(indent));
251         // jndiname
252
sb.append(xmlElement(jndiName, "jndi-name", indent));
253         // log-enabled
254
sb.append(xmlElement(logEnabled, "log-enabled", indent));
255         // log-topic
256
sb.append(xmlElement(logTopic, "log-topic", indent));
257         // pool-params
258
if (poolParams != null) {
259             sb.append(poolParams.toXML(indent));
260         }
261         // jdbc-conn-params
262
if (jdbcConnParams != null) {
263             sb.append(jdbcConnParams.toXML(indent));
264         }
265         // jonas-config-property
266
if (jonasConfigPropertyList != null) {
267             sb.append(jonasConfigPropertyList.toXML(indent));
268         }
269         indent -= 2;
270         sb.append(indent(indent));
271         sb.append("</jonas-connection-definition>\n");
272
273         return sb.toString();
274     }
275 }
276
Popular Tags