01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 2004 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * Initial developer: Florent BENOIT
22: * --------------------------------------------------------------------------
23: * $Id: JonasSecurity.java 5124 2004-07-13 15:20:41Z benoitf $
24: * --------------------------------------------------------------------------
25: */package org.objectweb.jonas_ear.deployment.xml;
26:
27: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
28: import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
29:
30: /**
31: * This class defines the implementation of the element jonas-security
32: * @author Florent Benoit
33: */
34: public class JonasSecurity extends AbsElement {
35:
36: /**
37: * security-role-mapping
38: */
39: private JLinkedList securityRoleMappingList = null;
40:
41: /**
42: * Constructor
43: */
44: public JonasSecurity() {
45: super ();
46: securityRoleMappingList = new JLinkedList(
47: "security-role-mapping");
48: }
49:
50: /**
51: * Gets the security-role-mapping
52: * @return the security-role-mapping
53: */
54: public JLinkedList getSecurityRoleMappingList() {
55: return securityRoleMappingList;
56: }
57:
58: /**
59: * Add a new security-role-mapping element to this object
60: * @param securityRoleMapping the securityRoleMapping object
61: */
62: public void addSecurityRoleMapping(
63: SecurityRoleMapping securityRoleMapping) {
64: securityRoleMappingList.add(securityRoleMapping);
65: }
66:
67: /**
68: * Represents this element by it's XML description.
69: * @param indent use this indent for prexifing XML representation.
70: * @return the XML description of this object.
71: */
72: public String toXML(int indent) {
73: StringBuffer sb = new StringBuffer();
74: sb.append(indent(indent));
75: sb.append("<jonas-security>\n");
76: indent += 2;
77:
78: // security-role-mapping
79: sb.append(securityRoleMappingList.toXML(indent));
80:
81: indent -= 2;
82: sb.append(indent(indent));
83: sb.append("</jonas-security>\n");
84:
85: return sb.toString();
86: }
87:
88: }
|