FileDocCategorySizeDatePackage
ProtectionNode.javaAPI DocGlassfish v2 API4581Fri May 04 22:31:46 BST 2007com.sun.enterprise.deployment.node.runtime.common

ProtectionNode

public class ProtectionNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode
This node handles request-protection and response-protection elements

Fields Summary
com.sun.enterprise.deployment.runtime.common.ProtectionDescriptor
descriptor
Constructors Summary
Methods Summary
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode

    
                     
       
       if (descriptor == null) {
            descriptor = new ProtectionDescriptor();
        }
        return descriptor;
    
protected booleansetAttributeValue(com.sun.enterprise.deployment.node.XMLElement elementName, com.sun.enterprise.deployment.node.XMLElement attributeName, java.lang.String value)
parsed an attribute of an element

param
the element name
param
the attribute name
param
the attribute value
return
true if the attribute was processed

        if (attributeName.getQName().equals(WebServicesTagNames.AUTH_SOURCE)) {
            descriptor.setAttributeValue(descriptor.AUTH_SOURCE, value);
            return true;
        } else if (attributeName.getQName().equals(
            WebServicesTagNames.AUTH_RECIPIENT)) {
            descriptor.setAttributeValue(descriptor.AUTH_RECIPIENT, value);
            return true;
        }
        return false;
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.common.ProtectionDescriptor protectionDesc)
write the descriptor class to a DOM tree and return it

param
parent node for the DOM tree
param
node name for
param
the descriptor to write
return
the DOM tree top node

    
        Element protectionNode = 
            (Element)super.writeDescriptor(parent, nodeName, protectionDesc);

        // auth-source
        if (protectionDesc.getAttributeValue(protectionDesc.AUTH_SOURCE) 
            != null) {
            setAttribute(protectionNode, WebServicesTagNames.AUTH_SOURCE, protectionDesc.getAttributeValue(protectionDesc.AUTH_SOURCE));
        }

        // auth-recipient
        if (protectionDesc.getAttributeValue(protectionDesc.AUTH_RECIPIENT) 
           != null) {
            setAttribute(protectionNode, WebServicesTagNames.AUTH_RECIPIENT, protectionDesc.getAttributeValue(protectionDesc.AUTH_RECIPIENT));
        }

        return protectionNode;