blob: ccabaa32a3ec4489868912b1741fa8c6cc12479c [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>SSLConfigBuilder.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.policy.builders</a> &gt; <span class="el_source">SSLConfigBuilder.java</span></div><h1>SSLConfigBuilder.java</h1><pre class="source lang-java linenums">/*
* Copyright 2001-2004 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.policy.builders;
import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMElement;
import org.apache.neethi.Assertion;
import org.apache.neethi.AssertionBuilderFactory;
import org.apache.neethi.builders.AssertionBuilder;
import org.apache.rampart.policy.model.RampartConfig;
import org.apache.rampart.policy.model.SSLConfig;
import javax.xml.namespace.QName;
import java.util.Iterator;
import java.util.Properties;
<span class="fc" id="L31">public class SSLConfigBuilder implements AssertionBuilder&lt;OMElement&gt; {</span>
public Assertion build(OMElement element, AssertionBuilderFactory factory)
throws IllegalArgumentException {
<span class="nc" id="L36"> SSLConfig sslCofig = new SSLConfig(); </span>
<span class="nc" id="L37"> Properties properties = new Properties();</span>
OMElement childElement;
OMAttribute name;
String value;
<span class="nc bnc" id="L42" title="All 2 branches missed."> for (Iterator iterator = element.getChildElements(); iterator.hasNext();) { </span>
<span class="nc" id="L44"> childElement = (OMElement) iterator.next();</span>
<span class="nc" id="L46"> QName prop = new QName(RampartConfig.NS, SSLConfig.PROPERTY_LN);</span>
<span class="nc bnc" id="L48" title="All 2 branches missed."> if (prop.equals(childElement.getQName())) {</span>
<span class="nc" id="L49"> name = childElement.getAttribute(new QName(SSLConfig.PROPERTY_NAME_ATTR));</span>
<span class="nc" id="L50"> value = childElement.getText();</span>
//setting the jsse properties to the vm
<span class="nc" id="L53"> System.setProperty(name.getAttributeValue(), value);</span>
<span class="nc" id="L55"> properties.put(name.getAttributeValue(), value.trim());</span>
}
<span class="nc" id="L58"> } </span>
<span class="nc" id="L59"> sslCofig.setProp(properties);</span>
<span class="nc" id="L61"> return sslCofig;</span>
}
public QName[] getKnownElements() {
<span class="fc" id="L65"> return new QName[] {new QName(RampartConfig.NS, SSLConfig.SSL_LN)};</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>