Package com.vmware.sso.client.utils
Class Utils
- java.lang.Object
-
- com.vmware.sso.client.utils.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.StringgetNodeProperty(org.w3c.dom.Node node, java.lang.String propertyName)Retrieves the specified property of the Node, and returns its String valuestatic org.w3c.dom.NodegetSecurityElement(jakarta.xml.soap.SOAPHeader header)Finds the Security element from the header.static jakarta.xml.soap.SOAPHeadergetSOAPHeader(jakarta.xml.ws.handler.soap.SOAPMessageContext smc)Returns the header.static booleanisHoKToken(org.w3c.dom.Node token)Performs an elementary test to check if the Node possibly represents a Holder-Of-Key SAML token.static booleanisOutgoingMessage(jakarta.xml.ws.handler.soap.SOAPMessageContext smc)Returns true if theSOAPMessageContextis part of the requeststatic booleanisSamlToken(org.w3c.dom.Node token)Performs an elementary test to check if the Node possibly represents a SAML token.static <T> org.w3c.dom.DocumentmarshallJaxbElement(jakarta.xml.bind.JAXBElement<T> jaxbElement)Marshall a jaxbElement into a Documentstatic voidprintMessage(jakarta.xml.ws.handler.soap.SOAPMessageContext smc)Prints the SOAP Message on the consolestatic voidprintToken(org.w3c.dom.Element token)Prints some basic information about the SAML token on the consolestatic voidtrustAllHttpsCertificates()Method to trust all the HTTPS certificates.
-
-
-
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.SOAPExceptionReturns 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 theSOAPMessageContextis 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
-
-