/** * Reset the display name of this application. * * @param name the display name of the application. */ public void setName(String name) { name = name.replace('/', '-'); name = name.replace('\\', '-'); // for deploying from NT to solaris & vice versa. This will // need to be cleaned when we clean up the backend for registering apps super.setName(name); if (this.getRoleMapper() != null) { this.getRoleMapper().setName(name); } }
/** * Reset the display name of this application. * * @param name the display name of the application. */ public void setName(String name) { name = name.replace('/', '-'); name = name.replace('\\', '-'); // for deploying from NT to solaris & vice versa. This will // need to be cleaned when we clean up the backend for registering apps super.setName(name); if (this.getRoleMapper() != null) { this.getRoleMapper().setName(name); } }
/** * A formatted String representing my state. */ public void print(StringBuffer toStringBuffer) { toStringBuffer.append("Application"); toStringBuffer.append("\n"); super.print(toStringBuffer); toStringBuffer.append("\n smallIcon ").append(super.getSmallIconUri()); for (ModuleDescriptor<BundleDescriptor> aModule : getModules()) { toStringBuffer.append("\n Module : "); aModule.print(toStringBuffer); } toStringBuffer.append("\n Bundles: \n"); printDescriptorSet(this.getBundleDescriptors(), toStringBuffer); toStringBuffer.append("\n roles ").append(getRoles()); toStringBuffer.append("\n RoleMapper ").append(this.getRoleMapper()); toStringBuffer.append("\n Realm ").append(realm); }
/** * A formatted String representing my state. */ public void print(StringBuffer toStringBuffer) { toStringBuffer.append("Application"); toStringBuffer.append("\n"); super.print(toStringBuffer); toStringBuffer.append("\n smallIcon ").append(super.getSmallIconUri()); for (ModuleDescriptor<BundleDescriptor> aModule : getModules()) { toStringBuffer.append("\n Module : "); aModule.print(toStringBuffer); } toStringBuffer.append("\n EjbBundles: \n"); if (this.getEjbBundleDescriptors() != null) printDescriptorSet(this.getEjbBundleDescriptors(), toStringBuffer); toStringBuffer.append("\n WebBundleDescriptors "); if (this.getWebBundleDescriptors() != null) printDescriptorSet(this.getWebBundleDescriptors(), toStringBuffer); toStringBuffer.append("\n applicationClientDescriptors "); if (this.getApplicationClientDescriptors() != null) printDescriptorSet(this.getApplicationClientDescriptors(), toStringBuffer); toStringBuffer.append("\n roles ").append(getRoles()); toStringBuffer.append("\n RoleMapper ").append(this.getRoleMapper()); toStringBuffer.append("\n Realm ").append(realm); }
(runAs.getPrincipal() == null || runAs.getPrincipal().length() == 0) && application != null && application.getRoleMapper() != null) { final Subject fs = (Subject)application.getRoleMapper().getRoleToSubjectMapping().get(roleName); if (fs != null) { principalName = (String)AccessController.doPrivileged(new PrivilegedAction() {
(runAs.getPrincipal() == null || runAs.getPrincipal().length() == 0) && application != null && application.getRoleMapper() != null) { final Subject fs = (Subject)application.getRoleMapper().getRoleToSubjectMapping().get(roleName); if (fs != null) { principalName = (String)AccessController.doPrivileged(new PrivilegedAction() {
/** * Sets the registration name for this application. This name is used * while deploying the application. The deployment process gurantees * that this name is unique. * * @param appId the registration name used for this application */ public void setRegistrationName(String appId) { // at his point we need to swap our RoleMapper, if we have one... SecurityRoleMapper roleMapper = null; try { roleMapper = getRoleMapper(); } catch (IllegalArgumentException ignore) { } if (roleMapper != null) { if (securityRoleMapperFactory == null) { throw new IllegalArgumentException(localStrings.getLocalString( "enterprise.deployment.norolemapperfactorydefine", "This application has no role mapper factory defined")); } securityRoleMapperFactory.removeRoleMapper(getName()); roleMapper.setName(appId); securityRoleMapperFactory.setRoleMapper(appId, roleMapper); } this.registrationName = appId; }
@Override public void addDescriptor(Object newDescriptor) { if (newDescriptor instanceof SecurityRoleMapping) { SecurityRoleMapping roleMap = (SecurityRoleMapping)newDescriptor; descriptor.addSecurityRoleMapping(roleMap); Application app = descriptor.getApplication(); if (app!=null) { Role role = new Role(roleMap.getRoleName()); SecurityRoleMapper rm = app.getRoleMapper(); if (rm != null) { List<PrincipalNameDescriptor> principals = roleMap.getPrincipalNames(); for (int i = 0; i < principals.size(); i++) { rm.assignRole(principals.get(i).getPrincipal(), role, descriptor); } List<String> groups = roleMap.getGroupNames(); for (int i = 0; i < groups.size(); i++) { rm.assignRole(new Group(groups.get(i)), role, descriptor); } } } } }
return; SecurityRoleMapper rmap = app.getRoleMapper(); if (rmap == null) { logger.finest("- No role mappings present.");
return; SecurityRoleMapper rmap = app.getRoleMapper(); if (rmap == null) { logger.finest("- No role mappings present.");
/** * Adds a new DOL descriptor instance to the descriptor instance associated with * this XMLNode * * @param newDescriptor the new descriptor */ public void addDescriptor(Object newDescriptor) { if (newDescriptor instanceof SecurityRoleMapping) { SecurityRoleMapping roleMap = (SecurityRoleMapping) newDescriptor; if (descriptor!=null && !descriptor.isVirtual()) { descriptor.addSecurityRoleMapping(roleMap); Role role = new Role(roleMap.getRoleName()); SecurityRoleMapper rm = descriptor.getRoleMapper(); if (rm != null) { List<PrincipalNameDescriptor> principals = roleMap.getPrincipalNames(); for (int i = 0; i < principals.size(); i++) { rm.assignRole(principals.get(i).getPrincipal(), role, descriptor); } List<String> groups = roleMap.getGroupNames(); for (int i = 0; i < groups.size(); i++) { rm.assignRole(new Group(groups.get(i)), role, descriptor); } } } } }
/** * Adds a new DOL descriptor instance to the descriptor instance associated with * this XMLNode * * @param mewDescriptor the new descriptor */ public void addDescriptor(Object newDescriptor) { if (newDescriptor instanceof SecurityRoleMapping) { SecurityRoleMapping roleMap = (SecurityRoleMapping) newDescriptor; descriptor.addSecurityRoleMapping(roleMap); if (descriptor!=null && !descriptor.isVirtual()) { Role role = new Role(roleMap.getRoleName()); SecurityRoleMapper rm = descriptor.getRoleMapper(); if (rm != null) { List<PrincipalNameDescriptor> principals = roleMap.getPrincipalNames(); for (int i = 0; i < principals.size(); i++) { rm.assignRole(principals.get(i).getPrincipal(), role, descriptor); } List<String> groups = roleMap.getGroupNames(); for (int i = 0; i < groups.size(); i++) { rm.assignRole(new Group(groups.get(i)), role, descriptor); } } } } }
/** * Adds a new DOL descriptor instance to the descriptor instance associated with * this XMLNode * * @param descriptor the new descriptor */ public void addDescriptor(Object newDescriptor) { if (newDescriptor instanceof SecurityRoleMapping) { SecurityRoleMapping roleMap = (SecurityRoleMapping)newDescriptor; descriptor.addSecurityRoleMapping(roleMap); Application app = descriptor.getApplication(); if (app!=null) { Role role = new Role(roleMap.getRoleName()); SecurityRoleMapper rm = app.getRoleMapper(); if (rm != null) { List<PrincipalNameDescriptor> principals = roleMap.getPrincipalNames(); for (int i = 0; i < principals.size(); i++) { rm.assignRole(principals.get(i).getPrincipal(), role, descriptor); } List<String> groups = roleMap.getGroupNames(); for (int i = 0; i < groups.size(); i++) { rm.assignRole(new Group(groups.get(i)), role, descriptor); } } } } }
/** * Sets the registration name for this application. This name is used * while deploying the application. The deployment process gurantees * that this name is unique. * * @param appId the registration name used for this application */ public void setRegistrationName(String appId) { // at his point we need to swap our RoleMapper, if we have one... SecurityRoleMapper roleMapper = null; try { roleMapper = getRoleMapper(); } catch (IllegalArgumentException ignore) { } if (roleMapper != null) { SecurityRoleMapperFactory factory = habitat.getComponent(SecurityRoleMapperFactory.class); if (factory == null) { throw new IllegalArgumentException(localStrings.getLocalString( "enterprise.deployment.norolemapperfactorydefine", "This application has no role mapper factory defined")); } factory.removeRoleMapper(getName()); roleMapper.setName(appId); factory.setRoleMapper(appId, roleMapper); } this.registrationName = appId; }
descriptor.addWLRoleAssignments(roleMap); Role role = new Role(roleMap.getRoleName()); SecurityRoleMapper rm = descriptor.getRoleMapper(); if (rm != null) { if(roleMap.isExternallyDefined()){
SecurityRoleMapper rm = null; if (app != null) { rm = app.getRoleMapper(); } else { rm = getRoleMapper();
if (app!=null) { Role role = new Role(srm.getRoleName()); SecurityRoleMapper rm = app.getRoleMapper(); if (rm != null) { List<PrincipalNameDescriptor> principals = srm.getPrincipalNames();