1 23 24 package com.sun.enterprise.deployment.node.runtime.common; 25 26 import org.w3c.dom.Node ; 27 import org.w3c.dom.Element ; 28 29 import com.sun.enterprise.deployment.node.XMLElement; 30 import com.sun.enterprise.deployment.node.DeploymentDescriptorNode; 31 import com.sun.enterprise.deployment.xml.WebServicesTagNames; 32 import com.sun.enterprise.deployment.runtime.common.ProtectionDescriptor; 33 34 38 public class ProtectionNode extends DeploymentDescriptorNode { 39 40 ProtectionDescriptor descriptor = null; 41 42 45 public Object getDescriptor() { 46 if (descriptor == null) { 47 descriptor = new ProtectionDescriptor(); 48 } 49 return descriptor; 50 } 51 52 53 61 protected boolean setAttributeValue(XMLElement elementName, 62 XMLElement attributeName, String value) { 63 if (attributeName.getQName().equals(WebServicesTagNames.AUTH_SOURCE)) { 64 descriptor.setAttributeValue(descriptor.AUTH_SOURCE, value); 65 return true; 66 } else if (attributeName.getQName().equals( 67 WebServicesTagNames.AUTH_RECIPIENT)) { 68 descriptor.setAttributeValue(descriptor.AUTH_RECIPIENT, value); 69 return true; 70 } 71 return false; 72 } 73 74 82 public Node writeDescriptor(Node parent, String nodeName, 83 ProtectionDescriptor protectionDesc) { 84 Element protectionNode = 85 (Element )super.writeDescriptor(parent, nodeName, protectionDesc); 86 87 if (protectionDesc.getAttributeValue(protectionDesc.AUTH_SOURCE) 89 != null) { 90 setAttribute(protectionNode, WebServicesTagNames.AUTH_SOURCE, protectionDesc.getAttributeValue(protectionDesc.AUTH_SOURCE)); 91 } 92 93 if (protectionDesc.getAttributeValue(protectionDesc.AUTH_RECIPIENT) 95 != null) { 96 setAttribute(protectionNode, WebServicesTagNames.AUTH_RECIPIENT, protectionDesc.getAttributeValue(protectionDesc.AUTH_RECIPIENT)); 97 } 98 99 return protectionNode; 100 } 101 } 102 | Popular Tags |