blob: 0424488e11fb5cec7cf606ce6e0321788dae6725 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>ValidatorData.java</title><link rel="stylesheet" href="../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Coverage Report</a> &gt; <a href="index.source.html" class="el_package">org.apache.rampart</a> &gt; <span class="el_source">ValidatorData.java</span></div><h1>ValidatorData.java</h1><pre class="source lang-java linenums">/*
* Copyright 2004,2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.rampart;
import org.apache.axiom.soap.SOAP11Constants;
import org.apache.ws.security.WSConstants;
import org.apache.xml.security.utils.EncryptionConstants;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.ArrayList;
public class ValidatorData {
private RampartMessageData rmd;
<span class="fc" id="L31"> ArrayList encryptedDataRefIds = new ArrayList();</span>
private String bodyEncrDataId;
<span class="fc" id="L34"> public ValidatorData(RampartMessageData rmd) {</span>
<span class="fc" id="L35"> this.rmd = rmd;</span>
<span class="fc" id="L36"> this.extractEncryptedPartInformation();</span>
<span class="fc" id="L37"> }</span>
private void extractEncryptedPartInformation() {
<span class="fc" id="L40"> Element start = rmd.getDocument().getDocumentElement();</span>
<span class="pc bpc" id="L41" title="1 of 2 branches missed."> if(start != null) {</span>
<span class="fc" id="L42"> extractEncryptedPartInformation(start);</span>
}
<span class="fc" id="L45"> }</span>
private void extractEncryptedPartInformation(Element parent) {
<span class="fc" id="L49"> NodeList childNodes = parent.getChildNodes();</span>
Node node;
<span class="fc bfc" id="L51" title="All 2 branches covered."> for (int i = 0; i &lt; childNodes.getLength(); i++) {</span>
<span class="fc" id="L52"> node = childNodes.item(i);</span>
<span class="fc bfc" id="L53" title="All 2 branches covered."> if (node instanceof Element) {</span>
<span class="fc" id="L54"> Element elem = (Element) node;</span>
<span class="fc bfc" id="L55" title="All 6 branches covered."> if (elem.getNamespaceURI() != null </span>
&amp;&amp; elem.getNamespaceURI().equals(WSConstants.ENC_NS)
&amp;&amp; elem.getLocalName().equals(
EncryptionConstants._TAG_ENCRYPTEDDATA)) {
<span class="pc bpc" id="L59" title="1 of 4 branches missed."> if (parent.getLocalName().equals(</span>
SOAP11Constants.BODY_LOCAL_NAME)
&amp;&amp; parent.getNamespaceURI().equals(
rmd.getSoapConstants().getEnvelopeURI())) {
<span class="fc" id="L63"> this.bodyEncrDataId = elem.getAttribute(&quot;Id&quot;);</span>
} else {
<span class="fc" id="L65"> encryptedDataRefIds.add(elem.getAttribute(&quot;Id&quot;));</span>
}
<span class="fc" id="L67"> break;</span>
} else {
<span class="fc" id="L69"> extractEncryptedPartInformation(elem);</span>
}
}
}
<span class="fc" id="L73"> }</span>
public ArrayList getEncryptedDataRefIds() {
<span class="nc" id="L76"> return encryptedDataRefIds;</span>
}
public RampartMessageData getRampartMessageData() {
<span class="fc" id="L80"> return rmd;</span>
}
public String getBodyEncrDataId() {
<span class="fc" id="L84"> return bodyEncrDataId;</span>
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.5.201505241946</span></div></body></html>