/** * Return the name of the web application (as specified in server.xml) * * @return [$appID:]$moduleID */ public String getName() { String name = null; if (_wbd != null) { name = _wbd.getModuleID(); } return name; }
private String getRoleName(Principal callerPrincipal) { String roleName = null; WebBundleDescriptor wbd = (WebBundleDescriptor) getComponentEnvManager().getCurrentJndiNameEnvironment(); SecurityRoleMapperFactory securityRoleMapperFactory = getSecurityRoleMapperFactory(); SecurityRoleMapper securityRoleMapper = securityRoleMapperFactory.getRoleMapper(wbd.getModuleID()); Map<String, Subject> map = securityRoleMapper.getRoleToSubjectMapping(); for (Map.Entry<String, Subject> entry : map.entrySet()) { roleName = entry.getKey(); Subject subject = entry.getValue(); Set principalSet = subject.getPrincipals(); if (principalSet.contains(callerPrincipal)) { return roleName; } } return ""; }
private String getWebDir(String baseDir) { if (baseDir == null) { return null; } StringBuilder dir = new StringBuilder(baseDir); dir.append(File.separator); com.sun.enterprise.deployment.Application app = _wbd.getApplication(); if (app != null && !app.isVirtual()) { dir.append(FileUtils.makeFriendlyFilename( app.getRegistrationName())); dir.append(File.separator); dir.append(FileUtils.makeFriendlyFilename( _wbd.getModuleDescriptor().getArchiveUri())); } else { dir.append(FileUtils.makeLegalNoBlankFileName( _wbd.getModuleID())); } return dir.toString(); } }
this.moduleID = webDesc.getModuleID();
public WebSecurityManager createManager(WebBundleDescriptor wbd, boolean register, ServerContext context) { String ctxId = WebSecurityManager.getContextID(wbd); WebSecurityManager manager = null; if (register) { manager = getManager(ctxId, null,false); } if (manager == null || !register) { try { probeProvider.securityManagerCreationStartedEvent(wbd.getModuleID()); manager = new WebSecurityManager(wbd, context, this, register); probeProvider.securityManagerCreationEndedEvent(wbd.getModuleID()); if (register) { String appName = wbd.getApplication().getRegistrationName(); addManagerToApp(ctxId, null, appName, manager); probeProvider.securityManagerCreationEvent(ctxId); } } catch (javax.security.jacc.PolicyContextException e) { logger.log(Level.FINE, "[Web-Security] FATAL Exception. Unable to create WebSecurityManager: " + e.getMessage()); throw new RuntimeException(e); } } return manager; } }
public WebSecurityManager createManager(WebBundleDescriptor wbd, boolean register, ServerContext context) { String ctxId = WebSecurityManager.getContextID(wbd); WebSecurityManager manager = null; if (register) { manager = getManager(ctxId, null,false); } if (manager == null || !register) { try { probeProvider.securityManagerCreationStartedEvent(wbd.getModuleID()); manager = new WebSecurityManager(wbd, context, this, register); probeProvider.securityManagerCreationEndedEvent(wbd.getModuleID()); if (register) { String appName = wbd.getApplication().getRegistrationName(); addManagerToApp(ctxId, null, appName, manager); probeProvider.securityManagerCreationEvent(ctxId); } } catch (javax.security.jacc.PolicyContextException e) { logger.log(Level.FINE, "[Web-Security] FATAL Exception. Unable to create WebSecurityManager: " + e.getMessage()); throw new RuntimeException(e); } } return manager; } }
monitoringNodeName = wbd.getModuleID(); } else {