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;
}
Aggregations