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