/** * Validate EJB references. */ public void validateEJBRefs(EjbRefImpl eref) { // try { EARFile earFile = warFile.getEARFile(); EnterpriseBean eb = null; if (earFile != null) eb = earFile.getEnterpiseBeanFromRef(eref, warFile.getURI()); if (!(eb == null)) { List ejbRefs = eb.getEjbRefs(); int numRefs = ejbRefs.size(); Set refSet = new HashSet(numRefs); for (int refNo = 0; refNo < numRefs; refNo++) { String nextName = ((EjbRefImpl) (ejbRefs.get(refNo))).getName(); String[] parms = new String[1]; parms[0] = eb.getName(); if (!(refSet.add(nextName))) { addWarning(WAR_CATEGORY, ERROR_EAR_DUPLICATE_ROLES, parms, ejbRefs.get(refNo)); } } } // } catch (UncontainedModuleFileException ue) { // String[] parms = new String[1]; // parms[0] = warFile.getName(); // addError(EREF_CATEGORY, ERROR_EAR_UNCONTAINED_MODULE_FILE_EXCEPTION, parms); // } }
/** * validateSecurity(WebApp) - validate security constraints, roles, and security role refs - * details tbd */ public void validateSecurityAndServlets() { EList webRoles = webDD.getSecurityRoles(); // Validate security roles Hashtable secRoles = getAndValidateSecurityRoles(webRoles); // Validate Servlets/JSPs and their role ref. validateServlets(webDD.getServlets(), secRoles); validateSecurityConstraints(webDD.getConstraints(), secRoles); // try { if (!(webRoles.isEmpty())) { EARFile module = warFile.getEARFile(); if (module != null) { EList earRoleList = module.getDeploymentDescriptor().getSecurityRoles(); validateWEBRolesWithEARRoles(earRoleList, webRoles); } } // } catch (UncontainedModuleFileException ue) { // String[] parms = new String[1]; // parms[0] = warFile.getName(); // addError(EREF_CATEGORY, ERROR_EAR_UNCONTAINED_MODULE_FILE_EXCEPTION, parms); // } }