Package org.apache.wss4j.dom.callback
Class DOMCallbackLookup
- java.lang.Object
-
- org.apache.wss4j.dom.callback.DOMCallbackLookup
-
- All Implemented Interfaces:
CallbackLookup
public class DOMCallbackLookup extends Object implements CallbackLookup
This class uses a DOM-based approach to locate Elements that are referenced via an Id.
-
-
Constructor Summary
Constructors Constructor Description DOMCallbackLookup(Document doc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Element
getAndRegisterElement(String id, String valueType, boolean checkMultipleElements, DOMCryptoContext context)
Get the DOM element that corresponds to the given id and ValueType reference.Element
getElement(String id, String valueType, boolean checkMultipleElements)
Get the DOM element that corresponds to the given id and ValueType reference.List<Element>
getElements(String localname, String namespace)
Get the DOM element(s) that correspond to the given localname/namespace.Element
getSOAPBody()
Get the SOAP Body
-
-
-
Constructor Detail
-
DOMCallbackLookup
public DOMCallbackLookup(Document doc)
-
-
Method Detail
-
getElement
public Element getElement(String id, String valueType, boolean checkMultipleElements) throws WSSecurityException
Get the DOM element that corresponds to the given id and ValueType reference. The Id can be a wsu:Id or else an Id attribute, or a SAML Id when the ValueType refers to a SAML Assertion.- Specified by:
getElement
in interfaceCallbackLookup
- Parameters:
id
- The id of the element to locatevalueType
- The ValueType attribute of the element to locate (can be null)checkMultipleElements
- If true then go through the entire tree and return null if there are multiple elements with the same Id- Returns:
- the located element
- Throws:
WSSecurityException
-
getAndRegisterElement
public Element getAndRegisterElement(String id, String valueType, boolean checkMultipleElements, DOMCryptoContext context) throws WSSecurityException
Get the DOM element that corresponds to the given id and ValueType reference. The Id can be a wsu:Id or else an Id attribute, or a SAML Id when the ValueType refers to a SAML Assertion. The implementation is also responsible to register the retrieved Element on the DOMCryptoContext argument, so that the XML Signature implementation can find the Element.- Specified by:
getAndRegisterElement
in interfaceCallbackLookup
- Parameters:
id
- The id of the element to locatevalueType
- The ValueType attribute of the element to locate (can be null)checkMultipleElements
- If true then go through the entire tree and return null if there are multiple elements with the same Idcontext
- The DOMCryptoContext to store the Element in- Returns:
- the located element
- Throws:
WSSecurityException
-
getElements
public List<Element> getElements(String localname, String namespace) throws WSSecurityException
Get the DOM element(s) that correspond to the given localname/namespace.- Specified by:
getElements
in interfaceCallbackLookup
- Parameters:
localname
- The localname of the Element(s)namespace
- The namespace of the Element(s)- Returns:
- the located element(s)
- Throws:
WSSecurityException
-
getSOAPBody
public Element getSOAPBody()
Get the SOAP Body- Specified by:
getSOAPBody
in interfaceCallbackLookup
-
-