KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ear > deployment > xml > JonasSecurity


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2004 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * 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,v 1.1 2004/07/13 15:20:40 benoitf Exp $
24  * --------------------------------------------------------------------------
25  */

26 package org.objectweb.jonas_ear.deployment.xml;
27
28 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
29 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
30
31 /**
32  * This class defines the implementation of the element jonas-security
33  * @author Florent Benoit
34  */

35 public class JonasSecurity extends AbsElement {
36
37     /**
38      * security-role-mapping
39      */

40     private JLinkedList securityRoleMappingList = null;
41
42     /**
43      * Constructor
44      */

45     public JonasSecurity() {
46         super();
47         securityRoleMappingList = new JLinkedList("security-role-mapping");
48     }
49
50
51     /**
52      * Gets the security-role-mapping
53      * @return the security-role-mapping
54      */

55     public JLinkedList getSecurityRoleMappingList() {
56         return securityRoleMappingList;
57     }
58
59     /**
60      * Add a new security-role-mapping element to this object
61      * @param securityRoleMapping the securityRoleMapping object
62      */

63     public void addSecurityRoleMapping(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 JavaDoc toXML(int indent) {
73         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
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 }
Popular Tags