1 25 26 package org.objectweb.jonas.web; 27 28 import java.net.URL ; 29 30 import org.objectweb.jonas.web.lib.PermissionManager; 31 32 33 47 public class War implements WarMBean { 48 49 52 private URL warURL = null; 53 54 57 private URL earURL = null; 58 59 62 private String hostName = null; 63 64 67 private String contextRoot = null; 68 69 72 private boolean java2DelegationModel = true; 73 74 77 private String xmlContent = null; 78 79 82 private String jonasXmlContent = null; 83 84 87 private String [] servletsName = null; 88 89 92 private PermissionManager permissionManager = null; 93 94 106 public War(final URL warURL, final URL earURL, 107 final String hostName, final String contextRoot, 108 final boolean java2DelegationModel, 109 final String xmlContent, 110 final String jonasXmlContent, 111 final String [] servletsName) { 112 this.warURL = warURL; 113 this.earURL = earURL; 114 this.hostName = hostName; 115 this.contextRoot = contextRoot; 116 this.java2DelegationModel = java2DelegationModel; 117 this.xmlContent = xmlContent; 118 this.jonasXmlContent = jonasXmlContent; 119 this.servletsName = servletsName; 120 } 121 122 126 public boolean isInEarCase() { 127 return earURL != null; 128 } 129 130 134 public URL getWarURL() { 135 return warURL; 136 } 137 138 142 public URL getEarURL() { 143 return earURL; 144 } 145 146 150 public String getHostName() { 151 return hostName; 152 } 153 154 158 public String getContextRoot() { 159 return contextRoot; 160 } 161 162 166 public boolean getJava2DelegationModel() { 167 return java2DelegationModel; 168 } 169 170 174 public String getXmlContent() { 175 return xmlContent; 176 } 177 178 182 public String getJOnASXmlContent() { 183 return jonasXmlContent; 184 } 185 186 190 public String [] getServletsName() { 191 return servletsName; 192 } 193 194 198 public void setPermissionManager(PermissionManager permissionManager) { 199 this.permissionManager = permissionManager; 200 } 201 202 206 public PermissionManager getPermissionManager() { 207 return permissionManager; 208 } 209 210 211 215 public String getContextId() { 216 return getWarURL().getFile() + contextRoot; 217 } 218 219 224 public boolean equals(War war) { 225 return war.getWarURL().equals(warURL) 226 && war.getEarURL().equals(earURL) 227 && war.getHostName().equals(hostName) 228 && war.getContextRoot().equals(contextRoot) 229 && (war.getJava2DelegationModel() == java2DelegationModel); 230 } 231 232 236 public int hashCode() { 237 return warURL.hashCode(); 238 } 239 240 244 public String toString() { 245 StringBuffer ret = new StringBuffer (); 246 ret.append("WAR=\n"); 247 ret.append("\twarURL=" + getWarURL() + "\n"); 248 ret.append("\tearURL=" + getEarURL() + "\n"); 249 ret.append("\thostName=" + getHostName() + "\n"); 250 ret.append("\tcontextRoot=" + getContextRoot()); 251 ret.append("\tjava2DelegationModel=" + getJava2DelegationModel()); 252 return ret.toString(); 253 } 254 } 255 256 | Popular Tags |