KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > metadata > WebMetaData


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software 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 software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.metadata;
23
24 import java.net.URLClassLoader JavaDoc;
25 import java.util.ArrayList JavaDoc;
26 import java.util.Collection JavaDoc;
27 import java.util.HashMap JavaDoc;
28 import java.util.HashSet JavaDoc;
29 import java.util.Iterator JavaDoc;
30 import java.util.List JavaDoc;
31 import java.util.Map JavaDoc;
32 import java.util.Set JavaDoc;
33
34 import javax.management.MalformedObjectNameException JavaDoc;
35
36 import org.jboss.deployment.DeploymentException;
37 import org.jboss.logging.Logger;
38 import org.jboss.metadata.web.ErrorPage;
39 import org.jboss.metadata.web.Filter;
40 import org.jboss.metadata.web.FilterMapping;
41 import org.jboss.metadata.web.LoginConfig;
42 import org.jboss.metadata.web.ParamValue;
43 import org.jboss.metadata.web.PassivationConfig;
44 import org.jboss.metadata.web.ReplicationConfig;
45 import org.jboss.metadata.web.Servlet;
46 import org.jboss.metadata.web.ServletMapping;
47 import org.jboss.metadata.web.SessionConfig;
48 import org.jboss.metamodel.descriptor.ResourceEnvRef;
49 import org.jboss.metamodel.descriptor.ResourceRef;
50 import org.jboss.mx.loading.LoaderRepositoryFactory;
51 import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
52 import org.jboss.mx.util.ObjectNameFactory;
53 import org.jboss.security.RunAsIdentity;
54 import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
55 import org.w3c.dom.Element JavaDoc;
56
57 /** A representation of the web.xml and jboss-web.xml deployment
58  * descriptors as used by the AbstractWebContainer web container integration
59  * support class.
60  *
61  * @see org.jboss.metadata.web.WebMetaDataObjectFactory
62  * @see org.jboss.web.AbstractWebContainer
63  *
64  * @author Scott.Stark@jboss.org
65  * @version $Revision: 58547 $
66  */

67 public class WebMetaData extends MetaData
68 {
69    private static Logger log = Logger.getLogger(WebMetaData.class);
70
71    /** web-app/description */
72    private String JavaDoc description;
73    /** web-app/display-name */
74    private String JavaDoc displayName;
75    /** An alternate web.xml descriptor the web container should parse */
76    private String JavaDoc altDDPath;
77    /** web-app/context-param */
78    private List JavaDoc<ParamValue> contextParams = new ArrayList JavaDoc<ParamValue>();
79    /** web-app/init-param */
80    private List JavaDoc<ParamValue> initParams = new ArrayList JavaDoc<ParamValue>();
81    
82    private HashMap JavaDoc<String JavaDoc, Servlet> servlets = new HashMap JavaDoc<String JavaDoc, Servlet>();
83    /** The web.xml servlet-mapping <String, String> */
84    private HashMap JavaDoc<String JavaDoc, ServletMapping> servletMappings = new HashMap JavaDoc<String JavaDoc, ServletMapping>();
85    /** The web.xml resource-refs */
86    private HashMap JavaDoc<String JavaDoc, ResourceRefMetaData> resourceReferences =
87       new HashMap JavaDoc<String JavaDoc, ResourceRefMetaData>();
88    /** The web.xml resource-env-refs */
89    private HashMap JavaDoc<String JavaDoc, ResourceEnvRefMetaData> resourceEnvReferences =
90       new HashMap JavaDoc<String JavaDoc, ResourceEnvRefMetaData>();
91    /** The web.xml message-destination-refs */
92    private HashMap JavaDoc<String JavaDoc, MessageDestinationRefMetaData> messageDestinationReferences
93       = new HashMap JavaDoc<String JavaDoc, MessageDestinationRefMetaData>();
94    /** The web.xml message-destination */
95    private HashMap JavaDoc<String JavaDoc, MessageDestinationMetaData> messageDestinations =
96          new HashMap JavaDoc<String JavaDoc, MessageDestinationMetaData>();
97    /** web-app/filter */
98    protected HashMap JavaDoc<String JavaDoc, Filter> filters = new HashMap JavaDoc<String JavaDoc, Filter>();
99    /** web-app/filter-mapping */
100    protected HashMap JavaDoc<String JavaDoc, FilterMapping> filterMappings =
101       new HashMap JavaDoc<String JavaDoc, FilterMapping>();
102    protected HashMap JavaDoc listeners = new HashMap JavaDoc();
103    protected List JavaDoc<SessionConfig> sessionConfigs = new ArrayList JavaDoc<SessionConfig>();
104    /** web.xml security-constraint */
105    protected List JavaDoc<WebSecurityMetaData> securityConstraints =
106       new ArrayList JavaDoc<WebSecurityMetaData>();
107    protected LoginConfig loginConfig;
108    protected HashMap JavaDoc<String JavaDoc, ErrorPage> errorPages = new HashMap JavaDoc<String JavaDoc, ErrorPage>();
109    protected List JavaDoc<String JavaDoc> dependencies = new ArrayList JavaDoc<String JavaDoc>();
110    protected ReplicationConfig replicationConfig;
111    protected PassivationConfig passivationConfig;
112
113    /** web.xml env-entrys */
114    private ArrayList JavaDoc<EnvEntryMetaData> environmentEntries = new ArrayList JavaDoc<EnvEntryMetaData>();
115    /** The HashMap for the security-roles */
116    private HashMap JavaDoc<String JavaDoc, SecurityRoleMetaData> securityRoles = new HashMap JavaDoc<String JavaDoc, SecurityRoleMetaData>();
117    /** web.xml ejb-refs */
118    private HashMap JavaDoc ejbReferences = new HashMap JavaDoc();
119    /** web.xml ejb-local-refs */
120    private HashMap JavaDoc<String JavaDoc, EjbLocalRefMetaData> ejbLocalReferences = new HashMap JavaDoc<String JavaDoc, EjbLocalRefMetaData>();
121    /** The web.xml service-refs */
122    private HashMap JavaDoc serviceReferences = new HashMap JavaDoc();
123    /** web.xml security-role-refs <String servlet-name, ArrayList<SecurityRoleRefMetaData>> */
124    private HashMap JavaDoc securityRoleReferences = new HashMap JavaDoc();
125    /** The web.xml servlet/run-as <String servlet-name, String role> */
126    private HashMap JavaDoc runAsNames = new HashMap JavaDoc();
127    /** The jboss-web.xml servlet/run-as <String servlet-name, RunAsIdentity> */
128    private HashMap JavaDoc runAsIdentity = new HashMap JavaDoc();
129    /** The web.xml distributable flag */
130    private boolean distributable = false;
131    /** The jboss-web.xml class-loading.java2ClassLoadingCompliance flag */
132    private boolean java2ClassLoadingCompliance = false;
133    /** The jboss-web.xml class-loading/loader-repository */
134    private LoaderRepositoryConfig loaderConfig;
135    /** The war context root as specified at the jboss-web.xml descriptor level. */
136    private String JavaDoc contextRoot;
137    /** The JACC context id for the container */
138    private String JavaDoc jaccContextID;
139    /** The jboss-web.xml server container virtual hosts the war should be deployed into */
140    private ArrayList JavaDoc virtualHosts = new ArrayList JavaDoc();
141    /** The jboss-web.xml JNDI name of the security domain implementation */
142    private String JavaDoc securityDomain;
143    /** The jboss-web.xml securityDomain flushOnSessionInvalidation attribute */
144    private boolean flushOnSessionInvalidation;
145    /** A HashMap<String, String> for webservice description publish locations */
146    private HashMap JavaDoc wsdlPublishLocationMap = new HashMap JavaDoc();
147    /** True if this is a web service deployment */
148    private boolean webServiceDeployment;
149    /** The optional JBossWS config-name */
150    private String JavaDoc configName;
151    /** The optional JBossWS config-file */
152    private String JavaDoc configFile;
153    /** The web context class loader used to create the java:comp context */
154    private ClassLoader JavaDoc encLoader;
155    /** The web context class loader, used to create the ws4ee service endpoint */
156    private ClassLoader JavaDoc cxtLoader;
157    /** ArrayList<ObjectName> of the web app dependencies */
158    private ArrayList JavaDoc depends = new ArrayList JavaDoc();
159
160    /**
161     * this is really a hack for new injection code so that we can reparse web.xml/jbossweb.xml for JavaEE 5 injections
162     * todo remove this when we clean up
163     */

164    private HashMap JavaDoc arbitraryMetadata = new HashMap JavaDoc();
165
166    public static final int SESSION_INVALIDATE_ACCESS =0;
167    public static final int SESSION_INVALIDATE_SET_AND_GET =1;
168    public static final int SESSION_INVALIDATE_SET_AND_NON_PRIMITIVE_GET =2;
169    public static final int SESSION_INVALIDATE_SET =3;
170
171    private int invalidateSessionPolicy = SESSION_INVALIDATE_SET_AND_NON_PRIMITIVE_GET;
172
173    public static final int REPLICATION_TYPE_SYNC = 0;
174    public static final int REPLICATION_TYPE_ASYNC = 1;
175
176    /**
177     * @deprecated Since JBoss3.2.6.
178     */

179    private int replicationType = REPLICATION_TYPE_SYNC;
180
181    /** Specify the session replication granularity level: session --- whole session level,
182     * attribute --- per attribute change, field --- fine grained user object level.
183     *
184     */

185    public static final int REPLICATION_GRANULARITY_SESSION = 0;
186    public static final int REPLICATION_GRANULARITY_ATTRIBUTE = 1;
187    public static final int REPLICATION_GRANULARITY_FIELD = 2;
188    private int replicationGranularity = REPLICATION_GRANULARITY_SESSION;
189
190    /**
191     * If the replication granularity is FIELD, specify whether to use batch mode
192     * for pojo replication or not.
193     */

194    private boolean replicationFieldBatchMode = true;
195    
196    /**
197     * If true then the session passivation is enabled for this web app.
198     * If false then the session passivation is disabled for this web app.
199     */

200    private boolean sessionPassivationMode = false;
201    
202    /**
203     * Min time (seconds) the session must be idle since lastAccesstime before it's eligable for passivation
204     * This overrides maxActive_, to prevent thrashing if the there are lots of active sessions.
205     * Setting to -1 means it's ignored
206     */

207    private int sessionPassivationMinIdleTime = -1;
208    
209    /**
210     * Max time (seconds) the session must be idle since lastAccesstime before it's eligable for passivation
211     * This overrides maxActive_, to prevent thrashing if the there are lots of active sessions.
212     * Setting to -1 means session should not be forced out.
213     */

214    private int sessionPassivationMaxIdleTime = -1;
215    
216    /**
217     * The maximum number of active sessions allowed, or -1 for no limit
218     */

219    private int maxActiveSessions = -1;
220    
221
222    /** Should the context use session cookies or use default */
223    private int sessionCookies = SESSION_COOKIES_DEFAULT;
224
225    public static final int SESSION_COOKIES_DEFAULT=0;
226    public static final int SESSION_COOKIES_ENABLED=1;
227    public static final int SESSION_COOKIES_DISABLED=2;
228
229    /** The ClassLoader to load additional resources */
230    private URLClassLoader JavaDoc resourceCl;
231
232    public String JavaDoc getDescription()
233    {
234       return description;
235    }
236
237    public void setDescription(String JavaDoc description)
238    {
239       this.description = description;
240    }
241
242    public String JavaDoc getDisplayName()
243    {
244       return displayName;
245    }
246
247    public void setDisplayName(String JavaDoc displayName)
248    {
249       this.displayName = displayName;
250    }
251
252    public String JavaDoc getAltDDPath()
253    {
254       return altDDPath;
255    }
256    public void setAltDDPath(String JavaDoc altDDPath)
257    {
258       this.altDDPath = altDDPath;
259    }
260
261    public List JavaDoc<ParamValue> getContextParams()
262    {
263       return contextParams;
264    }
265    public void addContextParam(ParamValue pv)
266    {
267       contextParams.add(pv);
268    }
269    public List JavaDoc<ParamValue> getInitParams()
270    {
271       return initParams;
272    }
273    public void addInitParam(ParamValue pv)
274    {
275       initParams.add(pv);
276    }
277
278    public HashMap JavaDoc getArbitraryMetadata()
279    {
280       return arbitraryMetadata;
281    }
282
283    /** Set the ClassLoader to load additional resources */
284    public void setResourceClassLoader(URLClassLoader JavaDoc resourceCl)
285    {
286       this.resourceCl = resourceCl;
287    }
288
289    public void addFilter(Filter filter)
290    {
291       filters.put(filter.getName(), filter);
292    }
293    
294    public Collection JavaDoc getFilterMappings()
295    {
296       return filterMappings.values();
297    }
298
299    public void addFilterMapping(FilterMapping mapping)
300    {
301       filterMappings.put(mapping.getFilterName(), mapping);
302    }
303    
304    public Collection JavaDoc getListeners()
305    {
306       return listeners.values();
307    }
308
309    public void addListener(Listener listener)
310    {
311       listeners.put(listener.getListenerClass(), listener);
312    }
313    
314    public Collection JavaDoc getServlets()
315    {
316       return servlets.values();
317    }
318
319    public void addServlet(Servlet servlet)
320    {
321       String JavaDoc servletName = servlet.getName();
322       servlets.put(servletName, servlet);
323    }
324    
325    public void updateServlet(Servlet updatedServlet)
326    {
327       Servlet servlet = (Servlet)servlets.get(updatedServlet.getName());
328       if (servlet != null)
329       {
330          servlet.setRunAsPrincipals(updatedServlet.getRunAsPrincipals());
331       }
332       else
333       {
334          servlets.put(updatedServlet.getName(), updatedServlet);
335       }
336    }
337    
338    public Collection JavaDoc getServletMappings()
339    {
340       return servletMappings.values();
341    }
342
343    public void addServletMapping(ServletMapping mapping)
344    {
345       servletMappings.put(mapping.getName(), mapping);
346    }
347    
348    public Collection JavaDoc getSessionConfigs()
349    {
350       return sessionConfigs;
351    }
352
353    public void addSessionConfig(SessionConfig config)
354    {
355       sessionConfigs.add(config);
356    }
357    
358    public void addSecurityRole(SecurityRoleMetaData securityRole)
359    {
360       securityRoles.put(securityRole.getRoleName(), securityRole);
361    }
362    
363    public void updateSecurityRole(SecurityRoleMetaData updatedRole)
364    {
365       SecurityRoleMetaData role = securityRoles.get(updatedRole.getRoleName());
366       if (role != null)
367       {
368          role.setRoleName(updatedRole.getRoleName());
369       }
370       else
371       {
372          securityRoles.put(updatedRole.getRoleName(), updatedRole);
373       }
374    }
375    
376    public Collection JavaDoc getSecurityConstraints()
377    {
378       return securityConstraints;
379    }
380
381    public void addSecurityConstraint(WebSecurityMetaData constraint)
382    {
383       securityConstraints.add(constraint);
384    }
385    
386    public LoginConfig getLoginConfig()
387    {
388       return loginConfig;
389    }
390    
391    public void setLoginConfig(LoginConfig loginConfig)
392    {
393       this.loginConfig = loginConfig;
394    }
395    
396    public Collection JavaDoc getErrorPages()
397    {
398       return errorPages.values();
399    }
400
401    public void addErrorPage(ErrorPage errorPage)
402    {
403       errorPages.put(errorPage.getErrorCode(), errorPage);
404    }
405    
406    public Collection JavaDoc getMessageDestinations()
407    {
408       return messageDestinations.values();
409    }
410
411    public void addEjbLocalRef(EjbLocalRefMetaData ref)
412    {
413       this.ejbLocalReferences.put(ref.getName(), ref);
414    }
415    public void addEjbRef(EjbRefMetaData ref)
416    {
417       this.ejbReferences.put(ref.getName(), ref);
418    }
419    public void addEnvEntry(EnvEntryMetaData ref)
420    {
421       this.environmentEntries.add(ref);
422    }
423    public void addMessageDestinationRef(MessageDestinationRefMetaData ref)
424    {
425       this.messageDestinationReferences.put(ref.getRefName(), ref);
426    }
427    public void addMessageDestination(MessageDestinationMetaData destination)
428    {
429       log.debug("addMessageDestination, "+destination);
430       messageDestinations.put(destination.getName(), destination);
431    }
432    public void updateMessageDestination(MessageDestinationMetaData updatedDestination)
433    {
434       MessageDestinationMetaData destination = (MessageDestinationMetaData)
435          messageDestinations.get(updatedDestination.getName());
436       if (destination != null)
437       {
438          destination.setJNDIName(updatedDestination.getMappedName());
439       }
440       else
441       {
442          messageDestinations.put(updatedDestination.getName(), updatedDestination);
443       }
444    }
445    public void addResourceEnvRef(ResourceEnvRefMetaData ref)
446    {
447       this.resourceEnvReferences.put(ref.getRefName(), ref);
448    }
449    public void updateResourceEnvRef(ResourceEnvRefMetaData updatedRef)
450    {
451       ResourceEnvRefMetaData ref = (ResourceEnvRefMetaData)resourceEnvReferences.get(updatedRef.getRefName());
452       if (ref != null)
453       {
454          ref.setJndiName(updatedRef.getJndiName());
455       }
456       else
457       {
458          this.addResourceEnvRef(updatedRef);
459       }
460    }
461
462    public void addResourceRef(ResourceRefMetaData ref)
463    {
464       this.resourceReferences.put(ref.getRefName(), ref);
465    }
466    public void updateResourceRef(ResourceRefMetaData updatedRef)
467    {
468       ResourceRefMetaData ref = (ResourceRefMetaData)resourceReferences.get(updatedRef.getRefName());
469       if (ref != null)
470       {
471          ref.setJndiName(updatedRef.getJndiName());
472          ref.setResURL(updatedRef.getResURL());
473          ref.setResourceName(updatedRef.getResourceName());
474       }
475       else
476       {
477          this.addResourceRef(updatedRef);
478       }
479    }
480
481    public void addDependency(String JavaDoc depends)
482    {
483       dependencies.add(depends);
484    }
485
486    public Collection JavaDoc<String JavaDoc> getDependencies()
487    {
488       return dependencies;
489    }
490    
491    public ReplicationConfig getReplicationConfig()
492    {
493       return replicationConfig;
494    }
495    
496    public void setReplicationConfig(ReplicationConfig replicationConfig)
497    {
498       this.replicationConfig = replicationConfig;
499    }
500
501    public PassivationConfig getPassivationConfig()
502    {
503       return passivationConfig;
504    }
505
506    public void setPassivationConfig(PassivationConfig passivationConfig)
507    {
508       this.passivationConfig = passivationConfig;
509    }
510
511    /** Return an iterator of the env-entry mappings.
512     @return Iterator of EnvEntryMetaData objects.
513     */

514    public Iterator JavaDoc<EnvEntryMetaData> getEnvironmentEntries()
515    {
516       return environmentEntries.iterator();
517    }
518    /**
519     *
520     * @param environmentEntries - Collection<EnvEntryMetaData>
521     */

522    public void setEnvironmentEntries(Collection JavaDoc environmentEntries)
523    {
524       this.environmentEntries.clear();
525       this.environmentEntries.addAll(environmentEntries);
526    }
527
528    /** Return an iterator of the ejb-ref mappings.
529     @return Iterator of EjbRefMetaData objects.
530     */

531    public Iterator JavaDoc getEjbReferences()
532    {
533       return ejbReferences.values().iterator();
534    }
535    /**
536     *
537     * @param ejbReferences - Map<String, EjbRefMetaData>
538     */

539    public void setEjbReferences(Map JavaDoc ejbReferences)
540    {
541       this.ejbReferences.clear();
542       this.ejbReferences.putAll(ejbReferences);
543    }
544
545    /** Return an iterator of the ejb-local-ref mappings.
546     @return Iterator of EjbLocalRefMetaData objects.
547     */

548    public Iterator JavaDoc<EjbLocalRefMetaData> getEjbLocalReferences()
549    {
550       return ejbLocalReferences.values().iterator();
551    }
552    public Map JavaDoc<String JavaDoc, EjbLocalRefMetaData> getEjbLocalReferenceMap()
553    {
554       return ejbLocalReferences;
555    }
556    /**
557     *
558     * @param ejbReferences - Map<String, EjbRefMetaData>
559     */

560    public void setEjbLocalReferences(Map JavaDoc ejbReferences)
561    {
562       this.ejbLocalReferences.clear();
563       this.ejbLocalReferences.putAll(ejbReferences);
564    }
565
566    /** Return an iterator of the resource-ref mappings.
567     @return Iterator of ResourceRefMetaData objects.
568     */

569    public Iterator JavaDoc getResourceReferences()
570    {
571       return resourceReferences.values().iterator();
572    }
573    /**
574     *
575     * @param resourceReferences - Map<String, ResourceRefMetaData>
576     */

577    public void setResourceReferences(Map JavaDoc resourceReferences)
578    {
579       this.resourceReferences.clear();
580       this.resourceReferences.putAll(resourceReferences);
581    }
582
583    /** Return an iterator of the resource-ref mappings.
584     @return Iterator of ResourceEnvRefMetaData objects.
585     */

586    public Iterator JavaDoc getResourceEnvReferences()
587    {
588       return resourceEnvReferences.values().iterator();
589    }
590    /**
591     *
592     * @param resourceReferences - Map<String, ResourceEnvRefMetaData>
593     */

594    public void setResourceEnvReferences(Map JavaDoc resourceReferences)
595    {
596       this.resourceEnvReferences.clear();
597       this.resourceEnvReferences.putAll(resourceReferences);
598    }
599
600    /**
601     * Return an iterator of message-destination-refs.
602     *
603     * @return Iterator of MessageDestinationRefMetaData objects.
604     */

605    public Iterator JavaDoc getMessageDestinationReferences()
606    {
607       return messageDestinationReferences.values().iterator();
608    }
609    /**
610     *
611     * @param messageDestinationReferences - Map<String, MessageDestinationRefMetaData>
612     */

613    public void setMessageDestinationReferences(Map JavaDoc messageDestinationReferences)
614    {
615       this.messageDestinationReferences.clear();
616       this.messageDestinationReferences.putAll(messageDestinationReferences);
617    }
618
619    /**
620     * Get a message destination metadata
621     *
622     * @param name the name of the message destination
623     * @return the message destination metadata
624     */

625    public MessageDestinationMetaData getMessageDestination(String JavaDoc name)
626    {
627       return (MessageDestinationMetaData) messageDestinations.get(name);
628    }
629    /**
630     *
631     * @param messageDestinations - Map<String, MessageDestinationMetaData>
632     */

633    public void setMessageDestination(Map JavaDoc messageDestinations)
634    {
635       this.messageDestinations.clear();
636       this.messageDestinations.putAll(messageDestinations);
637    }
638
639    /** Return an iterator of the service-ref mappings.
640     * @return Iterator of ServiceRefMetaData objects
641     */

642    public Iterator JavaDoc getServiceReferences()
643    {
644       return serviceReferences.values().iterator();
645    }
646    /**
647     *
648     * @param serviceReferences - Map<String, ServiceRefMetaData>
649     */

650    public void setServiceReferences(Map JavaDoc serviceReferences)
651    {
652       this.serviceReferences.clear();
653       this.serviceReferences.putAll(serviceReferences);
654    }
655
656    /** This the the jboss-web.xml descriptor context-root and it
657     *is only meaningful if a war is deployed outside of an ear.
658     */

659    public String JavaDoc getContextRoot()
660    {
661       return contextRoot;
662    }
663    public void setContextRoot(String JavaDoc contextRoot)
664    {
665       this.contextRoot = contextRoot;
666    }
667
668    public String JavaDoc getConfigFile()
669    {
670       return configFile;
671    }
672
673    public void setConfigFile(String JavaDoc configFile)
674    {
675       this.configFile = configFile;
676    }
677
678    public String JavaDoc getConfigName()
679    {
680       return configName;
681    }
682
683    public void setConfigName(String JavaDoc configName)
684    {
685       this.configName = configName;
686    }
687
688    public HashMap JavaDoc getWsdlPublishLocations()
689    {
690       return wsdlPublishLocationMap;
691    }
692
693    /** Get the optional wsdl publish location from jboss-web.xml. */
694    public String JavaDoc getWsdlPublishLocationByName(String JavaDoc name)
695    {
696       return (String JavaDoc)wsdlPublishLocationMap.get(name);
697    }
698    /**
699     *
700     * @param wsdlPublishLocationMap - Map<String, String>
701     */

702    public void setWsdlPublishLocationMap(Map JavaDoc wsdlPublishLocationMap)
703    {
704       this.wsdlPublishLocationMap.clear();
705       this.wsdlPublishLocationMap.putAll(wsdlPublishLocationMap);
706    }
707
708    public boolean isWebServiceDeployment()
709    {
710       return webServiceDeployment;
711    }
712
713    public void setWebServiceDeployment(boolean webServiceDeployment)
714    {
715       this.webServiceDeployment = webServiceDeployment;
716    }
717
718    public String JavaDoc getJaccContextID()
719    {
720       return jaccContextID;
721    }
722    public void setJaccContextID(String JavaDoc jaccContextID)
723    {
724       this.jaccContextID = jaccContextID;
725    }
726
727    /** Return the optional security-domain jboss-web.xml element.
728     @return The jndiName of the security manager implementation that is
729     responsible for security of the web application. May be null if
730     there was no security-domain specified in the jboss-web.xml
731     descriptor.
732     */

733    public String JavaDoc getSecurityDomain()
734    {
735       return securityDomain;
736    }
737
738    /** Set the security domain for this web application
739     */

740    public void setSecurityDomain(String JavaDoc securityDomain)
741    {
742       this.securityDomain = securityDomain;
743    }
744
745    /** The flag indicating whether the associated security domain cache
746     * should be flushed when the session is invalidated.
747     * @return true if the flush should occur, false otherwise.
748     */

749    public boolean isFlushOnSessionInvalidation()
750    {
751       return flushOnSessionInvalidation;
752    }
753    /** The flag indicating whether the associated security domain cache
754     * should be flushed when the session is invalidated.
755     * @param flag - true if the flush should occur, false otherwise.
756     */

757    public void setFlushOnSessionInvalidation(boolean flag)
758    {
759       this.flushOnSessionInvalidation = flag;
760    }
761
762    /** Get the security-constraint settings
763     */

764    public Iterator JavaDoc<WebSecurityMetaData> getSecurityContraints()
765    {
766       return securityConstraints.iterator();
767    }
768
769    /**
770     *
771     * @param securityContraints - Collection<WebSecurityMetaData>
772     */

773    public void setSecurityConstraints(Collection JavaDoc<WebSecurityMetaData> securityContraints)
774    {
775       this.securityConstraints.clear();
776       this.securityConstraints.addAll(securityContraints);
777    }
778
779    /**
780     * @return <String servlet-name, ArrayList<SecurityRoleRefMetaData>>
781     */

782    public Map JavaDoc getSecurityRoleRefs()
783    {
784       return this.securityRoleReferences;
785    }
786    /**
787     *
788     * @param servletName
789     * @return List<SecurityRoleRefMetaData> for the given servlet name
790     */

791    public List JavaDoc getSecurityRoleRefs(String JavaDoc servletName)
792    {
793       List JavaDoc roles = (List JavaDoc) this.securityRoleReferences.get(servletName);
794       return roles;
795    }
796    /**
797     *
798     * @param securityRoleReferences - <String servlet-name, ArrayList<SecurityRoleRefMetaData>>
799     */

800    public void setSecurityRoleReferences(Map JavaDoc securityRoleReferences)
801    {
802       this.securityRoleReferences.clear();
803       this.securityRoleReferences.putAll(securityRoleReferences);
804    }
805
806    /**
807     * Get the security-role names from the web.xml descriptor
808     * @return Set<String> of the security-role names from the web.xml
809     */

810    public Set JavaDoc getSecurityRoleNames()
811    {
812       return new HashSet JavaDoc(securityRoles.keySet());
813    }
814
815    /** Get the optional map of security role/user mapping.
816     * @return Map<String, SecurityRoleMetaData>
817     */

818    public Map JavaDoc getSecurityRoles()
819    {
820       return new HashMap JavaDoc(securityRoles);
821    }
822    /**
823     *
824     * @param securityRoles - Map<String, SecurityRoleMetaData>
825     */

826    public void setSecurityRoles(Map JavaDoc securityRoles)
827    {
828       this.securityRoles.clear();
829       this.securityRoles.putAll(securityRoles);
830    }
831
832    /**
833     *
834     * @param userName
835     * @return Set<String>
836     */

837    public Set JavaDoc getSecurityRoleNamesByPrincipal(String JavaDoc userName)
838    {
839       HashSet JavaDoc roleNames = new HashSet JavaDoc();
840       Iterator JavaDoc it = securityRoles.values().iterator();
841       while (it.hasNext())
842       {
843          SecurityRoleMetaData srMetaData = (SecurityRoleMetaData) it.next();
844          if (srMetaData.getPrincipals().contains(userName))
845             roleNames.add(srMetaData.getRoleName());
846       }
847       return roleNames;
848    }
849    
850    /**
851     * Get a map of principals versus set of roles
852     * that may be configured by the user at the deployment level
853     * @return
854     */

855    public Map JavaDoc getPrincipalVersusRolesMap()
856    {
857       Map JavaDoc principalRolesMap = null;
858       
859