001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: *
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or 1any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
020: * USA
021: *
022: * Initial developer: Florent BENOIT
023: * --------------------------------------------------------------------------
024: * $Id: Resourceadapter.java 5699 2004-10-29 23:33:37Z ehardesty $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_rar.deployment.xml;
027:
028: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
029: import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
030:
031: /**
032: * This class defines the implementation of the element resourceadapter
033: *
034: * @author Florent Benoit
035: */
036:
037: public class Resourceadapter extends AbsElement {
038:
039: /**
040: * resourceadapter-class
041: */
042: private String resourceadapterClass = null;
043:
044: /**
045: * managedconnectionfactory-class
046: */
047: private String managedconnectionfactoryClass = null;
048:
049: /**
050: * connectionfactory-interface
051: */
052: private String connectionfactoryInterface = null;
053:
054: /**
055: * connectionfactory-impl-class
056: */
057: private String connectionfactoryImplClass = null;
058:
059: /**
060: * connection-interface
061: */
062: private String connectionInterface = null;
063:
064: /**
065: * connection-impl-class
066: */
067: private String connectionImplClass = null;
068:
069: /**
070: * transaction-support
071: */
072: private String transactionSupport = null;
073:
074: /**
075: * config-property
076: */
077: private JLinkedList configPropertyList = null;
078:
079: /**
080: * authentication-mechanism
081: */
082: private JLinkedList authenticationMechanismList = null;
083:
084: /**
085: * outbound-resourceadapter
086: */
087: private OutboundResourceadapter outboundResourceadapter = null;
088:
089: /**
090: * inbound-resourceadapter
091: */
092: private InboundResourceadapter inboundResourceadapter = null;
093:
094: /**
095: * adminobject
096: */
097: private JLinkedList adminobjectList = null;
098:
099: /**
100: * reauthentication-support
101: */
102: private String reauthenticationSupport = null;
103:
104: /**
105: * security-permission
106: */
107: private JLinkedList securityPermissionList = null;
108:
109: /**
110: * Constructor
111: */
112: public Resourceadapter() {
113: super ();
114: configPropertyList = new JLinkedList("config-property");
115: authenticationMechanismList = new JLinkedList(
116: "authentication-mechanism");
117: adminobjectList = new JLinkedList("adminobject");
118: securityPermissionList = new JLinkedList("security-permission");
119: }
120:
121: /**
122: * Gets the resourceadapter-class
123: * @return the resourceadapter-class
124: */
125: public String getResourceadapterClass() {
126: return resourceadapterClass;
127: }
128:
129: /**
130: * Set the resourceadapter-class
131: * @param resourceadapterClass resourceadapterClass
132: */
133: public void setResourceadapterClass(String resourceadapterClass) {
134: this .resourceadapterClass = resourceadapterClass;
135: }
136:
137: /**
138: * Gets the managedconnectionfactory-class
139: * @return the managedconnectionfactory-class
140: */
141: public String getManagedconnectionfactoryClass() {
142: return managedconnectionfactoryClass;
143: }
144:
145: /**
146: * Set the managedconnectionfactory-class
147: * @param managedconnectionfactoryClass managedconnectionfactoryClass
148: */
149: public void setManagedconnectionfactoryClass(
150: String managedconnectionfactoryClass) {
151: this .managedconnectionfactoryClass = managedconnectionfactoryClass;
152: }
153:
154: /**
155: * Gets the connectionfactory-interface
156: * @return the connectionfactory-interface
157: */
158: public String getConnectionfactoryInterface() {
159: return connectionfactoryInterface;
160: }
161:
162: /**
163: * Set the connectionfactory-interface
164: * @param connectionfactoryInterface connectionfactoryInterface
165: */
166: public void setConnectionfactoryInterface(
167: String connectionfactoryInterface) {
168: this .connectionfactoryInterface = connectionfactoryInterface;
169: }
170:
171: /**
172: * Gets the connectionfactory-impl-class
173: * @return the connectionfactory-impl-class
174: */
175: public String getConnectionfactoryImplClass() {
176: return connectionfactoryImplClass;
177: }
178:
179: /**
180: * Set the connectionfactory-impl-class
181: * @param connectionfactoryImplClass connectionfactoryImplClass
182: */
183: public void setConnectionfactoryImplClass(
184: String connectionfactoryImplClass) {
185: this .connectionfactoryImplClass = connectionfactoryImplClass;
186: }
187:
188: /**
189: * Gets the connection-interface
190: * @return the connection-interface
191: */
192: public String getConnectionInterface() {
193: return connectionInterface;
194: }
195:
196: /**
197: * Set the connection-interface
198: * @param connectionInterface connectionInterface
199: */
200: public void setConnectionInterface(String connectionInterface) {
201: this .connectionInterface = connectionInterface;
202: }
203:
204: /**
205: * Gets the connection-impl-class
206: * @return the connection-impl-class
207: */
208: public String getConnectionImplClass() {
209: return connectionImplClass;
210: }
211:
212: /**
213: * Set the connection-impl-class
214: * @param connectionImplClass connectionImplClass
215: */
216: public void setConnectionImplClass(String connectionImplClass) {
217: this .connectionImplClass = connectionImplClass;
218: }
219:
220: /**
221: * Gets the transaction-support
222: * @return the transaction-support
223: */
224: public String getTransactionSupport() {
225: return transactionSupport;
226: }
227:
228: /**
229: * Set the transaction-support
230: * @param transactionSupport transactionSupport
231: */
232: public void setTransactionSupport(String transactionSupport) {
233: this .transactionSupport = transactionSupport;
234: }
235:
236: /**
237: * Gets the config-property
238: * @return the config-property
239: */
240: public JLinkedList getConfigPropertyList() {
241: return configPropertyList;
242: }
243:
244: /**
245: * Set the config-property
246: * @param configPropertyList configProperty
247: */
248: public void setConfigPropertyList(JLinkedList configPropertyList) {
249: this .configPropertyList = configPropertyList;
250: }
251:
252: /**
253: * Add a new config-property element to this object
254: * @param configProperty the configPropertyobject
255: */
256: public void addConfigProperty(ConfigProperty configProperty) {
257: configPropertyList.add(configProperty);
258: }
259:
260: /**
261: * Gets the authentication-mechanism
262: * @return the authentication-mechanism
263: */
264: public JLinkedList getAuthenticationMechanismList() {
265: return authenticationMechanismList;
266: }
267:
268: /**
269: * Set the authentication-mechanism
270: * @param authenticationMechanismList authenticationMechanism
271: */
272: public void setAuthenticationMechanismList(
273: JLinkedList authenticationMechanismList) {
274: this .authenticationMechanismList = authenticationMechanismList;
275: }
276:
277: /**
278: * Add a new authentication-mechanism element to this object
279: * @param authenticationMechanism the authenticationMechanismobject
280: */
281: public void addAuthenticationMechanism(
282: AuthenticationMechanism authenticationMechanism) {
283: authenticationMechanismList.add(authenticationMechanism);
284: }
285:
286: /**
287: * Gets the outbound-resourceadapter
288: * @return the outbound-resourceadapter
289: */
290: public OutboundResourceadapter getOutboundResourceadapter() {
291: return outboundResourceadapter;
292: }
293:
294: /**
295: * Set the outbound-resourceadapter
296: * @param outboundResourceadapter outboundResourceadapter
297: */
298: public void setOutboundResourceadapter(
299: OutboundResourceadapter outboundResourceadapter) {
300: this .outboundResourceadapter = outboundResourceadapter;
301: }
302:
303: /**
304: * Gets the inbound-resourceadapter
305: * @return the inbound-resourceadapter
306: */
307: public InboundResourceadapter getInboundResourceadapter() {
308: return inboundResourceadapter;
309: }
310:
311: /**
312: * Set the inbound-resourceadapter
313: * @param inboundResourceadapter inboundResourceadapter
314: */
315: public void setInboundResourceadapter(
316: InboundResourceadapter inboundResourceadapter) {
317: this .inboundResourceadapter = inboundResourceadapter;
318: }
319:
320: /**
321: * Gets the adminobject
322: * @return the adminobject
323: */
324: public JLinkedList getAdminobjectList() {
325: return adminobjectList;
326: }
327:
328: /**
329: * Set the adminobject
330: * @param adminobjectList adminobject
331: */
332: public void setAdminobjectList(JLinkedList adminobjectList) {
333: this .adminobjectList = adminobjectList;
334: }
335:
336: /**
337: * Add a new adminobject element to this object
338: * @param adminobject the adminobjectobject
339: */
340: public void addAdminobject(Adminobject adminobject) {
341: adminobjectList.add(adminobject);
342: }
343:
344: /**
345: * Gets the reauthentication-support
346: * @return the reauthentication-support
347: */
348: public String getReauthenticationSupport() {
349: return reauthenticationSupport;
350: }
351:
352: /**
353: * Set the reauthentication-support
354: * @param reauthenticationSupport reauthenticationSupport
355: */
356: public void setReauthenticationSupport(
357: String reauthenticationSupport) {
358: this .reauthenticationSupport = reauthenticationSupport;
359: }
360:
361: /**
362: * Gets the security-permission
363: * @return the security-permission
364: */
365: public JLinkedList getSecurityPermissionList() {
366: return securityPermissionList;
367: }
368:
369: /**
370: * Set the security-permission
371: * @param securityPermissionList securityPermission
372: */
373: public void setSecurityPermissionList(
374: JLinkedList securityPermissionList) {
375: this .securityPermissionList = securityPermissionList;
376: }
377:
378: /**
379: * Add a new security-permission element to this object
380: * @param securityPermission the securityPermissionobject
381: */
382: public void addSecurityPermission(
383: SecurityPermission securityPermission) {
384: securityPermissionList.add(securityPermission);
385: }
386:
387: /**
388: * Represents this element by it's XML description.
389: * @param indent use this indent for prefixing XML representation.
390: * @return the XML description of this object.
391: */
392: public String toXML(int indent) {
393: StringBuffer sb = new StringBuffer();
394: sb.append(indent(indent));
395: sb.append("<resourceadapter>\n");
396:
397: indent += 2;
398:
399: // resourceadapter-class
400: sb.append(xmlElement(resourceadapterClass,
401: "resourceadapter-class", indent));
402: // config-property
403: sb.append(configPropertyList.toXML(indent));
404: // outbound-resourceadapter
405: if (outboundResourceadapter != null) {
406: sb.append(outboundResourceadapter.toXML(indent));
407: }
408: // inbound-resourceadapter
409: if (inboundResourceadapter != null) {
410: sb.append(inboundResourceadapter.toXML(indent));
411: }
412: // adminobject
413: sb.append(adminobjectList.toXML(indent));
414: // security-permission
415: sb.append(securityPermissionList.toXML(indent));
416: indent -= 2;
417: sb.append(indent(indent));
418: sb.append("</resourceadapter>\n");
419:
420: return sb.toString();
421: }
422: }
|