Class Utils


  • public class Utils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Utils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getNodeProperty​(org.w3c.dom.Node node, java.lang.String propertyName)
      Retrieves the specified property of the Node, and returns its String value
      static org.w3c.dom.Node getSecurityElement​(jakarta.xml.soap.SOAPHeader header)
      Finds the Security element from the header.
      static jakarta.xml.soap.SOAPHeader getSOAPHeader​(jakarta.xml.ws.handler.soap.SOAPMessageContext smc)
      Returns the header.
      static boolean isHoKToken​(org.w3c.dom.Node token)
      Performs an elementary test to check if the Node possibly represents a Holder-Of-Key SAML token.
      static boolean isOutgoingMessage​(jakarta.xml.ws.handler.soap.SOAPMessageContext smc)
      Returns true if the SOAPMessageContext is part of the request
      static boolean isSamlToken​(org.w3c.dom.Node token)
      Performs an elementary test to check if the Node possibly represents a SAML token.
      static <T> org.w3c.dom.Document marshallJaxbElement​(jakarta.xml.bind.JAXBElement<T> jaxbElement)
      Marshall a jaxbElement into a Document
      static void printMessage​(jakarta.xml.ws.handler.soap.SOAPMessageContext smc)
      Prints the SOAP Message on the console
      static void printToken​(org.w3c.dom.Element token)
      Prints some basic information about the SAML token on the console
      static void trustAllHttpsCertificates()
      Method to trust all the HTTPS certificates.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • getNodeProperty

        public static java.lang.String getNodeProperty​(org.w3c.dom.Node node,
                                                       java.lang.String propertyName)
        Retrieves the specified property of the Node, and returns its String value
        Parameters:
        node -
        propertyName -
        Returns:
      • getSecurityElement

        public static org.w3c.dom.Node getSecurityElement​(jakarta.xml.soap.SOAPHeader header)
        Finds the Security element from the header. If not found then creates one and returns the same
        Parameters:
        header -
        Returns:
      • getSOAPHeader

        public static jakarta.xml.soap.SOAPHeader getSOAPHeader​(jakarta.xml.ws.handler.soap.SOAPMessageContext smc)
                                                         throws jakarta.xml.soap.SOAPException
        Returns the header. If not present then adds one and return the same
        Parameters:
        smc -
        Returns:
        Throws:
        jakarta.xml.soap.SOAPException
      • isHoKToken

        public static boolean isHoKToken​(org.w3c.dom.Node token)
        Performs an elementary test to check if the Node possibly represents a Holder-Of-Key SAML token.
        Parameters:
        token -
        Returns:
      • isOutgoingMessage

        public static boolean isOutgoingMessage​(jakarta.xml.ws.handler.soap.SOAPMessageContext smc)
        Returns true if the SOAPMessageContext is part of the request
        Parameters:
        smc -
        Returns:
      • isSamlToken

        public static boolean isSamlToken​(org.w3c.dom.Node token)
        Performs an elementary test to check if the Node possibly represents a SAML token.
        Parameters:
        token -
        Returns:
      • marshallJaxbElement

        public static final <T> org.w3c.dom.Document marshallJaxbElement​(jakarta.xml.bind.JAXBElement<T> jaxbElement)
        Marshall a jaxbElement into a Document
        Parameters:
        jaxbElement -
        Returns:
        Document
      • printMessage

        public static void printMessage​(jakarta.xml.ws.handler.soap.SOAPMessageContext smc)
        Prints the SOAP Message on the console
        Parameters:
        smc -
      • printToken

        public static void printToken​(org.w3c.dom.Element token)
        Prints some basic information about the SAML token on the console
        Parameters:
        token -
      • trustAllHttpsCertificates

        public static void trustAllHttpsCertificates()
        Method to trust all the HTTPS certificates. To be used only in the development environment for convenience sake