KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > upgrade > transform > ElementToObjectMapper


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  * ElementToObjectMapper.java
26  *
27  * Created on August 4, 2003, 1:52 PM
28  */

29
30 package com.sun.enterprise.tools.upgrade.transform;
31
32
33 import java.util.HashMap JavaDoc;
34 import com.sun.enterprise.tools.upgrade.transform.elements.BaseElement;
35 import com.sun.enterprise.util.i18n.StringManager;
36 /**
37  *
38  * @author prakash
39  */

40 public class ElementToObjectMapper {
41     
42     private static ElementToObjectMapper mapper;
43     private HashMap JavaDoc elementMap;
44     private HashMap JavaDoc keyMap;
45     private HashMap JavaDoc elementStructureMap;
46     StringManager stringManager = StringManager.getManager("com.sun.enterprise.tools.upgrade.transform");
47     /** Creates a new instance of ElementToObjectMapper */
48     private ElementToObjectMapper() {
49         buildMapping();
50     }
51     public static ElementToObjectMapper getMapper(){
52         if(mapper == null)
53             mapper = new ElementToObjectMapper();
54         return mapper;
55     }
56     public BaseElement getElementObject(String JavaDoc element) throws ElementNotFoundException, ClassNotFoundException JavaDoc,
57                                                 InstantiationException JavaDoc, IllegalAccessException JavaDoc{
58         String JavaDoc eleClassName = (String JavaDoc)(elementMap.get(element));
59         if (eleClassName == null)
60             throw new ElementNotFoundException(element+" "+stringManager.getString("upgrade.transform.elementObjectMapper.elementNotFound"));
61         return (BaseElement)((Class.forName(eleClassName)).newInstance());
62     }
63     public String JavaDoc getKeyForElement(String JavaDoc element) {
64         return (String JavaDoc)(keyMap.get(element));
65     }
66     public java.util.List JavaDoc getInsertElementStructure(String JavaDoc element){
67         return (java.util.List JavaDoc)(this.elementStructureMap.get(element));
68     }
69     private void buildMapping(){
70         if(elementMap == null){
71             elementMap = new HashMap JavaDoc();
72         }
73         buildKeyMapping();
74         buildElementStructureMap();
75         elementMap.put("server", "com.sun.enterprise.tools.upgrade.transform.elements.Server");
76         elementMap.put("http-service", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
77         elementMap.put("admin-service", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
78         elementMap.put("web-container", "com.sun.enterprise.tools.upgrade.transform.elements.GenericContainer");
79         elementMap.put("ejb-container", "com.sun.enterprise.tools.upgrade.transform.elements.GenericContainer");
80         elementMap.put("mdb-container", "com.sun.enterprise.tools.upgrade.transform.elements.GenericContainer");
81         elementMap.put("jms-service", "com.sun.enterprise.tools.upgrade.transform.elements.JMSService");
82         elementMap.put("log-service", "com.sun.enterprise.tools.upgrade.transform.elements.LogService");
83         elementMap.put("security-service", "com.sun.enterprise.tools.upgrade.transform.elements.SecurityService");
84         elementMap.put("transaction-service", "com.sun.enterprise.tools.upgrade.transform.elements.TransactionService");
85         elementMap.put("java-config", "com.sun.enterprise.tools.upgrade.transform.elements.JavaConfig");
86         elementMap.put("resources", "com.sun.enterprise.tools.upgrade.transform.elements.Resources");
87         elementMap.put("applications", "com.sun.enterprise.tools.upgrade.transform.elements.GenericComponent");
88         elementMap.put("lifecycle-module", "com.sun.enterprise.tools.upgrade.transform.elements.GenericComponent");
89         elementMap.put("j2ee-application", "com.sun.enterprise.tools.upgrade.transform.elements.GenericComponent");
90         elementMap.put("ejb-module", "com.sun.enterprise.tools.upgrade.transform.elements.GenericComponent");
91         elementMap.put("web-module", "com.sun.enterprise.tools.upgrade.transform.elements.GenericComponent");
92         elementMap.put("connector-module", "com.sun.enterprise.tools.upgrade.transform.elements.GenericComponent");
93         elementMap.put("http-listener", "com.sun.enterprise.tools.upgrade.transform.elements.HttpListener");
94         elementMap.put("mime", "com.sun.enterprise.tools.upgrade.transform.elements.UnSupportedElement");
95         elementMap.put("acl", "com.sun.enterprise.tools.upgrade.transform.elements.UnSupportedElement");
96         elementMap.put("virtual-server-class", "com.sun.enterprise.tools.upgrade.transform.elements.UnSupportedElement");
97         elementMap.put("ssl", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
98         elementMap.put("property", "com.sun.enterprise.tools.upgrade.transform.elements.Property");
99         elementMap.put("description", "com.sun.enterprise.tools.upgrade.transform.elements.Description");
100         elementMap.put("virtual-server", "com.sun.enterprise.tools.upgrade.transform.elements.VirtualServer");
101         elementMap.put("http-qos", "com.sun.enterprise.tools.upgrade.transform.elements.UnSupportedElement");
102         elementMap.put("auth-db", "com.sun.enterprise.tools.upgrade.transform.elements.UnSupportedElement");
103         elementMap.put("iiop-service", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
104         elementMap.put("orb", "com.sun.enterprise.tools.upgrade.transform.elements.ORB");
105         elementMap.put("iiop-listener", "com.sun.enterprise.tools.upgrade.transform.elements.IIOPListener");
106         elementMap.put("ssl-client-config", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
107         elementMap.put("custom-resource", "com.sun.enterprise.tools.upgrade.transform.elements.GenericResource");
108         elementMap.put("external-jndi-resource", "com.sun.enterprise.tools.upgrade.transform.elements.GenericResource");
109         elementMap.put("jdbc-resource", "com.sun.enterprise.tools.upgrade.transform.elements.GenericResource");
110         elementMap.put("jdbc-connection-pool", "com.sun.enterprise.tools.upgrade.transform.elements.GenericResource");
111         elementMap.put("mail-resource", "com.sun.enterprise.tools.upgrade.transform.elements.GenericResource");
112         elementMap.put("persistence-manager-factory-resource", "com.sun.enterprise.tools.upgrade.transform.elements.GenericResource");
113         elementMap.put("jms-resource", "com.sun.enterprise.tools.upgrade.transform.elements.JMSResource");
114         elementMap.put("auth-realm", "com.sun.enterprise.tools.upgrade.transform.elements.AuthRealm");
115         elementMap.put("profiler", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
116         elementMap.put("jvm-options", "com.sun.enterprise.tools.upgrade.transform.elements.JVMOptions");
117         elementMap.put("server-instance", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
118         
119         // added for 8.0 PE
120
elementMap.put("domain", "com.sun.enterprise.tools.upgrade.transform.elements.Domain");
121         elementMap.put("configs", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
122         elementMap.put("config", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
123         elementMap.put("admin-object-resource", "com.sun.enterprise.tools.upgrade.transform.elements.GenericResource");
124         elementMap.put("connector-resource", "com.sun.enterprise.tools.upgrade.transform.elements.GenericResource");
125         elementMap.put("resource-adapter-config", "com.sun.enterprise.tools.upgrade.transform.elements.GenericResource");
126         elementMap.put("connector-connection-pool", "com.sun.enterprise.tools.upgrade.transform.elements.GenericResource");
127         elementMap.put("jms-host", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
128         elementMap.put("session-config", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
129         elementMap.put("session-manager", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
130         elementMap.put("manager-properties", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
131         elementMap.put("session-properties", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
132         elementMap.put("store-properties", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
133         elementMap.put("jmx-connector", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
134         elementMap.put("das-config", "com.sun.enterprise.tools.upgrade.transform.elements.DasConfig");
135         elementMap.put("monitoring-service", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
136         elementMap.put("module-monitoring-levels", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
137         elementMap.put("availability-service", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
138         elementMap.put("web-container-availability", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
139         elementMap.put("ejb-container-availability", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
140         elementMap.put("ejb-timer-service", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
141         elementMap.put("quorum-service", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
142         elementMap.put("thread-pools", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
143         elementMap.put("thread-pool", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
144         elementMap.put("servers", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
145         elementMap.put("module-log-levels", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
146         elementMap.put("jacc-provider", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
147         elementMap.put("audit-module", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
148         
149         elementMap.put("message-security-config", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
150         elementMap.put("provider-config", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
151         elementMap.put("request-policy", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
152         elementMap.put("response-policy", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
153         
154         // application-ref is updated by application deploy module. resources-ref updated by generic resources
155
elementMap.put("resource-ref", "com.sun.enterprise.tools.upgrade.transform.elements.ResourceRef");
156         elementMap.put("application-ref", "com.sun.enterprise.tools.upgrade.transform.elements.ApplicationRef");
157         
158         elementMap.put("clusters", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
159         elementMap.put("cluster", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
160         elementMap.put("server-ref", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
161         
162         elementMap.put("system-property", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
163         
164         // For the time being will set the following elements to unsuported
165
elementMap.put("iiop-cluster", "com.sun.enterprise.tools.upgrade.transform.elements.BaseElement");
166         elementMap.put("persistence-store", "com.sun.enterprise.tools.upgrade.transform.elements.PersistenceStore");
167         elementMap.put("iiop-server-instance", "com.sun.enterprise.tools.upgrade.transform.elements.IIOPServerInstance");
168         // iiop-endpoint is handled in iiop-server-instance itself. One less element class to worry about.
169
elementMap.put("iiop-endpoint", "com.sun.enterprise.tools.upgrade.transform.elements.UnSupportedElement");
170         
171         // Additions for AS9 upgrade
172
elementMap.put("node-agents", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
173         elementMap.put("node-agent", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
174         elementMap.put("lb-configs", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
175         elementMap.put("lb-config", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
176         elementMap.put("cluster-ref", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
177         elementMap.put("health-checker", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
178         elementMap.put("appclient-module", "com.sun.enterprise.tools.upgrade.transform.elements.GenericComponent");
179         elementMap.put("alert-service", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
180         elementMap.put("connector-service", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
181         elementMap.put("alert-subscription", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
182         elementMap.put("listener-config", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
183         elementMap.put("filter-config", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
184         elementMap.put("access-log", "com.sun.enterprise.tools.upgrade.transform.elements.AccessLog");
185         elementMap.put("http-access-log", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
186         elementMap.put("request-processing", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
187         elementMap.put("keep-alive", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
188         elementMap.put("connection-pool", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
189         elementMap.put("http-protocol", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
190         elementMap.put("http-file-cache", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
191         elementMap.put("security-map", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
192         elementMap.put("user-group", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
193         elementMap.put("principal", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
194         elementMap.put("backend-principal", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
195         elementMap.put("diagnostic-service", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
196         elementMap.put("group-management-service", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
197         elementMap.put("management-rules", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
198         elementMap.put("management-rule", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
199         elementMap.put("event", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
200         elementMap.put("load-balancers", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
201         elementMap.put("load-balancer", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
202         elementMap.put("jms-availability", "com.sun.enterprise.tools.upgrade.transform.elements.GenericElement");
203     }
204     /*
205      * This method builds key map. The keyMap holds key if any for an element for comparison puprose
206      * If no key is mapped then that element has no key to comapre
207      * Usually if there are multiple elements (*) then key is needed for comparison.
208      * If there are ? (1 or zero) or mandatory element then key is not needed.
209      */

210     private void buildKeyMapping(){
211         if(keyMap == null){
212             keyMap = new HashMap JavaDoc();
213         }
214         // all resources
215
keyMap.put("custom-resource", "jndi-name");
216         keyMap.put("jdbc-resource","pool-name");
217         keyMap.put("external-jndi-resource", "jndi-name");
218         keyMap.put("jdbc-connection-pool", "name");
219         keyMap.put("mail-resource", "jndi-name");
220         keyMap.put("persistence-manager-factory-resource", "jndi-name");
221         keyMap.put("jms-resource", "jndi-name");
222         keyMap.put("admin-object-resource", "jndi-name");
223         keyMap.put("connector-resource", "jndi-name");
224         keyMap.put("resource-adapter-config", "name");
225         keyMap.put("connector-connection-pool", "name");
226         
227         keyMap.put("jms-host", "name");
228         keyMap.put("server-instance", "name");
229         keyMap.put("jmx-connector", "name");
230         keyMap.put("iiop-listener", "id");
231         keyMap.put("config", "name");
232         keyMap.put("thread-pool","thread-pool-id");
233         keyMap.put("cluster","name");
234         keyMap.put("server-ref","ref");
235         keyMap.put("resource-ref","ref");
236         keyMap.put("application-ref","ref");
237         keyMap.put("jacc-provider","name");
238         keyMap.put("audit-module","name");
239         
240         keyMap.put("message-security-config","auth-layer");
241         keyMap.put("provider-config","provider-id");
242         
243         // Added for AS9 upgrade.
244
keyMap.put("node-agent","name");
245         keyMap.put("lb-config","name");
246         keyMap.put("cluster-ref","ref");
247         keyMap.put("alert-subscription","name");
248         keyMap.put("listener-config","listener-class-name");
249         keyMap.put("filter-config","filter-class-name");
250         keyMap.put("security-map","name");
251         keyMap.put("load-balancer","name");
252         keyMap.put("management-rule","name");
253     }
254     private void buildElementStructureMap(){
255         
256         if(elementStructureMap == null){
257             this.elementStructureMap = new HashMap JavaDoc();
258         }
259         // List is empty if this element to be inserted as the first element.
260
// List contains all element names that appear in the tree after this element appears. (Include names untill the next mandatory element is found)
261
// If the element to be inserted at the end do not add any mapping. if null, then it assumed to be put at the end.
262
// If the element is mandatory and need not be added to the tree, then this structure need not be built
263

264         elementStructureMap.put("http-service", getListWithElementNames(null));
265         elementStructureMap.put("iiop-service", getListWithElementNames(new String JavaDoc[]{"admin-service"}));
266         
267         //request-processing? , keep-alive? , connection-pool? , http-protocol? , http-file-cache? , property*)
268
elementStructureMap.put("http-listener", getListWithElementNames(new String JavaDoc[]{"virtual-server"}));
269         elementStructureMap.put("virtual-server", getListWithElementNames(new String JavaDoc[]{"request-processing","keep-alive","connection-pool","http-protocol","http-file-cache","property"}));
270         elementStructureMap.put("request-processing", getListWithElementNames(new String JavaDoc[]{"keep-alive","connection-pool","http-protocol","http-file-cache","property"}));
271         elementStructureMap.put("keep-alive", getListWithElementNames(new String JavaDoc[]{"connection-pool","http-protocol","http-file-cache","property"}));
272         elementStructureMap.put("connection-pool", getListWithElementNames(new String JavaDoc[]{"http-protocol","http-file-cache","property"}));
273         elementStructureMap.put("http-protocol", getListWithElementNames(new String JavaDoc[]{"http-file-cache","property"}));
274         elementStructureMap.put("http-file-cache", getListWithElementNames(new String JavaDoc[]{"property"}));
275         // resource elements
276
//custom-resource | external-jndi-resource | jdbc-resource | mail-resource | persistence-manager-factory-resource | admin-object-resource | connector-resource | resource-adapter-config | jdbc-connection-pool | connector-connection-pool)*)
277
elementStructureMap.put("custom-resource", getListWithElementNames(new String JavaDoc[]{}));
278         elementStructureMap.put("external-jndi-resource", getListWithElementNames(new String JavaDoc[]{"jdbc-resource","mail-resource","persistence-manager-factory-resource","admin-object-resource","connector-resource","resource-adapter-config","jdbc-connection-pool","connector-connection-pool"}));
279         elementStructureMap.put("jdbc-resource", getListWithElementNames(new String JavaDoc[]{"mail-resource","persistence-manager-factory-resource","admin-object-resource","connector-resource","resource-adapter-config","jdbc-connection-pool","connector-connection-pool"}));
280         elementStructureMap.put("mail-resource", getListWithElementNames(new String JavaDoc[]{"persistence-manager-factory-resource","admin-object-resource","connector-resource","resource-adapter-config","jdbc-connection-pool","connector-connection-pool"}));
281         elementStructureMap.put("persistence-manager-factory-resource", getListWithElementNames(new String JavaDoc[]{"admin-object-resource","connector-resource","resource-adapter-config","jdbc-connection-pool","connector-connection-pool"}));
282         elementStructureMap.put("admin-object-resource", getListWithElementNames(new String JavaDoc[]{"connector-resource","resource-adapter-config","jdbc-connection-pool","connector-connection-pool"}));
283         elementStructureMap.put("connector-resource", getListWithElementNames(new String JavaDoc[]{"resource-adapter-config","jdbc-connection-pool","connector-connection-pool"}));
284         elementStructureMap.put("resource-adapter-config", getListWithElementNames(new String JavaDoc[]{"jdbc-connection-pool","connector-connection-pool"}));
285         elementStructureMap.put("jdbc-connection-pool", getListWithElementNames(new String JavaDoc[]{"connector-connection-pool"}));
286         
287         // description is always the first element
288
elementStructureMap.put("description", getListWithElementNames(new String JavaDoc[]{}));
289         elementStructureMap.put("jms-service", getListWithElementNames(new String JavaDoc[]{"log-service"}));
290         elementStructureMap.put("availability-service", getListWithElementNames(new String JavaDoc[]{"thread-pools"}));
291         
292         // ssl element always appear first
293
elementStructureMap.put("ssl", getListWithElementNames(new String JavaDoc[]{}));
294         elementStructureMap.put("orb", getListWithElementNames(new String JavaDoc[]{}));
295         elementStructureMap.put("ssl-client-config", getListWithElementNames(new String JavaDoc[]{"iiop-listener"}));
296         
297             //jmx-connector* , das-config? , property*)
298
elementStructureMap.put("jmx-connector", getListWithElementNames(new String JavaDoc[]{}));
299         elementStructureMap.put("das-config", getListWithElementNames(new String JavaDoc[]{"property"}));
300         
301         elementStructureMap.put("session-config", getListWithElementNames(new String JavaDoc[]{}));
302         elementStructureMap.put("session-manager", getListWithElementNames(new String JavaDoc[]{}));
303         elementStructureMap.put("manager-properties", getListWithElementNames(new String JavaDoc[]{}));
304         elementStructureMap.put("ejb-timer-service", getListWithElementNames(new String JavaDoc[]{}));
305         elementStructureMap.put("jms-host", getListWithElementNames(new String JavaDoc[]{}));
306         elementStructureMap.put("module-log-levels", getListWithElementNames(new String JavaDoc[]{}));
307         
308         //auth-realm+ , jacc-provider+ , audit-module* , message-security-config* , property*)
309
elementStructureMap.put("auth-realm", getListWithElementNames(new String JavaDoc[]{}));
310         elementStructureMap.put("jacc-provider", getListWithElementNames(new String JavaDoc[]{"audit-module","message-security-config","property"}));
311         elementStructureMap.put("audit-module", getListWithElementNames(new String JavaDoc[]{"message-security-config","property"}));
312         elementStructureMap.put("message-security-config",getListWithElementNames(new String JavaDoc[]{"property"}));
313         elementStructureMap.put("module-monitoring-levels", getListWithElementNames(new String JavaDoc[]{}));
314         
315         elementStructureMap.put("profiler", getListWithElementNames(new String JavaDoc[]{}));
316         elementStructureMap.put("jvm-options", getListWithElementNames(new String JavaDoc[]{"property"}));
317         
318         //web-container-availability? , ejb-container-availability? , property*)
319
elementStructureMap.put("web-container-availability", getListWithElementNames(new String JavaDoc[]{}));
320         elementStructureMap.put("ejb-container-availability", getListWithElementNames(new String JavaDoc[]{"jms-availability","property"}));
321         elementStructureMap.put("jms-availability", getListWithElementNames(new String JavaDoc[]{"property"}));
322         elementStructureMap.put("security-map", getListWithElementNames(new String JavaDoc[]{"property"}));
323         elementStructureMap.put("principal", getListWithElementNames(new String JavaDoc[]{}));
324         //principal | user-group)+ , backend-principal)
325
elementStructureMap.put("user-group", getListWithElementNames(new String JavaDoc[]{"backend-principal"}));
326         
327         //application-ref* , resource-ref* , system-property* , property*)
328
// application-ref here is used for cluster update. For Server update, deployment module will add it
329
elementStructureMap.put("application-ref", getListWithElementNames(new String JavaDoc[]{"system-property" , "property"}));
330         elementStructureMap.put("resource-ref", getListWithElementNames(new String JavaDoc[]{"system-property" , "property"}));
331         elementStructureMap.put("system-property" , getListWithElementNames(new String JavaDoc[]{ "property"}));
332         
333         elementStructureMap.put("principal", getListWithElementNames(new String JavaDoc[]{}));
334         
335         // AS90 related
336
elementStructureMap.put("alert-service", getListWithElementNames(new String JavaDoc[]{"group-management-service","management-rules","system-property","property"}));
337         elementStructureMap.put("group-management-service", getListWithElementNames(new String JavaDoc[]{"management-rules","system-property","property"}));
338         elementStructureMap.put("management-rules", getListWithElementNames(new String JavaDoc[]{"system-property","property"}));
339         elementStructureMap.put("lb-configs", getListWithElementNames(new String JavaDoc[]{"system-property","property"}));
340         elementStructureMap.put("load-balancers", getListWithElementNames(new String JavaDoc[]{"","system-property","property"}));
341         elementStructureMap.put("connector-service", getListWithElementNames(new String JavaDoc[]{"web-container"}));
342         elementStructureMap.put("alert-subscription", getListWithElementNames(new String JavaDoc[]{}));
343         elementStructureMap.put("listener-config", getListWithElementNames(new String JavaDoc[]{}));
344         elementStructureMap.put("access-log", getListWithElementNames(new String JavaDoc[]{}));
345         elementStructureMap.put("http-access-log", getListWithElementNames(new String JavaDoc[]{}));
346         elementStructureMap.put("server-ref", getListWithElementNames(new String JavaDoc[]{}));
347         
348     }
349     private java.util.List JavaDoc getListWithElementNames(String JavaDoc[] succeedingElements){
350         java.util.ArrayList JavaDoc eleList = new java.util.ArrayList JavaDoc();
351         if(succeedingElements != null){
352             for(int i=0; i<succeedingElements.length; i++){
353                 eleList.add(succeedingElements[i]);
354             }
355         }
356         return eleList;
357     }
358 }
359
Popular Tags