KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ejb > deployment > xml > SecurityIdentity


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: JOnAS team
23  * --------------------------------------------------------------------------
24  * $Id: SecurityIdentity.java,v 1.7 2004/05/10 11:45:44 sauthieg Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_ejb.deployment.xml;
28
29 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
30 import org.objectweb.jonas_lib.deployment.xml.RunAs;
31
32 /**
33  * This class defines the implementation of the element security-identity
34  *
35  * @author JOnAS team
36  */

37
38 public class SecurityIdentity extends AbsElement {
39
40     /**
41      * description
42      */

43     private String JavaDoc description = null;
44
45     /**
46      * use-caller-identity
47      */

48     private UseCallerIdentity useCallerIdentity = null;
49
50     /**
51      * run-as
52      */

53     private RunAs runAs = null;
54
55
56     /**
57      * Constructor
58      */

59     public SecurityIdentity() {
60         super();
61     }
62
63     /**
64      * Gets the description
65      * @return the description
66      */

67     public String JavaDoc getDescription() {
68         return description;
69     }
70
71     /**
72      * Set the description
73      * @param description description
74      */

75     public void setDescription(String JavaDoc description) {
76         this.description = description;
77     }
78
79     /**
80      * Gets the use-caller-identity
81      * @return the use-caller-identity
82      */

83     public UseCallerIdentity getUseCallerIdentity() {
84         return useCallerIdentity;
85     }
86
87     /**
88      * Set the use-caller-identity
89      * @param useCallerIdentity useCallerIdentity
90      */

91     public void setUseCallerIdentity(UseCallerIdentity useCallerIdentity) {
92         this.useCallerIdentity = useCallerIdentity;
93     }
94
95     /**
96      * Gets the run-as
97      * @return the run-as
98      */

99     public RunAs getRunAs() {
100         return runAs;
101     }
102
103     /**
104      * Set the run-as
105      * @param runAs runAs
106      */

107     public void setRunAs(RunAs runAs) {
108         this.runAs = runAs;
109     }
110
111     /**
112      * Represents this element by it's XML description.
113      * @param indent use this indent for prexifing XML representation.
114      * @return the XML description of this object.
115      */

116     public String JavaDoc toXML(int indent) {
117         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
118         sb.append(indent(indent));
119         sb.append("<security-identity>\n");
120
121         indent += 2;
122
123         // description
124
sb.append(xmlElement(description, "description", indent));
125         // use-caller-identity
126
if (useCallerIdentity != null) {
127             sb.append(useCallerIdentity.toXML(indent));
128         }
129         // run-as
130
if (runAs != null) {
131             sb.append(runAs.toXML(indent));
132         }
133         indent -= 2;
134         sb.append(indent(indent));
135         sb.append("</security-identity>\n");
136
137         return sb.toString();
138     }
139 }
140
Popular Tags