/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param node name * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, String nodeName, SecurityRoleMapping descriptor) { Node roleMapping = appendChild(parent, nodeName); //role-name appendTextChild(roleMapping, RuntimeTagNames.ROLE_NAME, descriptor.getRoleName()); //principal-name+ PrincipalNameNode principal = new PrincipalNameNode(); List<PrincipalNameDescriptor> principals = descriptor.getPrincipalNames(); for (int i = 0; i < principals.size(); i++) { principal.writeDescriptor( roleMapping, RuntimeTagNames.PRINCIPAL_NAME, principals.get(i)); } //group+ List<String> groups = descriptor.getGroupNames(); for (int i = 0; i < groups.size(); i++) { appendTextChild(roleMapping, RuntimeTagNames.GROUP_NAME, groups.get(i)); } return roleMapping; } }
/** * receives notiification of the value for a particular tag * * @param element the xml element * @param value it's associated value */ public void setElementValue(XMLElement element, String value) { SecurityRoleMapping srm = (SecurityRoleMapping) getDescriptor(); if (RuntimeTagNames.ROLE_NAME.equals(element.getQName())) { srm.setRoleName(value); } else if (RuntimeTagNames.GROUP_NAME.equals(element.getQName())) { srm.addGroupName(value); } else super.setElementValue(element, value); }
public SecurityRoleMappingNode() { registerElementHandler( new XMLElement(RuntimeTagNames.PRINCIPAL_NAME), PrincipalNameNode.class, "addPrincipalName"); }
@Override public Node writeDescriptor(Node parent, EjbBundleDescriptorImpl bundleDescriptor) { Node ejbs = super.writeDescriptor(parent, bundleDescriptor); // security-role-mapping* List<SecurityRoleMapping> roleMappings = bundleDescriptor.getSecurityRoleMappings(); for (int i = 0; i < roleMappings.size(); i++) { SecurityRoleMappingNode srmn = new SecurityRoleMappingNode(); srmn.writeDescriptor(ejbs, RuntimeTagNames.SECURITY_ROLE_MAPPING, roleMappings.get(i)); } // entreprise-beans EnterpriseBeansRuntimeNode ejbsNode = new EnterpriseBeansRuntimeNode(); ejbsNode.writeDescriptor(ejbs, RuntimeTagNames.EJBS, bundleDescriptor); // compatibility appendTextChild(ejbs, RuntimeTagNames.COMPATIBILITY, bundleDescriptor.getCompatibility()); //disable-nonportable-jndi-names Boolean djndi = bundleDescriptor.getDisableNonportableJndiNames(); if (djndi != null) { appendTextChild(ejbs, RuntimeTagNames.DISABLE_NONPORTABLE_JNDI_NAMES, String.valueOf(djndi)); } // keep-state appendTextChild(ejbs, RuntimeTagNames.KEEP_STATE, String.valueOf(bundleDescriptor.getKeepState())); return ejbs; } }
SecurityRoleMappingNode srmn = new SecurityRoleMappingNode(); srmn.writeDescriptor(ejbs, RuntimeTagNames.SECURITY_ROLE_MAPPING, roleMappings.get(i));
SecurityRoleMappingNode srmn = new SecurityRoleMappingNode(); srmn.writeDescriptor(appNode, RuntimeTagNames.SECURITY_ROLE_MAPPING, roleMappings.get(i));
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param node name * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, String nodeName, SecurityRoleMapping descriptor) { Node roleMapping = appendChild(parent, nodeName); //role-name appendTextChild(roleMapping, RuntimeTagNames.ROLE_NAME, descriptor.getRoleName()); //principal-name+ PrincipalNameNode principal = new PrincipalNameNode(); List<PrincipalNameDescriptor> principals = descriptor.getPrincipalNames(); for (int i = 0; i < principals.size(); i++) { principal.writeDescriptor( roleMapping, RuntimeTagNames.PRINCIPAL_NAME, principals.get(i)); } //group+ List<String> groups = descriptor.getGroupNames(); for (int i = 0; i < groups.size(); i++) { appendTextChild(roleMapping, RuntimeTagNames.GROUP_NAME, groups.get(i)); } return roleMapping; } }
public SecurityRoleMappingNode() { registerElementHandler( new XMLElement(RuntimeTagNames.PRINCIPAL_NAME), PrincipalNameNode.class, "addPrincipalName"); }
/** * receives notiification of the value for a particular tag * * @param element the xml element * @param value it's associated value */ public void setElementValue(XMLElement element, String value) { SecurityRoleMapping srm = (SecurityRoleMapping) getDescriptor(); if (RuntimeTagNames.ROLE_NAME.equals(element.getQName())) { srm.setRoleName(value); } else if (RuntimeTagNames.GROUP_NAME.equals(element.getQName())) { srm.addGroupName(value); } else super.setElementValue(element, value); }
SecurityRoleMappingNode srmn = new SecurityRoleMappingNode(); srmn.writeDescriptor(appNode, RuntimeTagNames.SECURITY_ROLE_MAPPING, roleMappings.get(i));
SecurityRoleMappingNode srmn = new SecurityRoleMappingNode(); for (int i=0;i<roleMappings.length;i++) { srmn.writeDescriptor(web, RuntimeTagNames.SECURITY_ROLE_MAPPING, roleMappings[i]);