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

MessageSecurityBindingNode

public class MessageSecurityBindingNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode
This node handles message-security-binding element

Fields Summary
com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor
descriptor
Constructors Summary
public MessageSecurityBindingNode()


      
        registerElementHandler(new XMLElement(
            WebServicesTagNames.MESSAGE_SECURITY), MessageSecurityNode.class, 
            "addMessageSecurityDescriptor");
    
Methods Summary
public java.lang.ObjectgetDescriptor()

return
the descriptor instance to associate with this XMLNode

       if (descriptor == null) {
            descriptor = new MessageSecurityBindingDescriptor();
        }
        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_LAYER)) {
            descriptor.setAttributeValue(descriptor.AUTH_LAYER, value);
            return true;
        } else if (attributeName.getQName().equals(
            WebServicesTagNames.PROVIDER_ID)) {
            descriptor.setAttributeValue(descriptor.PROVIDER_ID, 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.MessageSecurityBindingDescriptor messageSecurityBindingDesc)
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 messageSecurityBindingNode = (Element)super.writeDescriptor(parent, nodeName, messageSecurityBindingDesc);

        // message-security
        ArrayList messageSecDescs = 
            messageSecurityBindingDesc.getMessageSecurityDescriptors();
        if (!messageSecDescs.isEmpty()) {
            MessageSecurityNode messageSecurityNode = 
                new MessageSecurityNode();
            for (Iterator messageSecIterator = messageSecDescs.iterator();
                messageSecIterator.hasNext();) {
                MessageSecurityDescriptor messageSecDesc =
                    (MessageSecurityDescriptor) messageSecIterator.next();
                messageSecurityNode.writeDescriptor(messageSecurityBindingNode, WebServicesTagNames.MESSAGE_SECURITY, messageSecDesc);
            }
        }

        // auth-layer
        if (messageSecurityBindingDesc.getAttributeValue(
            messageSecurityBindingDesc.AUTH_LAYER) != null) {
            setAttribute(messageSecurityBindingNode, WebServicesTagNames.AUTH_LAYER, messageSecurityBindingDesc.getAttributeValue(messageSecurityBindingDesc.AUTH_LAYER));
        }
    
        // provider-id
        if (messageSecurityBindingDesc.getAttributeValue(
            messageSecurityBindingDesc.PROVIDER_ID) != null) {
            setAttribute(messageSecurityBindingNode, WebServicesTagNames.PROVIDER_ID, messageSecurityBindingDesc.getAttributeValue(messageSecurityBindingDesc.PROVIDER_ID)); 
        }   
            
        return messageSecurityBindingNode;