Package es.gob.afirma.utils
Class UtilsAxis
- java.lang.Object
-
- es.gob.afirma.utils.UtilsAxis
-
public final class UtilsAxis extends java.lang.ObjectUtilities class that contains auxiliary method related with axis engine.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.2, 18/04/2022.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringfindAttributeValue(org.apache.axiom.om.OMElement element, java.lang.String attributeName)Method that gets the value of an attribute from a given XML element.static org.apache.axiom.om.OMElementfindElementByTagName(org.apache.axiom.om.OMElement element, java.lang.String tagName)Method that finds a given element in the OMElement if it exists.static org.apache.axiom.om.OMElementfindElementByTagNameAndAttribute(org.apache.axiom.om.OMElement element, java.lang.String tagName, java.lang.String attrName, java.lang.String attrValue)Method that finds a given element in the OMElement if it exists.static org.apache.axiom.om.OMElementfindElementByTagNameAndId(org.apache.axiom.om.OMElement element, java.lang.String tagName, java.lang.String id)Method that finds a given element in the OMElement if it exists.static org.apache.axiom.om.OMElementfromSOAPHeaderToOMElement(org.apache.axis2.saaj.SOAPHeaderElementImpl headers)Method that transforms a SOAPHeader into a OMElement.static java.lang.StringgenerateNumbersUniqueId()Synchronized method that generates a unique identifier builded in characters and a ending number.static booleanisHandlerInPhase(org.apache.axis2.engine.Phase phase, org.apache.axis2.engine.Handler handler)Method that checks if the handlers is already included in the phase.static org.apache.axiom.om.OMElementparseElements(org.apache.axis2.saaj.SOAPElementImpl<?> sh, org.apache.axiom.om.OMFactory fac)Method that transform a given set of child elements into a OMElement.static voidupdateSoapBody(org.apache.axiom.soap.SOAPBody body, javax.xml.soap.SOAPBody soapBody)Method that update the current SOAP body with the new generated body.
-
-
-
Method Detail
-
fromSOAPHeaderToOMElement
public static org.apache.axiom.om.OMElement fromSOAPHeaderToOMElement(org.apache.axis2.saaj.SOAPHeaderElementImpl headers)
Method that transforms a SOAPHeader into a OMElement.- Parameters:
headers- SOAP header to transform.- Returns:
- a new OMElement that represents the SOAP header.
-
parseElements
public static org.apache.axiom.om.OMElement parseElements(org.apache.axis2.saaj.SOAPElementImpl<?> sh, org.apache.axiom.om.OMFactory fac)Method that transform a given set of child elements into a OMElement.- Parameters:
sh- Child to transform.fac- Object Model factory.- Returns:
- a new OMElement object that represents the set of child elements.
-
generateNumbersUniqueId
public static java.lang.String generateNumbersUniqueId()
Synchronized method that generates a unique identifier builded in characters and a ending number.- Returns:
- String that represents the generated unique identifier.
-
findElementByTagName
public static org.apache.axiom.om.OMElement findElementByTagName(org.apache.axiom.om.OMElement element, java.lang.String tagName)Method that finds a given element in the OMElement if it exists.- Parameters:
element- XML element to analyze.tagName- Name of the tag to find.- Returns:
- the element if it exists or null in other cases.
-
findElementByTagNameAndId
public static org.apache.axiom.om.OMElement findElementByTagNameAndId(org.apache.axiom.om.OMElement element, java.lang.String tagName, java.lang.String id)Method that finds a given element in the OMElement if it exists.- Parameters:
element- XML element to analyze.tagName- Name of the tag to find.id- Identifier of the element to find.- Returns:
- the element if it exists or null in other cases.
-
findElementByTagNameAndAttribute
public static org.apache.axiom.om.OMElement findElementByTagNameAndAttribute(org.apache.axiom.om.OMElement element, java.lang.String tagName, java.lang.String attrName, java.lang.String attrValue)Method that finds a given element in the OMElement if it exists.- Parameters:
element- XML element to analyze.tagName- Name of the tag to find.attrName- Name of the attribute to find.attrValue- value of the attribute to find.- Returns:
- the element if it exists or null in other cases.
-
findAttributeValue
public static java.lang.String findAttributeValue(org.apache.axiom.om.OMElement element, java.lang.String attributeName)Method that gets the value of an attribute from a given XML element.- Parameters:
element- XML element where to do the search.attributeName- Name of the attribute to find.- Returns:
- the attribute value found or null if the attribute was not found.
-
updateSoapBody
public static void updateSoapBody(org.apache.axiom.soap.SOAPBody body, javax.xml.soap.SOAPBody soapBody)Method that update the current SOAP body with the new generated body.- Parameters:
body- Current SOAP body to update.soapBody- new SOAP body.
-
isHandlerInPhase
public static boolean isHandlerInPhase(org.apache.axis2.engine.Phase phase, org.apache.axis2.engine.Handler handler)Method that checks if the handlers is already included in the phase.- Parameters:
phase- axis2 phase.handler- handler to check.- Returns:
- true if the handler is already in the handler and false if not.
-
-