1 23 24 29 30 package com.sun.enterprise.deployment.node.web; 31 32 import java.util.Map ; 33 import java.util.Enumeration ; 34 import org.w3c.dom.Node ; 35 36 import com.sun.enterprise.deployment.AuthorizationConstraintImpl; 37 import com.sun.enterprise.deployment.SecurityRoleDescriptor; 38 import com.sun.enterprise.deployment.node.DeploymentDescriptorNode; 39 import com.sun.enterprise.deployment.xml.WebTagNames; 40 41 47 public class AuthConstraintNode extends DeploymentDescriptorNode { 48 49 55 protected Map getDispatchTable() { 56 Map table = super.getDispatchTable(); 57 table.put(WebTagNames.ROLE_NAME, "addSecurityRole"); 58 return table; 59 } 60 61 69 public Node writeDescriptor(Node parent, String nodeName, AuthorizationConstraintImpl descriptor) { 70 Node myNode = appendChild(parent, nodeName); 71 72 writeLocalizedDescriptions(myNode, descriptor); 73 74 for (Enumeration roles = descriptor.getSecurityRoles();roles.hasMoreElements();) { 76 SecurityRoleDescriptor role = (SecurityRoleDescriptor) roles.nextElement(); 77 appendTextChild(myNode, WebTagNames.ROLE_NAME, role.getName()); 78 } 79 return myNode; 80 } 81 } 82 | Popular Tags |