au.gov.nehta.vendorlibrary.pcehr.clients.common.util
Class HandlerUtils

java.lang.Object
  extended by au.gov.nehta.vendorlibrary.pcehr.clients.common.util.HandlerUtils

public final class HandlerUtils
extends java.lang.Object


Method Summary
static java.lang.String extractElementContent(javax.xml.soap.SOAPBody body, java.lang.String namespace, java.lang.String localName)
          Extracts a given element's node value.
static org.w3c.dom.Element getFirstElementFromNodeList(org.w3c.dom.NodeList nodeList)
          Returns the first element from the provided nodeList
static java.lang.Boolean isOutgoing(javax.xml.ws.handler.soap.SOAPMessageContext context)
          Checks whether a SOAP message is incoming/outgoing.
static boolean isResponseType(javax.xml.ws.handler.soap.SOAPMessageContext context, java.lang.String namespace, java.lang.String localName)
          Determines whether a SOAP request/response is of a given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFirstElementFromNodeList

public static org.w3c.dom.Element getFirstElementFromNodeList(org.w3c.dom.NodeList nodeList)
Returns the first element from the provided nodeList

Parameters:
nodeList - containing the SOAP header/body element.
Returns:
the first element from the nodeList

isResponseType

public static boolean isResponseType(javax.xml.ws.handler.soap.SOAPMessageContext context,
                                     java.lang.String namespace,
                                     java.lang.String localName)
Determines whether a SOAP request/response is of a given type.

Parameters:
context - context the incoming / outgoing soap message context.
namespace - namespace of the response/request type.
localName - local name of the element.
Returns:
true if request/response is of the type defined by namespace/local name; otherwise false

isOutgoing

public static java.lang.Boolean isOutgoing(javax.xml.ws.handler.soap.SOAPMessageContext context)
Checks whether a SOAP message is incoming/outgoing.

Parameters:
context - context the incoming/outgoing soap message context.
Returns:
true if the message is outgoing; otherwise false.

extractElementContent

public static java.lang.String extractElementContent(javax.xml.soap.SOAPBody body,
                                                     java.lang.String namespace,
                                                     java.lang.String localName)
Extracts a given element's node value.

Parameters:
body - the SOAP body to retrieve the element node value from.
namespace - the XMLNamespaces namespace of the element.
localName - the local name of the element.
Returns:
Element's node value.