KickJava   Java API By Example, From Geeks To Geeks.

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


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: Florent BENOIT
23  * --------------------------------------------------------------------------
24  * $Id: JonasConnector.java,v 1.6 2005/04/14 20:20:21 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 //import org.objectweb.jonas_rar.deployment.lib.JonasConnectorSchemas;
34

35 /**
36  * This class defines the implementation of the element jonas-resource
37  *
38  * @author Florent Benoit
39  */

40
41 public class JonasConnector extends AbsElement implements TopLevelElement {
42
43     /**
44      * jndi-name
45      */

46     private String JavaDoc jndiName = null;
47
48     /**
49      * rarlink
50      */

51     private String JavaDoc rarlink = null;
52
53     /**
54      * native-lib
55      */

56     private String JavaDoc nativeLib = null;
57
58     /**
59      * log-enabled
60      */

61     private String JavaDoc logEnabled = null;
62
63     /**
64      * log-topic
65      */

66     private String JavaDoc logTopic = null;
67
68     /**
69      * pool-params
70      */

71     private PoolParams poolParams = null;
72
73     /**
74      * jdbc-conn-params
75      */

76     private JdbcConnParams jdbcConnParams = null;
77
78     /**
79      * tm-params
80      */

81     private TmParams tmParams = null;
82
83     /**
84      * jonas-config-property
85      */

86     private JLinkedList jonasConfigPropertyList = null;
87
88     /**
89      * jonas-connection-definition
90      */

91     private JLinkedList jonasConnectionDefinitionList = null;
92
93     /**
94      * jonas-activationspec
95      */

96     private JLinkedList jonasActivationspecList = null;
97
98     /**
99      * jonas-adminobject
100      */

101     private JLinkedList jonasAdminobjectList = null;
102
103     /**
104      * jonas-security-mapping
105      */

106     private JonasSecurityMapping jonasSecurityMapping = null;
107
108     public static String JavaDoc JONAS_RA_ROOT_ELEMENT = "<jonas-connector xmlns=\"http://www.objectweb.org/jonas/ns\" \n "
109     + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n "
110     + "xsi:schemaLocation=\"http://www.objectweb.org/jonas/ns \n "
111     + "http://www.objectweb.org/jonas/ns/jonas-connector_4_4.xsd\" >";
112
113
114
115     /**
116      * Constructor
117      */

118     public JonasConnector() {
119         super();
120         jonasConfigPropertyList = new JLinkedList("jonas-config-property");
121         jonasConnectionDefinitionList = new JLinkedList("jonas-connection-definition");
122         jonasActivationspecList = new JLinkedList("jonas-activationspec");
123         jonasAdminobjectList = new JLinkedList("jonas-adminobject");
124     }
125
126     /**
127      * Gets the jndiname
128      * @return the jndiname
129      */

130     public String JavaDoc getJndiName() {
131         return jndiName;
132     }
133
134     /**
135      * Set the jndi-name
136      * @param jndiName jndi-name
137      */

138     public void setJndiName(String JavaDoc jndiName) {
139         this.jndiName = jndiName;
140     }
141
142     /**
143      * Gets the rarlink
144      * @return the rarlink
145      */

146     public String JavaDoc getRarlink() {
147         return rarlink;
148     }
149
150     /**
151      * Set the rarlink
152      * @param rarlink rarlink
153      */

154     public void setRarlink(String JavaDoc rarlink) {
155         this.rarlink = rarlink;
156     }
157
158     /**
159      * Gets the native-lib
160      * @return the native-lib
161      */

162     public String JavaDoc getNativeLib() {
163         return nativeLib;
164     }
165
166     /**
167      * Set the native-lib
168      * @param nativeLib nativeLib
169      */

170     public void setNativeLib(String JavaDoc nativeLib) {
171         this.nativeLib = nativeLib;
172     }
173
174     /**
175      * Gets the log-enabled
176      * @return the log-enabled
177      */

178     public String JavaDoc getLogEnabled() {
179         return logEnabled;
180     }
181
182     /**
183      * Set the log-enabled
184      * @param logEnabled logEnabled
185      */

186     public void setLogEnabled(String JavaDoc logEnabled) {
187         this.logEnabled = logEnabled;
188     }
189
190     /**
191      * Gets the log-topic
192      * @return the log-topic
193      */

194     public String JavaDoc getLogTopic() {
195         return logTopic;
196     }
197
198     /**
199      * Set the log-topic
200      * @param logTopic logTopic
201      */

202     public void setLogTopic(String JavaDoc logTopic) {
203         this.logTopic = logTopic;
204     }
205
206     /**
207      * Gets the pool-params
208      * @return the pool-params
209      */

210     public PoolParams getPoolParams() {
211         return poolParams;
212     }
213
214     /**
215      * Set the pool-params
216      * @param poolParams poolParams
217      */

218     public void setPoolParams(PoolParams poolParams) {
219         this.poolParams = poolParams;
220     }
221
222     /**
223      * Gets the jdbc-conn-params
224      * @return the jdbc-conn-params
225      */

226     public JdbcConnParams getJdbcConnParams() {
227         return jdbcConnParams;
228     }
229
230     /**
231      * Set the jdbc-conn-params
232      * @param jdbcConnParams jdbcConnParams
233      */

234     public void setJdbcConnParams(JdbcConnParams jdbcConnParams) {
235         this.jdbcConnParams = jdbcConnParams;
236     }
237
238     /**
239      * Gets the jonas-config-property
240      * @return the jonas-config-property
241      */

242     public JLinkedList getJonasConfigPropertyList() {
243         return jonasConfigPropertyList;
244     }
245
246     /**
247      * Set the jonas-config-property
248      * @param jonasConfigPropertyList jonasConfigProperty
249      */

250     public void setJonasConfigPropertyList(JLinkedList jonasConfigPropertyList) {
251         this.jonasConfigPropertyList = jonasConfigPropertyList;
252     }
253
254     /**
255      * Add a new jonas-config-property element to this object
256      * @param jonasConfigProperty the jonasConfigPropertyobject
257      */

258     public void addJonasConfigProperty(JonasConfigProperty jonasConfigProperty) {
259         jonasConfigPropertyList.add(jonasConfigProperty);
260     }
261
262     /**
263      * Gets the jonas-connection-definition
264      * @return the jonas-connection-definition
265      */

266     public JLinkedList getJonasConnectionDefinitionList() {
267         return jonasConnectionDefinitionList;
268     }
269
270     /**
271      * Set the jonas-connection-definition-property
272      * @param jonasConnectionDefinitionList jonasConnectionDefinition list
273      */

274     public void setJonasConnectionDefinitionList(JLinkedList jonasConnectionDefinitionList) {
275         this.jonasConnectionDefinitionList = jonasConnectionDefinitionList;
276     }
277
278     /**
279      * Add a new jonas-connection-definition-property element to this object
280      * @param jonasConnectionDefinition the jonasConnectionDefinition object
281      */

282     public void addJonasConnectionDefinition(JonasConnectionDefinition jonasConnectionDefinition) {
283         jonasConnectionDefinitionList.add(jonasConnectionDefinition);
284     }
285
286     /**
287      * Gets the jonas-activationspec
288      * @return the jonas-activationspec
289      */

290     public JLinkedList getJonasActivationspecList() {
291         return jonasActivationspecList;
292     }
293
294     /**
295      * Set the jonas-activationspec-property
296      * @param jonasActivationspecList jonas-activationspec-property list
297      */

298     public void setJonasActivationspecList(JLinkedList jonasActivationspecList) {
299         this.jonasActivationspecList = jonasActivationspecList;
300     }
301
302     /**
303      * Add a new jonas-activationspec-property element to this object
304      * @param jonasActivationspec the jonasActivationspec object
305      */

306     public void addJonasActivationspec(JonasActivationspec jonasActivationspec) {
307         jonasActivationspecList.add(jonasActivationspec);
308     }
309
310     /**
311      * Gets the jonas-adminobject
312      * @return the jonas-adminobject
313      */

314     public JLinkedList getJonasAdminobjectList() {
315         return jonasAdminobjectList;
316     }
317
318     /**
319      * Set the jonas-adminobject-property
320      * @param jonasAdminobjectList jonas-adminobject-property list
321      */

322     public void setJonasAdminobjectList(JLinkedList jonasAdminobjectList) {
323         this.jonasAdminobjectList = jonasAdminobjectList;
324     }
325
326     /**
327      * Add a new jonas-adminobject-property element to this object
328      * @param jonasAdminobject the jonasAdminobject object
329      */

330     public void addJonasAdminobject(JonasAdminobject jonasAdminobject) {
331         jonasAdminobjectList.add(jonasAdminobject);
332     }
333
334     /**
335      * Gets the jonas-security-mapping
336      * @return the jonasSecurityMapping
337      */

338     public JonasSecurityMapping getJonasSecurityMapping() {
339         return jonasSecurityMapping;
340     }
341
342     /**
343      * Set the jonas-security-mapping
344      * @param JonasSecurityMapping jonasSecurityMapping
345      */

346     public void setJonasSecurityMapping(JonasSecurityMapping jonasSecurityMapping) {
347         this.jonasSecurityMapping = jonasSecurityMapping;
348     }
349
350     /**
351      * Gets the tm-params
352      * @return the tm-params
353      */

354     public TmParams getTmParams() {
355         return tmParams;
356     }
357
358     /**
359      * Set the tm-params
360      * @param tmParams tmParams
361      */

362     public void setTmParams(TmParams tmParams) {
363         this.tmParams = tmParams;
364     }
365
366     /**
367      * Represents this element by it's XML description.
368      * @param indent use this indent for prefixing XML representation.
369      * @return the XML description of this object.
370      */

371     public String JavaDoc toXML(int indent) {
372         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
373         sb.append(indent(indent));
374         sb.append(JONAS_RA_ROOT_ELEMENT+"\n");
375
376         indent += 2;
377
378         // jndiname
379
sb.append(xmlElement(jndiName, "jndi-name", indent));
380         // rarlink
381
sb.append(xmlElement(rarlink, "rarlink", indent));
382         // native-lib
383
sb.append(xmlElement(nativeLib, "native-lib", indent));
384         // log-enabled
385
sb.append(xmlElement(logEnabled, "log-enabled", indent));
386         // log-topic
387
sb.append(xmlElement(logTopic, "log-topic", indent));
388         // pool-params
389
if (poolParams != null) {
390             sb.append(poolParams.toXML(indent));
391         }
392         // jdbc-conn-params
393
if (jdbcConnParams != null) {
394             sb.append(jdbcConnParams.toXML(indent));
395         }
396         // tm-params
397
if (tmParams != null) {
398             sb.append(tmParams.toXML(indent));
399         }
400         // jonas-config-property
401
if (jonasConfigPropertyList != null) {
402             sb.append(jonasConfigPropertyList.toXML(indent));
403         }
404         // jonas-connection-definition
405
if (jonasConnectionDefinitionList != null) {
406             sb.append(jonasConnectionDefinitionList.toXML(indent));
407         }
408         // jonas-activationspec
409
if (jonasActivationspecList != null) {
410             sb.append(jonasActivationspecList.toXML(indent));
411         }
412         // jonas-adminobject
413
if (jonasAdminobjectList != null) {
414             sb.append(jonasAdminobjectList.toXML(indent));
415         }
416         // jonas-security-mapping
417
if (jonasSecurityMapping != null) {
418             sb.append(jonasSecurityMapping.toXML(indent));
419         }
420         indent -= 2;
421         sb.append(indent(indent));
422         sb.append("</jonas-connector>\n");
423
424         return sb.toString();
425     }
426 }
427
Popular Tags