1 22 package org.jboss.web.metamodel.descriptor; 23 24 import java.util.ArrayList ; 25 import java.util.Collection ; 26 import java.util.HashMap ; 27 28 import org.jboss.metamodel.descriptor.NameValuePair; 29 import org.jboss.metamodel.descriptor.RunAs; 30 import org.jboss.metamodel.descriptor.SecurityRoleRef; 31 32 import org.jboss.logging.Logger; 33 34 41 public class Servlet 42 { 43 private static final Logger log = Logger.getLogger(Servlet.class); 44 45 protected String name; 46 protected String clazz; 47 protected String jspFile; 48 protected HashMap initParams = new HashMap (); 49 protected String loadOnStartup; 50 protected RunAs runAs; 51 protected HashMap securityRoleRefs = new HashMap (); 52 protected Collection runAsPrincipals = new ArrayList (); 53 54 public String getName() 55 { 56 return name; 57 } 58 59 public void setName(String name) 60 { 61 this.name = name; 62 } 63 64 public String getServletClass() 65 { 66 return clazz; 67 } 68 69 public void setServletClass(String clazz) 70 { 71 this.clazz = clazz; 72 } 73 74 public void setJspFile(String jspFile) 75 { 76 this.jspFile = jspFile; 77 } 78 79 public String getJspFile() 80 { 81 return jspFile; 82 } 83 84 public Collection getInitParams() 85 { 86 return initParams.values(); 87 } 88 89 public void addInitParam(NameValuePair param) 90 { 91 initParams.put(param.getName(), param); 92 } 93 94 public String getLoadOnStartup() 95 { 96 return loadOnStartup; 97 } 98 99 public void setLoadOnStartup(String loadOnStartup) 100 { 101 this.loadOnStartup = loadOnStartup; 102 } 103 104 public RunAs getRunAs() 105 { 106 return runAs; 107 } 108 109 public void setRunAs(RunAs runAs) 110 { 111 this.runAs = runAs; 112 } 113 114 public Collection getSecurityRoleRefs() 115 { 116 return securityRoleRefs.values(); 117 } 118 119 public void addSecurityRoleRef(SecurityRoleRef ref) 120 { 121 securityRoleRefs.put(ref.getRoleName(), ref); 122 } 123 124 public Collection getRunAsPrincipals() 125 { 126 return runAsPrincipals; 127 } 128 129 public void setRunAsPrincipals(Collection runAsPrincipals) 130 { 131 this.runAsPrincipals = runAsPrincipals; 132 } 133 134 public void addRunAsPrincipal(String principal) 135 { 136 runAsPrincipals.add(principal); 137 } 138 139 public String toString() 140 { 141 StringBuffer sb = new StringBuffer (100); 142 sb.append('['); 143 sb.append("name=" + name); 144 sb.append(", class=" + clazz); 145 sb.append(", jspFile=" + jspFile); 146 sb.append(']'); 147 return sb.toString(); 148 } 149 } 150 | Popular Tags |