KickJava   Java API By Example, From Geeks To Geeks.

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


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: Session.java,v 1.13 2004/12/08 14:05:09 benoitf Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_ejb.deployment.xml;
28
29
30 /**
31  * This class defines the implementation of the element session
32  *
33  * @author JOnAS team
34  */

35
36 public class Session extends CommonEjb {
37
38     /**
39      * session-type
40      */

41     private String JavaDoc sessionType = null;
42
43     /**
44      * service-endpoint
45      */

46     private String JavaDoc serviceEndpoint = null;
47
48     /**
49      * ior-security-config
50      */

51     private IorSecurityConfigMapping iorSecurityConfigMapping = null;
52
53     /**
54      * Constructor
55      */

56     public Session() {
57         super();
58
59     }
60
61     /**
62      * Gets the session-type
63      * @return the session-type
64      */

65     public String JavaDoc getSessionType() {
66         return sessionType;
67     }
68
69     /**
70      * Set the session-type
71      * @param sessionType sessionType
72      */

73     public void setSessionType(String JavaDoc sessionType) {
74         this.sessionType = sessionType;
75     }
76
77
78     /**
79      * Gets the service-endpoint
80      * @return the service-endpoint
81      */

82     public String JavaDoc getServiceEndpoint() {
83         return serviceEndpoint;
84     }
85
86     /**
87      * Set the service-endpoint
88      * @param serviceEndpoint serviceEndpoint
89      */

90     public void setServiceEndpoint(String JavaDoc serviceEndpoint) {
91         this.serviceEndpoint = serviceEndpoint;
92     }
93
94     /**
95      * @return Returns the iorSecurityConfigMapping.
96      */

97     public IorSecurityConfigMapping getIorSecurityConfigMapping() {
98         return iorSecurityConfigMapping;
99     }
100
101     /**
102      * @param iorSecurityConfigMapping The iorSecurityConfigMapping to set.
103      */

104     public void setIorSecurityConfigMapping(IorSecurityConfigMapping iorSecurityConfigMapping) {
105         this.iorSecurityConfigMapping = iorSecurityConfigMapping;
106     }
107     /**
108      * Represents this element by it's XML description.
109      * @param indent use this indent for prexifing XML representation.
110      * @return the XML description of this object.
111      */

112     public String JavaDoc toXML(int indent) {
113         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
114         sb.append(indent(indent));
115         sb.append("<session>\n");
116
117         indent += 2;
118
119         // description
120
sb.append(xmlElement(getDescription(), "description", indent));
121         // display-name
122
sb.append(xmlElement(getDisplayName(), "display-name", indent));
123         // small-icon
124
sb.append(xmlElement(getIcon().getSmallIcon(), "small-icon", indent));
125         // large-icon
126
sb.append(xmlElement(getIcon().getLargeIcon(), "large-icon", indent));
127         // ejb-name
128
sb.append(xmlElement(getEjbName(), "ejb-name", indent));
129         // home
130
sb.append(xmlElement(getHome(), "home", indent));
131         // remote
132
sb.append(xmlElement(getRemote(), "remote", indent));
133         // local-home
134
sb.append(xmlElement(getLocalHome(), "local-home", indent));
135         // local
136
sb.append(xmlElement(getLocal(), "local", indent));
137         // service-endpoint
138
sb.append(xmlElement(getLocal(), "service-endpoint", indent));
139         // ejb-class
140
sb.append(xmlElement(getEjbClass(), "ejb-class", indent));
141         // session-type
142
sb.append(xmlElement(sessionType, "session-type", indent));
143         // transaction-type
144
sb.append(xmlElement(getTransactionType(), "transaction-type", indent));
145         // env-entry
146
sb.append(getEnvEntryList().toXML(indent));
147         // ejb-ref
148
sb.append(getEjbRefList().toXML(indent));
149         // ejb-local-ref
150
sb.append(getEjbLocalRefList().toXML(indent));
151         // resource-ref
152
sb.append(getResourceRefList().toXML(indent));
153         // resource-env-ref
154
sb.append(getResourceEnvRefList().toXML(indent));
155         // service-ref
156
sb.append(getServiceRefList().toXML(indent));
157         // message-destination-ref
158
sb.append(getMessageDestinationRefList().toXML(indent));
159         // security-role-ref
160
sb.append(getSecurityRoleRefList().toXML(indent));
161         // security-identity
162
if (getSecurityIdentity() != null) {
163             sb.append(getSecurityIdentity().toXML(indent));
164         }
165         // ior-security-config
166
if (getIorSecurityConfigMapping() != null) {
167             sb.append(indent(indent));
168             sb.append("<ior-security-config>\n");
169             indent += 2;
170             sb.append(iorSecurityConfigMapping.toXML());
171             indent -= 2;
172             sb.append(indent(indent));
173             sb.append("</ior-security-config>\n");
174         }
175
176         indent -= 2;
177         sb.append(indent(indent));
178         sb.append("</session>\n");
179
180         return sb.toString();
181     }
182 }
183
Popular Tags