Search in sources :

Example 1 with MessageSecurityBindingNode

use of com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode 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 2 with MessageSecurityBindingNode

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

the class WebServiceEndpointRuntimeNode 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, WebServiceEndpoint endpoint) {
    Node endpointNode = super.writeDescriptor(parent, nodeName, endpoint);
    appendTextChild(endpointNode, WebServicesTagNames.PORT_COMPONENT_NAME, endpoint.getEndpointName());
    appendTextChild(endpointNode, WebServicesTagNames.ENDPOINT_ADDRESS_URI, endpoint.getEndpointAddressUri());
    // this info is described in web application itself.
    if (endpoint.implementedByEjbComponent() && endpoint.hasAuthMethod()) {
        Node loginConfigNode = appendChild(endpointNode, RuntimeTagNames.LOGIN_CONFIG);
        appendTextChild(loginConfigNode, RuntimeTagNames.AUTH_METHOD, endpoint.getAuthMethod());
        appendTextChild(loginConfigNode, RuntimeTagNames.REALM, endpoint.getRealm());
    }
    // message-security-binding
    MessageSecurityBindingDescriptor messageSecBindingDesc = endpoint.getMessageSecurityBinding();
    if (messageSecBindingDesc != null) {
        MessageSecurityBindingNode messageSecBindingNode = new MessageSecurityBindingNode();
        messageSecBindingNode.writeDescriptor(endpointNode, WebServicesTagNames.MESSAGE_SECURITY_BINDING, messageSecBindingDesc);
    }
    appendTextChild(endpointNode, WebServicesTagNames.TRANSPORT_GUARANTEE, endpoint.getTransportGuarantee());
    QName serviceName = endpoint.getServiceName();
    if (serviceName != null) {
        Node serviceQnameNode = appendChild(endpointNode, WebServicesTagNames.SERVICE_QNAME);
        appendTextChild(serviceQnameNode, WebServicesTagNames.NAMESPACE_URI, serviceName.getNamespaceURI());
        appendTextChild(serviceQnameNode, WebServicesTagNames.LOCAL_PART, serviceName.getLocalPart());
    }
    appendTextChild(endpointNode, WebServicesTagNames.TIE_CLASS, endpoint.getTieClassName());
    if (endpoint.implementedByWebComponent() && (endpoint.getServletImplClass() != null)) {
        appendTextChild(endpointNode, WebServicesTagNames.SERVLET_IMPL_CLASS, endpoint.getServletImplClass());
    }
    // debugging-enabled?
    appendTextChild(endpointNode, WebServicesTagNames.DEBUGGING_ENABLED, endpoint.getDebugging());
    // property*
    Iterator properties = endpoint.getProperties();
    if (properties != null) {
        RuntimeNameValuePairNode propNode = new RuntimeNameValuePairNode();
        while (properties.hasNext()) {
            NameValuePairDescriptor aProp = (NameValuePairDescriptor) properties.next();
            propNode.writeDescriptor(endpointNode, RuntimeTagNames.PROPERTY, aProp);
        }
    }
    return endpointNode;
}
Also used : MessageSecurityBindingDescriptor(com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor) QName(javax.xml.namespace.QName) MessageSecurityBindingNode(com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode) RuntimeNameValuePairNode(com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) Node(org.w3c.dom.Node) MessageSecurityBindingNode(com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode) Iterator(java.util.Iterator) RuntimeNameValuePairNode(com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode)

Aggregations

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