Search in sources :

Example 1 with ProtectionDescriptor

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

the class MessageSecurityNode 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, MessageSecurityDescriptor messageSecurityDesc) {
    Node messageSecurityNode = super.writeDescriptor(parent, nodeName, messageSecurityDesc);
    ArrayList messageDescs = messageSecurityDesc.getMessageDescriptors();
    if (!messageDescs.isEmpty()) {
        MessageNode messageNode = new MessageNode();
        for (Iterator messageIterator = messageDescs.iterator(); messageIterator.hasNext(); ) {
            MessageDescriptor messageDesc = (MessageDescriptor) messageIterator.next();
            messageNode.writeDescriptor(messageSecurityNode, WebServicesTagNames.MESSAGE, messageDesc);
        }
    }
    // request-protection
    ProtectionDescriptor requestProtectionDesc = messageSecurityDesc.getRequestProtectionDescriptor();
    if (requestProtectionDesc != null) {
        ProtectionNode requestProtectionNode = new ProtectionNode();
        requestProtectionNode.writeDescriptor(messageSecurityNode, WebServicesTagNames.REQUEST_PROTECTION, requestProtectionDesc);
    }
    // response-protection
    ProtectionDescriptor responseProtectionDesc = messageSecurityDesc.getResponseProtectionDescriptor();
    if (responseProtectionDesc != null) {
        ProtectionNode responseProtectionNode = new ProtectionNode();
        responseProtectionNode.writeDescriptor(messageSecurityNode, WebServicesTagNames.RESPONSE_PROTECTION, responseProtectionDesc);
    }
    return messageSecurityNode;
}
Also used : MessageDescriptor(com.sun.enterprise.deployment.runtime.common.MessageDescriptor) Node(org.w3c.dom.Node) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) ProtectionDescriptor(com.sun.enterprise.deployment.runtime.common.ProtectionDescriptor)

Aggregations

DeploymentDescriptorNode (com.sun.enterprise.deployment.node.DeploymentDescriptorNode)1 MessageDescriptor (com.sun.enterprise.deployment.runtime.common.MessageDescriptor)1 ProtectionDescriptor (com.sun.enterprise.deployment.runtime.common.ProtectionDescriptor)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 Node (org.w3c.dom.Node)1