KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > SecurityRoleMapping


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /**
25  * This generated bean class SecurityRoleMapping matches the schema element security-role-mapping
26  *
27  * Generated on Wed Aug 13 12:10:41 PDT 2003
28  */

29
30 package com.sun.enterprise.tools.common.dd;
31
32 import org.w3c.dom.*;
33 import org.netbeans.modules.schema2beans.*;
34 import java.beans.*;
35 import java.util.*;
36
37 // BEGIN_NOI18N
38

39 public class SecurityRoleMapping extends com.sun.enterprise.tools.common.dd.SunBaseBean
40 {
41
42     static Vector comparators = new Vector();
43
44     static public final String JavaDoc ROLE_NAME = "RoleName"; // NOI18N
45
static public final String JavaDoc PRINCIPAL_NAME = "PrincipalName"; // NOI18N
46
static public final String JavaDoc GROUP_NAME = "GroupName"; // NOI18N
47

48     public SecurityRoleMapping() {
49         this(Common.USE_DEFAULT_VALUES);
50     }
51
52     public SecurityRoleMapping(int options)
53     {
54         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
55         // Properties (see root bean comments for the bean graph)
56
this.createProperty("role-name", // NOI18N
57
ROLE_NAME,
58             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
59             String JavaDoc.class);
60         this.createProperty("principal-name", // NOI18N
61
PRINCIPAL_NAME, Common.SEQUENCE_OR |
62             Common.TYPE_1_N | Common.TYPE_STRING | Common.TYPE_KEY,
63             String JavaDoc.class);
64         this.createProperty("group-name", // NOI18N
65
GROUP_NAME, Common.SEQUENCE_OR |
66             Common.TYPE_1_N | Common.TYPE_STRING | Common.TYPE_KEY,
67             String JavaDoc.class);
68         this.initialize(options);
69     }
70
71     // Setting the default values of the properties
72
void initialize(int options)
73     {
74             
75     }
76
77     // This attribute is mandatory
78
public void setRoleName(String JavaDoc value) {
79         this.setValue(ROLE_NAME, value);
80     }
81
82     //
83
public String JavaDoc getRoleName() {
84         return (String JavaDoc)this.getValue(ROLE_NAME);
85     }
86
87     // This attribute is an array containing at least one element
88
public void setPrincipalName(int index, String JavaDoc value) {
89         this.setValue(PRINCIPAL_NAME, index, value);
90     }
91
92     //
93
public String JavaDoc getPrincipalName(int index) {
94         return (String JavaDoc)this.getValue(PRINCIPAL_NAME, index);
95     }
96
97     // This attribute is an array containing at least one element
98
public void setPrincipalName(String JavaDoc[] value) {
99         this.setValue(PRINCIPAL_NAME, value);
100     }
101
102     //
103
public String JavaDoc[] getPrincipalName() {
104         return (String JavaDoc[])this.getValues(PRINCIPAL_NAME);
105     }
106
107     // Return the number of properties
108
public int sizePrincipalName() {
109         return this.size(PRINCIPAL_NAME);
110     }
111
112     // Add a new element returning its index in the list
113
public int addPrincipalName(String JavaDoc value) {
114         return this.addValue(PRINCIPAL_NAME, value);
115     }
116
117     //
118
// Remove an element using its reference
119
// Returns the index the element had in the list
120
//
121
public int removePrincipalName(String JavaDoc value) {
122         return this.removeValue(PRINCIPAL_NAME, value);
123     }
124
125     // This attribute is an array containing at least one element
126
public void setGroupName(int index, String JavaDoc value) {
127         this.setValue(GROUP_NAME, index, value);
128     }
129
130     //
131
public String JavaDoc getGroupName(int index) {
132         return (String JavaDoc)this.getValue(GROUP_NAME, index);
133     }
134
135     // This attribute is an array containing at least one element
136
public void setGroupName(String JavaDoc[] value) {
137         this.setValue(GROUP_NAME, value);
138     }
139
140     //
141
public String JavaDoc[] getGroupName() {
142         return (String JavaDoc[])this.getValues(GROUP_NAME);
143     }
144
145     // Return the number of properties
146
public int sizeGroupName() {
147         return this.size(GROUP_NAME);
148     }
149
150     // Add a new element returning its index in the list
151
public int addGroupName(String JavaDoc value) {
152         return this.addValue(GROUP_NAME, value);
153     }
154
155     //
156
// Remove an element using its reference
157
// Returns the index the element had in the list
158
//
159
public int removeGroupName(String JavaDoc value) {
160         return this.removeValue(GROUP_NAME, value);
161     }
162
163     //
164
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
165         comparators.add(c);
166     }
167
168     //
169
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
170         comparators.remove(c);
171     }
172     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
173         boolean restrictionFailure = false;
174         // Validating property roleName
175
if (getRoleName() == null) {
176             throw new org.netbeans.modules.schema2beans.ValidateException("getRoleName() == null", "roleName", this); // NOI18N
177
}
178         // Validating property principalName
179
for (int _index = 0; _index < sizePrincipalName(); ++_index) {
180             String JavaDoc element = getPrincipalName(_index);
181             if (element != null) {
182             }
183         }
184         int orCount = 0;
185         if (sizePrincipalName() > 0) {
186             ++orCount;
187         }
188         // Validating property groupName
189
for (int _index = 0; _index < sizeGroupName(); ++_index) {
190             String JavaDoc element = getGroupName(_index);
191             if (element != null) {
192             }
193         }
194         if (sizeGroupName() > 0) {
195             ++orCount;
196         }
197         if (orCount != 1) {
198             throw new org.netbeans.modules.schema2beans.ValidateException("orCount ("+orCount+") != 1", "mutually exclusive properties", this); // NOI18N
199
}
200     }
201
202     // Dump the content of this bean returning it as a String
203
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
204         String JavaDoc s;
205         Object JavaDoc o;
206         org.netbeans.modules.schema2beans.BaseBean n;
207         str.append(indent);
208         str.append("RoleName"); // NOI18N
209
str.append(indent+"\t"); // NOI18N
210
str.append("<"); // NOI18N
211
s = this.getRoleName();
212         str.append((s==null?"null":s.trim())); // NOI18N
213
str.append(">\n"); // NOI18N
214
this.dumpAttributes(ROLE_NAME, 0, str, indent);
215
216         str.append(indent);
217         str.append("PrincipalName["+this.sizePrincipalName()+"]"); // NOI18N
218
for(int i=0; i<this.sizePrincipalName(); i++)
219         {
220             str.append(indent+"\t");
221             str.append("#"+i+":");
222             str.append(indent+"\t"); // NOI18N
223
str.append("<"); // NOI18N
224
s = this.getPrincipalName(i);
225             str.append((s==null?"null":s.trim())); // NOI18N
226
str.append(">\n"); // NOI18N
227
this.dumpAttributes(PRINCIPAL_NAME, i, str, indent);
228         }
229
230         str.append(indent);
231         str.append("GroupName["+this.sizeGroupName()+"]"); // NOI18N
232
for(int i=0; i<this.sizeGroupName(); i++)
233         {
234             str.append(indent+"\t");
235             str.append("#"+i+":");
236             str.append(indent+"\t"); // NOI18N
237
str.append("<"); // NOI18N
238
s = this.getGroupName(i);
239             str.append((s==null?"null":s.trim())); // NOI18N
240
str.append(">\n"); // NOI18N
241
this.dumpAttributes(GROUP_NAME, i, str, indent);
242         }
243
244     }
245     public String JavaDoc dumpBeanNode(){
246         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
247         str.append("SecurityRoleMapping\n"); // NOI18N
248
this.dump(str, "\n "); // NOI18N
249
return str.toString();
250     }}
251
252 // END_NOI18N
253

254
255 /*
256         The following schema file has been used for generation:
257
258 <!--
259 This is the root element which binds an ejb reference to a jndi name.
260 -->
261 <!ELEMENT ejb-ref (ejb-ref-name, jndi-name)>
262
263 <!--
264 This node holds all the runtime bindings of a resource env reference.
265 -->
266 <!ELEMENT resource-env-ref ( resource-env-ref-name, jndi-name )>
267
268 <!--
269 This node holds all the runtime bindings of a resource reference.
270 -->
271 <!ELEMENT resource-ref (res-ref-name, jndi-name, default-resource-principal?)>
272
273 <!ELEMENT default-resource-principal (name, password)>
274
275 <!ELEMENT security-role-mapping (role-name, (principal-name | group-name)+)>
276
277 <!--
278 Information about a web service endpoint.
279 -->
280 <!ELEMENT webservice-endpoint ( port-component-name, endpoint-address-uri?, login-config?, transport-guarantee?, service-qname?, tie-class?, servlet-impl-class? )>
281
282 <!--
283 Optional authentication configuration for an EJB web service endpoint.
284 Not needed for servet web service endpoints. Their security configuration
285 is contained in the standard web application descriptor.
286 -->
287 <!ELEMENT login-config ( auth-method )>
288
289 <!--
290 The service-qname element declares the specific WSDL service
291 element that is being refered to. It is not set by the deployer.
292 It is derived during deployment.
293 -->
294 <!ELEMENT service-qname (namespaceURI, localpart)>
295
296 <!--
297 Runtime information about a web service.
298 wsdl-publish-location is optionally used to specify
299 where the final wsdl and any dependent files should be stored. This location
300 resides on the file system from which deployment is initiated.
301 -->
302 <!ELEMENT webservice-description ( webservice-description-name, wsdl-publish-location? )>
303
304 <!--
305 Runtime settings for a web service reference. In the simplest case,
306 there is no runtime information required for a service ref. Runtime info
307 is only needed in the following cases :
308  * to define the port that should be used to resolve a container-managed port
309  * to define default Stub/Call property settings for Stub objects
310  * to define the URL of a final WSDL document to be used instead of
311 the one packaged with a service-ref
312 -->
313 <!ELEMENT service-ref ( service-ref-name, port-info*, call-property*, wsdl-override?, service-impl-class?, service-qname? )>
314
315 <!--
316 Information for a port within a service-reference.
317
318 Either service-endpoint-interface or wsdl-port or both
319 (service-endpoint-interface and wsdl-port) should be specified.
320
321 If both are specified, wsdl-port represents the
322 port the container should choose for container-managed port selection.
323
324 The same wsdl-port value must not appear in
325 more than one port-info entry within the same service-ref.
326
327 If a particular service-endpoint-interface is using container-managed port
328 selection, it must not appear in more than one port-info entry
329 within the same service-ref.
330 -->
331 <!ELEMENT port-info ( service-endpoint-interface?, wsdl-port?, stub-property*, call-property* )>
332
333 <!--
334 Port used in port-info.
335 -->
336 <!ELEMENT wsdl-port ( namespaceURI, localpart )>
337
338 <!--
339 JAXRPC property values that should be set on a stub before it's returned to
340 to the web service client. The property names can be any properties supported
341 by the JAXRPC Stub implementation. See javadoc for javax.xml.rpc.Stub
342 -->
343 <!ELEMENT stub-property ( name, value )>
344
345 <!--
346 JAXRPC property values that should be set on a Call object before it's
347 returned to the web service client. The property names can be any
348 properties supported by the JAXRPC Call implementation. See javadoc
349 for javax.xml.rpc.Call
350 -->
351 <!ELEMENT call-property ( name, value )>
352
353 <!--
354 This info is used only by studio plug-in;it is NOT the part of the orgianl DTD.
355 Used by plugin to store parameters needed to execute an Application client.
356 -->
357 <!ELEMENT plugin-data ( auto-generate-sql?, client-jar-path?, client-args? )>
358 <!ELEMENT auto-generate-sql (#PCDATA)>
359 <!ELEMENT client-jar-path (#PCDATA)>
360 <!ELEMENT client-args (#PCDATA)>
361
362 <!--
363 The ejb ref name locates the name of the ejb reference in the application.
364 -->
365 <!ELEMENT ejb-ref-name (#PCDATA)>
366
367 <!--
368 The text in this node is a jndi name.
369 -->
370 <!ELEMENT jndi-name (#PCDATA)>
371
372 <!--
373 The name of a resource env reference.
374 -->
375 <!ELEMENT resource-env-ref-name (#PCDATA)>
376
377 <!--
378 The name of a resource reference.
379 -->
380 <!ELEMENT res-ref-name (#PCDATA)>
381
382 <!--
383 This text nodes holds a name string.
384 -->
385 <!ELEMENT name (#PCDATA)>
386
387 <!--
388 This element holds password text.
389 -->
390 <!ELEMENT password (#PCDATA)>
391
392 <!ELEMENT role-name (#PCDATA)>
393
394 <!ELEMENT principal-name (#PCDATA)>
395
396 <!ELEMENT group-name (#PCDATA)>
397
398 <!--
399 Unique name of a port component within a module
400 -->
401 <!ELEMENT port-component-name ( #PCDATA )>
402
403 <!--
404 Relative path combined with web server root to form fully qualified
405 endpoint address for a web service endpoint. For servlet endpoints, this
406 value is relative to the servlet's web application context root. In
407 all cases, this value must be a fixed pattern(i.e. no "*" allowed).
408 If the web service endpoint is a servlet that only implements a single
409 endpoint has only one url-pattern, it is not necessary to set
410 this value since the container can derive it from web.xml.
411 -->
412 <!ELEMENT endpoint-address-uri ( #PCDATA )>
413
414 <!--
415 The namespaceURI element indicates a URI.
416 -->
417 <!ELEMENT namespaceURI (#PCDATA)>
418
419 <!--
420 The localpart element indicates the local part of a QNAME.
421 -->
422 <!ELEMENT localpart (#PCDATA)>
423
424 <!--
425 auth-method element describes the authentication method. The only supported value
426 is USERNAME_PASSWORD
427 -->
428 <!ELEMENT auth-method ( #PCDATA )>
429
430 <!--
431 Specifies that the communication between client and server should
432 be NONE, INTEGRAL, or CONFIDENTIAL. NONE means that the application
433 does not require any transport guarantees. A value of INTEGRAL means
434 that the application requires that the data sent between the client
435 and server be sent in such a way that it can't be changed in transit.
436 CONFIDENTIAL means that the application requires that the data be
437 transmitted in a fashion that prevents other entities from observing
438 the contents of the transmission. In most cases, the presence of the
439 INTEGRAL or CONFIDENTIAL flag will indicate that the use of SSL is
440 required.
441 -->
442 <!ELEMENT transport-guarantee ( #PCDATA )>
443
444 <!--
445 The name of tie implementation class for a port-component. This is
446 not specified by the deployer. It is derived during deployment.
447 -->
448 <!ELEMENT tie-class (#PCDATA)>
449
450 <!--
451 Name of application-written servlet impl class contained in deployed war.
452 This is not set by the deployer. It is derived by the container
453 during deployment.
454 -->
455 <!ELEMENT servlet-impl-class (#PCDATA)>
456
457 <!--
458 Unique name of a webservice within a module
459 -->
460 <!ELEMENT webservice-description-name ( #PCDATA )>
461
462 <!--
463 file: URL of a directory to which a web-service-description's wsdl should be
464 published during deployment. Any required files will be published to this
465 directory, preserving their location relative to the module-specific
466 wsdl directory(META-INF/wsdl or WEB-INF/wsdl).
467
468 Example :
469
470   For an ejb.jar whose webservices.xml wsdl-file element contains
471     META-INF/wsdl/a/Foo.wsdl
472
473   <wsdl-publish-location>file:/home/user1/publish
474   </wsdl-publish-location>
475
476   The final wsdl will be stored in /home/user1/publish/a/Foo.wsdl
477 -->
478 <!ELEMENT wsdl-publish-location ( #PCDATA )>
479
480 <!--
481 Coded name (relative to java:comp/env) for a service-reference
482 -->
483 <!ELEMENT service-ref-name ( #PCDATA )>
484
485 <!--
486 Fully qualified name of service endpoint interface
487 -->
488 <!ELEMENT service-endpoint-interface ( #PCDATA )>
489
490 <!--
491 This text nodes holds a value string.
492 -->
493 <!ELEMENT value (#PCDATA)>
494
495 <!--
496 This is a valid URL pointing to a final WSDL document. It is optional.
497 If specified, the WSDL document at this URL will be used during
498 deployment instead of the WSDL document associated with the
499 service-ref in the standard deployment descriptor.
500
501 Examples :
502
503   // available via HTTP
504   <wsdl-override>http://localhost:8000/myservice/myport?WSDL</wsdl-override>
505
506   // in a file
507   <wsdl-override>file:/home/user1/myfinalwsdl.wsdl</wsdl-override>
508 -->
509 <!ELEMENT wsdl-override ( #PCDATA )>
510
511 <!--
512 Name of generated service implementation class. This is not set by the
513 deployer. It is derived during deployment.
514 -->
515 <!ELEMENT service-impl-class ( #PCDATA )>
516
517 <!--
518 This node holds information about a logical message destination
519 -->
520 <!ELEMENT message-destination (message-destination-name, jndi-name)>
521
522 <!--
523 This node holds the name of a logical message destination
524 -->
525 <!ELEMENT message-destination-name (#PCDATA)>
526
527 */

528
Popular Tags