本文整理了Java中org.eclipse.jst.j2ee.webapplication.WebApp.getSecurityRoles()
方法的一些代码示例,展示了WebApp.getSecurityRoles()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebApp.getSecurityRoles()
方法的具体详情如下:
包路径:org.eclipse.jst.j2ee.webapplication.WebApp
类名称:WebApp
方法名:getSecurityRoles
暂无
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.ui
public Collection getChildren(Object object) {
List result = new ArrayList();
Object obj = weakWebApp.get();
if (null != obj) {
WebApp webApp = (WebApp) obj;
if (!webApp.getSecurityRoles().isEmpty())
result.addAll(webApp.getSecurityRoles());
if (!webApp.getConstraints().isEmpty())
result.addAll(webApp.getConstraints());
}
return result;
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core
/**
* @see com.ibm.etools.commonarchive.EARFile
*/
public void rollUpRoles(Module aModule) {
List securityRoles = null;
try {
if (aModule.isWebModule())
securityRoles = getDeploymentDescriptor((WebModule) aModule).getSecurityRoles();
else if (aModule.isEjbModule())
securityRoles = getAssemblyDescriptorAddIfNecessary(getDeploymentDescriptor((EjbModule) aModule)).getSecurityRoles();
} catch (Exception e) {
throw new DeploymentDescriptorLoadException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dd_in_ear_load_EXC_, (new Object[]{aModule.getUri(), getURI()})), e); // = "Exception occurred loading deployment descriptor for module "{0}" in ear file "{1}""
}
if (securityRoles == null)
return;
for (int i = 0; i < securityRoles.size(); i++) {
addCopyIfNotExists((SecurityRole) securityRoles.get(i));
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core
/**
* 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);
// }
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core
/**
* @see EARFile
*/
public void pushDownRole(SecurityRole role, Module aModule) {
try {
if (aModule.isWebModule()) {
WebApp dd = getDeploymentDescriptor((WebModule) aModule);
if (dd.getSecurityRoleNamed(role.getRoleName()) == null)
dd.getSecurityRoles().add(EtoolsCopyUtility.createCopy(role));
} else if (aModule.isEjbModule()) {
AssemblyDescriptor assembly = getAssemblyDescriptorAddIfNecessary(getDeploymentDescriptor((EjbModule) aModule));
if (assembly.getSecurityRoleNamed(role.getRoleName()) == null)
assembly.getSecurityRoles().add(EtoolsCopyUtility.createCopy(role));
}
} catch (Exception e) {
throw new DeploymentDescriptorLoadException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dd_in_ear_load_EXC_, (new Object[]{aModule.getUri(), getURI()})), e); // = "Exception occurred loading deployment descriptor for module "{0}" in ear file "{1}""
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core
/**
* @see com.ibm.etools.commonarchive.EARFile
*/
public EList getRolesFromModule(Module aModule) {
EList roleList = new org.eclipse.emf.common.util.BasicEList();
try {
if (aModule.isWebModule())
roleList = getDeploymentDescriptor((WebModule) aModule).getSecurityRoles();
else if (aModule.isEjbModule())
roleList = getAssemblyDescriptorAddIfNecessary(getDeploymentDescriptor((EjbModule) aModule)).getSecurityRoles();
} catch (Exception e) {
throw new DeploymentDescriptorLoadException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dd_in_ear_load_EXC_, (new Object[]{aModule.getUri(), getURI()})), e); // = "Exception occurred loading deployment descriptor for module "{0}" in ear file "{1}""
}
return roleList;
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core
/**
* @see com.ibm.etools.commonarchive.EARFile
*/
public SecurityRole addCopy(SecurityRole aRole, Module aModule) throws DuplicateObjectException {
EObject dd = null;
try {
dd = getDeploymentDescriptor(aModule);
} catch (Exception e) {
throw new DeploymentDescriptorLoadException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dd_in_ear_load_EXC_, (new Object[]{aModule.getUri(), getURI()})), e); // = "Exception occurred loading deployment descriptor for module "{0}" in ear file "{1}""
}
String roleName = aRole.getRoleName();
SecurityRole copy = (SecurityRole) EtoolsCopyUtility.createCopy(aRole);
if (aModule.isEjbModule()) {
EJBJar ejbJar = (EJBJar) dd;
if (ejbJar.containsSecurityRole(roleName))
throw new DuplicateObjectException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dup_sec_role_module_EXC_, (new Object[]{aModule.getUri(), roleName})), ejbJar.getAssemblyDescriptor().getSecurityRoleNamed(roleName)); // = "Deployment descriptor for {0} already contains a security role named {1}"
getAssemblyDescriptorAddIfNecessary(ejbJar).getSecurityRoles().add(copy);
} else if (aModule.isWebModule()) {
WebApp webApp = (WebApp) dd;
if (webApp.containsSecurityRole(roleName))
throw new DuplicateObjectException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.dup_sec_role_module_EXC_, (new Object[]{aModule.getUri(), roleName})), webApp.getSecurityRoleNamed(roleName));// = "Deployment descriptor for {0} already contains a security role named {1}"
webApp.getSecurityRoles().add(copy);
}
addCopyIfNotExists(aRole);
return copy;
}
内容来源于网络,如有侵权,请联系作者删除!