Search in sources :

Example 6 with MessageSecurityDescriptor

use of com.sun.enterprise.deployment.runtime.common.MessageSecurityDescriptor in project Payara by payara.

the class MessageSecurityBindingNode method writeDescriptor.

/**
 * 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
 */
public Node writeDescriptor(Node parent, String nodeName, MessageSecurityBindingDescriptor messageSecurityBindingDesc) {
    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;
}
Also used : Element(org.w3c.dom.Element) XMLElement(com.sun.enterprise.deployment.node.XMLElement) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) MessageSecurityDescriptor(com.sun.enterprise.deployment.runtime.common.MessageSecurityDescriptor)

Aggregations

MessageSecurityDescriptor (com.sun.enterprise.deployment.runtime.common.MessageSecurityDescriptor)6 ArrayList (java.util.ArrayList)6 WebServiceEndpoint (com.sun.enterprise.deployment.WebServiceEndpoint)2 MessageDescriptor (com.sun.enterprise.deployment.runtime.common.MessageDescriptor)2 XMLElement (com.sun.enterprise.deployment.node.XMLElement)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 MessagePolicy (javax.security.auth.message.MessagePolicy)1 Element (org.w3c.dom.Element)1