Search in sources :

Example 1 with NameValuePairNode

use of com.sun.enterprise.deployment.node.NameValuePairNode in project Payara by payara.

the class ServiceRefNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent node for the DOM tree
 * @param node name for the descriptor
 * @param the descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, ServiceReferenceDescriptor serviceRef) {
    Node serviceRefNode = super.writeDescriptor(parent, nodeName, serviceRef);
    appendTextChild(serviceRefNode, WebServicesTagNames.SERVICE_REF_NAME, serviceRef.getName());
    ServiceRefPortInfoRuntimeNode portInfoRuntimeNode = new ServiceRefPortInfoRuntimeNode();
    Set<ServiceRefPortInfo> portsInfo = serviceRef.getPortsInfo();
    for (ServiceRefPortInfo next : portsInfo) {
        portInfoRuntimeNode.writeDescriptor(serviceRefNode, WebServicesTagNames.PORT_INFO, next);
    }
    NameValuePairNode nameValueNode = new NameValuePairNode();
    for (NameValuePairDescriptor next : serviceRef.getCallProperties()) {
        nameValueNode.writeDescriptor(serviceRefNode, WebServicesTagNames.CALL_PROPERTY, next);
    }
    if (serviceRef.hasWsdlOverride()) {
        URL wsdlOverride = serviceRef.getWsdlOverride();
        appendTextChild(serviceRefNode, WebServicesTagNames.WSDL_OVERRIDE, wsdlOverride.toExternalForm());
    }
    appendTextChild(serviceRefNode, WebServicesTagNames.SERVICE_IMPL_CLASS, serviceRef.getServiceImplClassName());
    if (serviceRef.hasServiceName()) {
        Node serviceNameNode = appendChild(serviceRefNode, WebServicesTagNames.SERVICE_QNAME);
        QName serviceName = serviceRef.getServiceName();
        appendTextChild(serviceNameNode, WebServicesTagNames.NAMESPACE_URI, serviceName.getNamespaceURI());
        appendTextChild(serviceNameNode, WebServicesTagNames.LOCAL_PART, serviceName.getLocalPart());
    }
    return serviceRefNode;
}
Also used : NameValuePairNode(com.sun.enterprise.deployment.node.NameValuePairNode) QName(javax.xml.namespace.QName) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) Node(org.w3c.dom.Node) NameValuePairNode(com.sun.enterprise.deployment.node.NameValuePairNode) URL(java.net.URL)

Example 2 with NameValuePairNode

use of com.sun.enterprise.deployment.node.NameValuePairNode in project Payara by payara.

the class ServiceRefPortInfoRuntimeNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent node for the DOM tree
 * @param node name for the descriptor
 * @param the descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, ServiceRefPortInfo desc) {
    Node serviceRefPortInfoRuntimeNode = super.writeDescriptor(parent, nodeName, desc);
    appendTextChild(serviceRefPortInfoRuntimeNode, WebServicesTagNames.SERVICE_ENDPOINT_INTERFACE, desc.getServiceEndpointInterface());
    QName port = desc.getWsdlPort();
    if (port != null) {
        Node wsdlPortNode = appendChild(serviceRefPortInfoRuntimeNode, WebServicesTagNames.WSDL_PORT);
        appendTextChild(wsdlPortNode, WebServicesTagNames.NAMESPACE_URI, port.getNamespaceURI());
        appendTextChild(wsdlPortNode, WebServicesTagNames.LOCAL_PART, port.getLocalPart());
    }
    // stub-property*
    NameValuePairNode nameValueNode = new NameValuePairNode();
    Set stubProperties = desc.getStubProperties();
    for (Iterator iter = stubProperties.iterator(); iter.hasNext(); ) {
        NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
        nameValueNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.STUB_PROPERTY, next);
    }
    // call-property*
    for (Iterator iter = desc.getCallProperties().iterator(); iter.hasNext(); ) {
        NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
        nameValueNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.CALL_PROPERTY, next);
    }
    // message-security-binding
    MessageSecurityBindingDescriptor messageSecBindingDesc = desc.getMessageSecurityBinding();
    if (messageSecBindingDesc != null) {
        MessageSecurityBindingNode messageSecBindingNode = new MessageSecurityBindingNode();
        messageSecBindingNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.MESSAGE_SECURITY_BINDING, messageSecBindingDesc);
    }
    return serviceRefPortInfoRuntimeNode;
}
Also used : Set(java.util.Set) MessageSecurityBindingDescriptor(com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor) NameValuePairNode(com.sun.enterprise.deployment.node.NameValuePairNode) NameValuePairDescriptor(com.sun.enterprise.deployment.NameValuePairDescriptor) QName(javax.xml.namespace.QName) MessageSecurityBindingNode(com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) Node(org.w3c.dom.Node) NameValuePairNode(com.sun.enterprise.deployment.node.NameValuePairNode) Iterator(java.util.Iterator) MessageSecurityBindingNode(com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode)

Example 3 with NameValuePairNode

use of com.sun.enterprise.deployment.node.NameValuePairNode in project Payara by payara.

the class WLServiceRefPortInfoRuntimeNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent   node for the DOM tree
 * @param nodeName node name for the descriptor
 * @param desc     the descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, ServiceRefPortInfo desc) {
    Node serviceRefPortInfoRuntimeNode = super.writeDescriptor(parent, nodeName, desc);
    QName port = desc.getWsdlPort();
    if (port != null) {
        appendTextChild(serviceRefPortInfoRuntimeNode, WLWebServicesTagNames.SERVICE_REFERENCE_PORT_NAME, port.getLocalPart());
        // stub-property*
        NameValuePairNode nameValueNode = new NameValuePairNode();
        Set stubProperties = desc.getStubProperties();
        for (Iterator iter = stubProperties.iterator(); iter.hasNext(); ) {
            NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
            nameValueNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.STUB_PROPERTY, next);
        }
        // call-property*
        for (Iterator iter = desc.getCallProperties().iterator(); iter.hasNext(); ) {
            NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
            nameValueNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.CALL_PROPERTY, next);
        }
    }
    return serviceRefPortInfoRuntimeNode;
}
Also used : Set(java.util.Set) NameValuePairNode(com.sun.enterprise.deployment.node.NameValuePairNode) NameValuePairDescriptor(com.sun.enterprise.deployment.NameValuePairDescriptor) QName(javax.xml.namespace.QName) Node(org.w3c.dom.Node) NameValuePairNode(com.sun.enterprise.deployment.node.NameValuePairNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) Iterator(java.util.Iterator)

Example 4 with NameValuePairNode

use of com.sun.enterprise.deployment.node.NameValuePairNode in project Payara by payara.

the class WLServiceRefNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent     node for the DOM tree
 * @param nodeName   for the descriptor
 * @param serviceRef the descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, ServiceReferenceDescriptor serviceRef) {
    Node serviceRefNode = super.writeDescriptor(parent, nodeName, serviceRef);
    appendTextChild(serviceRefNode, WebServicesTagNames.SERVICE_REF_NAME, serviceRef.getName());
    if (serviceRef.hasWsdlOverride()) {
        URL wsdlOverride = serviceRef.getWsdlOverride();
        appendTextChild(serviceRefNode, WLWebServicesTagNames.SERVICE_REFERENCE_WSDL_URL, wsdlOverride.toExternalForm());
    }
    NameValuePairNode nameValueNode = new NameValuePairNode();
    for (Iterator iter = serviceRef.getCallProperties().iterator(); iter.hasNext(); ) {
        NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
        nameValueNode.writeDescriptor(serviceRefNode, WebServicesTagNames.CALL_PROPERTY, next);
    }
    WLServiceRefPortInfoRuntimeNode portInfoRuntimeNode = new WLServiceRefPortInfoRuntimeNode();
    Set portsInfo = serviceRef.getPortsInfo();
    for (Iterator iter = portsInfo.iterator(); iter.hasNext(); ) {
        ServiceRefPortInfo next = (ServiceRefPortInfo) iter.next();
        portInfoRuntimeNode.writeDescriptor(serviceRefNode, WLWebServicesTagNames.SERVICE_REFERENCE_PORT_NAME, next);
    }
    return serviceRefNode;
}
Also used : Set(java.util.Set) NameValuePairNode(com.sun.enterprise.deployment.node.NameValuePairNode) Node(org.w3c.dom.Node) NameValuePairNode(com.sun.enterprise.deployment.node.NameValuePairNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) Iterator(java.util.Iterator) URL(java.net.URL)

Aggregations

DeploymentDescriptorNode (com.sun.enterprise.deployment.node.DeploymentDescriptorNode)4 NameValuePairNode (com.sun.enterprise.deployment.node.NameValuePairNode)4 Node (org.w3c.dom.Node)4 Iterator (java.util.Iterator)3 Set (java.util.Set)3 QName (javax.xml.namespace.QName)3 NameValuePairDescriptor (com.sun.enterprise.deployment.NameValuePairDescriptor)2 URL (java.net.URL)2 MessageSecurityBindingNode (com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode)1 MessageSecurityBindingDescriptor (com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor)1