SecurityRoleMappingNodepublic class SecurityRoleMappingNode extends com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode This node handles all the role mapping information |
Constructors Summary |
---|
public SecurityRoleMappingNode()
registerElementHandler(
new XMLElement(RuntimeTagNames.PRINCIPAL_NAME),
PrincipalNameNode.class, "addPrincipalName");
|
Methods Summary |
---|
public void | setElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)receives notiification of the value for a particular tag
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 org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.common.SecurityRoleMapping descriptor)write the descriptor class to a DOM tree and return it
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;
|
|