KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > connector > Principal


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 Principal matches the schema element principal
26  *
27  * Generated on Thu Jul 31 18:16:39 PDT 2003
28  */

29
30 package com.sun.enterprise.tools.common.dd.connector;
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 Principal extends com.sun.enterprise.tools.common.dd.SunBaseBean
40 {
41
42     static Vector comparators = new Vector();
43
44     static public final String JavaDoc USERNAME = "UserName"; // NOI18N
45
static public final String JavaDoc DESCRIPTION = "Description"; // NOI18N
46

47     public Principal() {
48         this(Common.USE_DEFAULT_VALUES);
49     }
50
51     public Principal(int options)
52     {
53         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
54         // Properties (see root bean comments for the bean graph)
55
this.createProperty("description", // NOI18N
56
DESCRIPTION,
57             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
58             String JavaDoc.class);
59         this.initialize(options);
60     }
61
62     // Setting the default values of the properties
63
void initialize(int options)
64     {
65     
66     }
67
68     // This attribute is mandatory
69
public void setUserName(java.lang.String JavaDoc value) {
70         setAttributeValue(USERNAME, value);
71     }
72
73     //
74
public java.lang.String JavaDoc getUserName() {
75         return getAttributeValue(USERNAME);
76     }
77
78     // This attribute is optional
79
public void setDescription(String JavaDoc value) {
80         this.setValue(DESCRIPTION, value);
81     }
82
83     //
84
public String JavaDoc getDescription() {
85         return (String JavaDoc)this.getValue(DESCRIPTION);
86     }
87
88     //
89
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
90         comparators.add(c);
91     }
92
93     //
94
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
95         comparators.remove(c);
96     }
97     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
98         boolean restrictionFailure = false;
99         // Validating property userName
100
if (getUserName() == null) {
101             throw new org.netbeans.modules.schema2beans.ValidateException("getUserName() == null", "userName", this); // NOI18N
102
}
103         // Validating property description
104
if (getDescription() != null) {
105         }
106     }
107
108     // Dump the content of this bean returning it as a String
109
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
110         String JavaDoc s;
111         Object JavaDoc o;
112         org.netbeans.modules.schema2beans.BaseBean n;
113         str.append(indent);
114         str.append("Description"); // NOI18N
115
str.append(indent+"\t"); // NOI18N
116
str.append("<"); // NOI18N
117
s = this.getDescription();
118         str.append((s==null?"null":s.trim())); // NOI18N
119
str.append(">\n"); // NOI18N
120
this.dumpAttributes(DESCRIPTION, 0, str, indent);
121
122     }
123     public String JavaDoc dumpBeanNode(){
124         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
125         str.append("Principal\n"); // NOI18N
126
this.dump(str, "\n "); // NOI18N
127
return str.toString();
128     }}
129
130 // END_NOI18N
131

132
133 /*
134         The following schema file has been used for generation:
135
136 <!--
137   XML DTD for Sun ONE Application Server specific J2EE Resource Adapter
138   deployment descriptor. This is a companion DTD to connector_1_5.xsd
139
140   $Revision: 1.3 $
141 -->
142
143 <!-- Each deployed Resource Adapter (RAR) Module, will have ias-ra.xml
144      associated with it, which specifies several dynamic configuration
145      properties. Key aspects are pool sizing and security role maps.
146  -->
147 <!ELEMENT sun-connector (resource-adapter, role-map?)>
148
149 <!-- Resource adapter configuration
150
151      jndi-name name by which, this adapter will appear in JNDI tree
152      max-pool-size maximum size of connection to EIS
153      steady-pool-size initial and minimum number of connections to be maintained
154      max-wait-in-millis if a connection is not readily found, caller will have to
155                         wait this long, before a connection is created. A value of
156                         0 implies, wait till a connection becomes available. If the
157                         pool is completely utilized and the timer expires, an
158                         exception will be delivered to the application.
159
160      idle-timeout-in-seconds A timer thread periodically removed unused connections.
161                              The interval at which this thread runs. All idle
162                              connections will be removed, while mainataining
163                              the configured steady-pool-size.
164 -->
165 <!ELEMENT resource-adapter (description?, property*)>
166 <!ATTLIST resource-adapter jndi-name CDATA #REQUIRED
167                            max-pool-size CDATA "32"
168                            steady-pool-size CDATA "4"
169                            max-wait-time-in-millis CDATA "10000"
170                            idle-timeout-in-seconds CDATA "1000">
171
172 <!-- Perform mapping from principal received during Servlet/EJB
173      authentication, to credentials accepted by the EIS. This
174      mapping is optional. The map consists of several 2-tuples
175      map-id is the name of the mapping
176  -->
177 <!ELEMENT role-map (description?, map-element*)>
178 <!ATTLIST role-map map-id CDATA #REQUIRED>
179                 
180
181 <!-- It is possible to map multiple (server) principal to the
182      same backend principal.
183 -->
184 <!ELEMENT map-element (principal+, backend-principal)>
185
186 <!-- Principal of the Servlet and EJB client -->
187 <!ELEMENT principal (description?)>
188 <!ATTLIST principal user-name CDATA #REQUIRED>
189  
190 <!-- Backend EIS principal -->
191 <!ELEMENT backend-principal EMPTY>
192 <!ATTLIST backend-principal user-name CDATA #REQUIRED
193                             password CDATA #REQUIRED
194                             credential CDATA #REQUIRED>
195
196 <!ELEMENT description (#PCDATA)>
197
198 <!-- Syntax for supplying properties as name value pairs -->
199 <!ELEMENT property EMPTY>
200 <!ATTLIST property name CDATA #REQUIRED
201                    value CDATA #REQUIRED>
202
203 */

204
Popular Tags