blob: 2dc065a2f8a516f13978ed5a25d3948797155978 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<h5>Coverage Report - com.google.enterprise.adaptor.GsaCommunicationHandler</h5>
<div class="separator">&nbsp;</div>
<table class="report">
<thead><tr> <td class="heading">Classes in this File</td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead>
<tr><td><a href="com.google.enterprise.adaptor.GsaCommunicationHandler.html">GsaCommunicationHandler</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">64</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:78px"><span class="text">239/303</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">30</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:72px"><span class="text">78/108</span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.911111111111111;</span>3.911</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.GsaCommunicationHandler.html">GsaCommunicationHandler$1</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.911111111111111;</span>3.911</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.GsaCommunicationHandler.html">GsaCommunicationHandler$AdaptorContextImpl</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">31</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:44px"><span class="text">25/56</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">17</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:22px"><span class="text">5/22</span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.911111111111111;</span>3.911</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.GsaCommunicationHandler.html">GsaCommunicationHandler$AlreadyRunningRunnable</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">2</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:33px"><span class="text">1/3</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.911111111111111;</span>3.911</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.GsaCommunicationHandler.html">GsaCommunicationHandler$BackgroundRunnable</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">0</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:100px"><span class="text">5/5</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.911111111111111;</span>3.911</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.GsaCommunicationHandler.html">GsaCommunicationHandler$IncrementalPushRunnable</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">4</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:63px"><span class="text">7/11</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.911111111111111;</span>3.911</td></tr>
<tr><td><a href="com.google.enterprise.adaptor.GsaCommunicationHandler.html">GsaCommunicationHandler$PushRunnable</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">1</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:87px"><span class="text">7/8</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></td><td class="percentgraph"><div class="percentgraph"><div class="na" style="width:100px"><span class="text"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">N/A</a></span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.911111111111111;</span>3.911</td></tr>
</table>
<div class="separator">&nbsp;</div>
<table cellspacing="0" cellpadding="0" class="src">
<tr> <td class="numLine">&nbsp;1</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// Copyright 2011 Google Inc. All Rights Reserved.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;2</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">//</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;3</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;4</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// you may not use this file except in compliance with the License.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;5</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// You may obtain a copy of the License at</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;6</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">//</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;7</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;8</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">//</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;9</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;10</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;11</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;12</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// See the License for the specific language governing permissions and</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;13</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">// limitations under the License.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;14</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;15</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">package</span> com.google.enterprise.adaptor;</pre></td></tr>
<tr> <td class="numLine">&nbsp;16</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;17</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.common.annotations.VisibleForTesting;</pre></td></tr>
<tr> <td class="numLine">&nbsp;18</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.google.common.util.concurrent.ThreadFactoryBuilder;</pre></td></tr>
<tr> <td class="numLine">&nbsp;19</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;20</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.sun.net.httpserver.Filter;</pre></td></tr>
<tr> <td class="numLine">&nbsp;21</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.sun.net.httpserver.HttpContext;</pre></td></tr>
<tr> <td class="numLine">&nbsp;22</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.sun.net.httpserver.HttpExchange;</pre></td></tr>
<tr> <td class="numLine">&nbsp;23</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.sun.net.httpserver.HttpHandler;</pre></td></tr>
<tr> <td class="numLine">&nbsp;24</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.sun.net.httpserver.HttpServer;</pre></td></tr>
<tr> <td class="numLine">&nbsp;25</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.sun.net.httpserver.HttpsServer;</pre></td></tr>
<tr> <td class="numLine">&nbsp;26</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;27</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.DefaultBootstrap;</pre></td></tr>
<tr> <td class="numLine">&nbsp;28</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.opensaml.xml.ConfigurationException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;29</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;30</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.FileInputStream;</pre></td></tr>
<tr> <td class="numLine">&nbsp;31</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.FileNotFoundException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;32</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.IOException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;33</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.InputStream;</pre></td></tr>
<tr> <td class="numLine">&nbsp;34</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.lang.reflect.Method;</pre></td></tr>
<tr> <td class="numLine">&nbsp;35</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.net.ConnectException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;36</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.net.UnknownHostException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;37</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.net.URI;</pre></td></tr>
<tr> <td class="numLine">&nbsp;38</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.net.URISyntaxException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;39</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.security.Key;</pre></td></tr>
<tr> <td class="numLine">&nbsp;40</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.security.KeyPair;</pre></td></tr>
<tr> <td class="numLine">&nbsp;41</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.security.KeyStore;</pre></td></tr>
<tr> <td class="numLine">&nbsp;42</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.security.KeyStoreException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;43</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.security.NoSuchAlgorithmException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;44</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.security.PrivateKey;</pre></td></tr>
<tr> <td class="numLine">&nbsp;45</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.security.PublicKey;</pre></td></tr>
<tr> <td class="numLine">&nbsp;46</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.security.UnrecoverableKeyException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;47</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.security.cert.CertificateException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;48</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.ArrayList;</pre></td></tr>
<tr> <td class="numLine">&nbsp;49</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Arrays;</pre></td></tr>
<tr> <td class="numLine">&nbsp;50</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Collections;</pre></td></tr>
<tr> <td class="numLine">&nbsp;51</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.LinkedList;</pre></td></tr>
<tr> <td class="numLine">&nbsp;52</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.List;</pre></td></tr>
<tr> <td class="numLine">&nbsp;53</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Map;</pre></td></tr>
<tr> <td class="numLine">&nbsp;54</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.TreeMap;</pre></td></tr>
<tr> <td class="numLine">&nbsp;55</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.concurrent.Executors;</pre></td></tr>
<tr> <td class="numLine">&nbsp;56</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.concurrent.ExecutorService;</pre></td></tr>
<tr> <td class="numLine">&nbsp;57</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.concurrent.Future;</pre></td></tr>
<tr> <td class="numLine">&nbsp;58</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.concurrent.ScheduledExecutorService;</pre></td></tr>
<tr> <td class="numLine">&nbsp;59</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.concurrent.TimeUnit;</pre></td></tr>
<tr> <td class="numLine">&nbsp;60</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.logging.Level;</pre></td></tr>
<tr> <td class="numLine">&nbsp;61</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.logging.Logger;</pre></td></tr>
<tr> <td class="numLine">&nbsp;62</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> javax.net.ssl.SSLException;</pre></td></tr>
<tr> <td class="numLine">&nbsp;63</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;64</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment">/** This class handles the communications with GSA. */</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;65</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp;<span class="keyword">public</span> <span class="keyword">final</span> <span class="keyword">class</span> GsaCommunicationHandler {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;66</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> Logger log</pre></td></tr>
<tr> <td class="numLine">&nbsp;67</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; = Logger.getLogger(GsaCommunicationHandler.<span class="keyword">class</span>.getName());</pre></td></tr>
<tr> <td class="numLine">&nbsp;68</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;69</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> Adaptor adaptor;</pre></td></tr>
<tr> <td class="numLine">&nbsp;70</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> Config config;</pre></td></tr>
<tr> <td class="numLine">&nbsp;71</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> Journal journal;</pre></td></tr>
<tr> <td class="numLine">&nbsp;72</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> AdaptorContextImpl adaptorContext;</pre></td></tr>
<tr> <td class="numLine">&nbsp;73</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;74</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Cron-style scheduler. Available for other uses, but necessary for</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;75</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * scheduling {@link docIdFullPusher}. Tasks should execute quickly, to allow</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;76</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * shutting down promptly.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;77</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;78</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> CronScheduler scheduler;</pre></td></tr>
<tr> <td class="numLine">&nbsp;79</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;80</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Runnable to be called for doing a full push of {@code DocId}s. It only</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;81</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * permits one invocation at a time. If multiple simultaneous invocations</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;82</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * occur, all but the first will log a warning and return immediately.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;83</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;84</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> OneAtATimeRunnable docIdFullPusher;</pre></td></tr>
<tr> <td class="numLine">&nbsp;85</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;86</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Runnable to be called for doing incremental feed pushes. It is only</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;87</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * set if the Adaptor supports incremental updates. Otherwise, it's null.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;88</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;89</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> OneAtATimeRunnable docIdIncrementalPusher;</pre></td></tr>
<tr> <td class="numLine">&nbsp;90</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;91</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Schedule identifier for {@link #sendDocIds}.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;92</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;93</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> Future&lt;?&gt; sendDocIdsFuture;</pre></td></tr>
<tr> <td class="numLine">&nbsp;94</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> HttpServerScope scope;</pre></td></tr>
<tr> <td class="numLine">&nbsp;95</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> SessionManager&lt;HttpExchange&gt; sessionManager;</pre></td></tr>
<tr> <td class="numLine">&nbsp;96</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;97</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Executor for scheduling tasks in the future. These tasks &lt;em&gt;must&lt;/em&gt;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;98</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * complete quickly, as the executor purposely is single-threaded.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;99</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;100</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * &lt;p&gt;The reason tasks must finish quickly is that the</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;101</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * ScheduledExecutorService implementation provided by Java is a fixed-size</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;102</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * thread pool. In addition, fixed-rate (as opposed to fixed-delay) events</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;103</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * "pile up" when the runnable takes a long time to complete. Thus, using the</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;104</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * scheduleExecutor for longer processing effectively requires a dedicated</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;105</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * thread (because the pool is fixed-size) as well as runs into the event</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;106</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * "pile up" issue.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;107</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;108</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> ScheduledExecutorService scheduleExecutor;</pre></td></tr>
<tr> <td class="numLine">&nbsp;109</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;110</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Executor for performing work in the background. This executor is general</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;111</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * purpose and is commonly used in conjunction with {@link #scheduleExecutor}.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;112</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;113</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> ExecutorService backgroundExecutor;</pre></td></tr>
<tr> <td class="numLine">&nbsp;114</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> DocIdCodec docIdCodec;</pre></td></tr>
<tr> <td class="numLine">&nbsp;115</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> DocIdSender docIdSender;</pre></td></tr>
<tr> <td class="numLine">&nbsp;116</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> AsyncDocIdSender asyncDocIdSender;</pre></td></tr>
<tr> <td class="numLine">&nbsp;117</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> HttpServerScope dashboardScope;</pre></td></tr>
<tr> <td class="numLine">&nbsp;118</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> Dashboard dashboard;</pre></td></tr>
<tr> <td class="numLine">&nbsp;119</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> SensitiveValueCodec secureValueCodec;</pre></td></tr>
<tr> <td class="numLine">&nbsp;120</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> KeyPair keyPair;</pre></td></tr>
<tr> <td class="numLine">&nbsp;121</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> AclTransform aclTransform;</pre></td></tr>
<tr> <td class="numLine">&nbsp;122</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;123</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> ShutdownWaiter waiter;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;124</td> <td class="nbHitsCovered">&nbsp;44</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">final</span> List&lt;Filter&gt; commonFilters = Arrays.asList(<span class="keyword">new</span> Filter[] {</pre></td></tr>
<tr> <td class="numLine">&nbsp;125</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> AbortImmediatelyFilter(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;126</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> LoggingFilter(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;127</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> InternalErrorFilter(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;128</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; });</pre></td></tr>
<tr> <td class="numLine">&nbsp;129</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;130</td> <td class="nbHitsCovered">&nbsp;44</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> GsaCommunicationHandler(Adaptor adaptor, Config config) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;131</td> <td class="nbHitsCovered">&nbsp;44</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.adaptor = adaptor;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;132</td> <td class="nbHitsCovered">&nbsp;44</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">this</span>.config = config;</pre></td></tr>
<tr> <td class="numLine">&nbsp;133</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;134</td> <td class="nbHitsCovered">&nbsp;44</td> <td class="src"><pre class="src">&nbsp; journal = <span class="keyword">new</span> Journal(config.isJournalReducedMem());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;135</td> <td class="nbHitsCovered">&nbsp;44</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;136</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;137</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;138</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Start services necessary for handling outgoing requests. {@code ""} is used</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;139</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * for {@code contextPrefix} if the passed value is {@code null}.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;140</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;141</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">synchronized</span> AdaptorContext setup(HttpServer server,</pre></td></tr>
<tr> <td class="numLine">&nbsp;142</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; HttpServer dashboardServer, String contextPrefix) <span class="keyword">throws</span> IOException,</pre></td></tr>
<tr> <td class="numLine">&nbsp;143</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; InterruptedException {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;144</td> <td class="nbHitsUncovered"><a title="Line 144: Conditional coverage 50% (1/2).">&nbsp;18</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 144: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (<span class="keyword">this</span>.scope != <span class="keyword">null</span>) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;145</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IllegalStateException(<span class="string">"Already listening"</span>);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;146</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;147</td> <td class="nbHitsUncovered"><a title="Line 147: Conditional coverage 50% (2/4) [each condition: 50%, 50%].">&nbsp;18</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 147: Conditional coverage 50% (2/4) [each condition: 50%, 50%]."> <span class="keyword">if</span> (server == <span class="keyword">null</span> || dashboardServer == <span class="keyword">null</span>) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;148</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> NullPointerException();</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;149</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;150</td> <td class="nbHitsCovered"><a title="Line 150: Conditional coverage 100% (2/2).">&nbsp;18</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 150: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (contextPrefix == <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;151</td> <td class="nbHitsCovered">&nbsp;16</td> <td class="src"><pre class="src">&nbsp; contextPrefix = <span class="string">""</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;152</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;153</td> <td class="nbHitsUncovered"><a title="Line 153: Conditional coverage 50% (1/2).">&nbsp;18</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 153: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (server <span class="keyword">instanceof</span> HttpsServer</a></span></pre></td></tr>
<tr> <td class="numLine">&nbsp;154</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; != dashboardServer <span class="keyword">instanceof</span> HttpsServer) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;155</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;156</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="string">"Both servers must be HttpServers or both HttpsServers"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;157</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;158</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;159</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">boolean</span> secure = server <span class="keyword">instanceof</span> HttpsServer;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;160</td> <td class="nbHitsUncovered"><a title="Line 160: Conditional coverage 50% (1/2).">&nbsp;18</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 160: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (secure != config.isServerSecure()) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;161</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; config.setValue(<span class="string">"server.secure"</span>, <span class="string">""</span> + secure);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;162</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;163</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; keyPair = <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;164</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;165</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; keyPair = getKeyPair(config.getServerKeyAlias());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;166</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (IOException ex) {</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;167</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// The exception is only fatal if we are in secure mode.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;168</td> <td class="nbHitsUncovered"><a title="Line 168: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 168: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (secure) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;169</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> ex;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;170</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;171</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (RuntimeException ex) {</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;172</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// The exception is only fatal if we are in secure mode.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;173</td> <td class="nbHitsUncovered"><a title="Line 173: Conditional coverage 0% (0/2).">&nbsp;0</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 173: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (secure) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;174</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> ex;</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;175</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;176</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;177</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; secureValueCodec = <span class="keyword">new</span> SensitiveValueCodec(keyPair);</pre></td></tr>
<tr> <td class="numLine">&nbsp;178</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;179</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">int</span> port = server.getAddress().getPort();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;180</td> <td class="nbHitsCovered"><a title="Line 180: Conditional coverage 100% (2/2).">&nbsp;18</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 180: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (port != config.getServerPort()) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;181</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; config.setValue(<span class="string">"server.port"</span>, <span class="string">""</span> + port);</pre></td></tr>
<tr> <td class="numLine">&nbsp;182</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;183</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">int</span> dashboardPort = dashboardServer.getAddress().getPort();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;184</td> <td class="nbHitsCovered"><a title="Line 184: Conditional coverage 100% (2/2).">&nbsp;18</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 184: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (dashboardPort != config.getServerDashboardPort()) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;185</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; config.setValue(<span class="string">"server.dashboardPort"</span>, <span class="string">""</span> + dashboardPort);</pre></td></tr>
<tr> <td class="numLine">&nbsp;186</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;187</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;188</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; scope = <span class="keyword">new</span> HttpServerScope(server, contextPrefix);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;189</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; waiter = <span class="keyword">new</span> ShutdownWaiter();</pre></td></tr>
<tr> <td class="numLine">&nbsp;190</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;191</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; sessionManager = <span class="keyword">new</span> SessionManager&lt;HttpExchange&gt;(</pre></td></tr>
<tr> <td class="numLine">&nbsp;192</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> SessionManager.HttpExchangeClientStore(<span class="string">"sessid_"</span> + port, secure),</pre></td></tr>
<tr> <td class="numLine">&nbsp;193</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; 30 * 60 * 1000 <span class="comment">/* session lifetime: 30 minutes */</span>,</pre></td></tr>
<tr> <td class="numLine">&nbsp;194</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; 5 * 60 * 1000 <span class="comment">/* max cleanup frequency: 5 minutes */</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;195</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;196</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; URI baseUri = config.getServerBaseUri();</pre></td></tr>
<tr> <td class="numLine">&nbsp;197</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; URI docUri;</pre></td></tr>
<tr> <td class="numLine">&nbsp;198</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;199</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; docUri = <span class="keyword">new</span> URI(<span class="keyword">null</span>, <span class="keyword">null</span>, contextPrefix + config.getServerDocIdPath(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;200</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">null</span>);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;201</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (URISyntaxException ex) {</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;202</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Invalid prefix or docIdPath"</span>, ex);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;203</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;204</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; docIdCodec = <span class="keyword">new</span> DocIdCodec(baseUri.resolve(docUri), config.isDocIdUrl());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;205</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; GsaFeedFileSender fileSender = <span class="keyword">new</span> GsaFeedFileSender(</pre></td></tr>
<tr> <td class="numLine">&nbsp;206</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getGsaHostname(), config.isServerSecure(), <span class="comment">// use secure bool?</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;207</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getGsaCharacterEncoding());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;208</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; aclTransform = createAclTransform();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;209</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; GsaFeedFileMaker fileMaker = <span class="keyword">new</span> GsaFeedFileMaker(docIdCodec, aclTransform,</pre></td></tr>
<tr> <td class="numLine">&nbsp;210</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.isGsa614FeedWorkaroundEnabled(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;211</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.isGsa70AuthMethodWorkaroundEnabled(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;212</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.isCrawlImmediatelyBitEnabled().isOverriden,</pre></td></tr>
<tr> <td class="numLine">&nbsp;213</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.isCrawlImmediatelyBitEnabled().value,</pre></td></tr>
<tr> <td class="numLine">&nbsp;214</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.isFeedNoRecrawlBitEnabled().isOverriden,</pre></td></tr>
<tr> <td class="numLine">&nbsp;215</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.isFeedNoRecrawlBitEnabled().value);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;216</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; GsaFeedFileArchiver fileArchiver =</pre></td></tr>
<tr> <td class="numLine">&nbsp;217</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> GsaFeedFileArchiver(config.getFeedArchiveDirectory());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;218</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; docIdSender = <span class="keyword">new</span> DocIdSender(fileMaker, fileSender, fileArchiver, journal,</pre></td></tr>
<tr> <td class="numLine">&nbsp;219</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config, adaptor);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;220</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; asyncDocIdSender = <span class="keyword">new</span> AsyncDocIdSender(docIdSender,</pre></td></tr>
<tr> <td class="numLine">&nbsp;221</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getFeedMaxUrls() <span class="comment">/* batch size */</span>,</pre></td></tr>
<tr> <td class="numLine">&nbsp;222</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; 5 <span class="comment">/* max latency */</span>, TimeUnit.MINUTES,</pre></td></tr>
<tr> <td class="numLine">&nbsp;223</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; 2 * config.getFeedMaxUrls() <span class="comment">/* queue size */</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;224</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;225</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Could be done during start(), but then we would have to save</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;226</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// dashboardServer and contextPrefix.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;227</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; dashboardScope = <span class="keyword">new</span> HttpServerScope(dashboardServer, contextPrefix);</pre></td></tr>
<tr> <td class="numLine">&nbsp;228</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;229</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// We are about to start the Adaptor, so anything available through</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;230</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// AdaptorContext or other means must be initialized at this point. Any</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;231</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// reference to 'adaptor' before this point must be done very carefully to</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;232</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// ensure it doesn't call the adaptor until after Adaptor.init() completes.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;233</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> adaptorContext = <span class="keyword">new</span> AdaptorContextImpl();</pre></td></tr>
<tr> <td class="numLine">&nbsp;234</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;235</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;236</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;237</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Start servicing incoming requests. This makes use of the</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;238</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * previously-provided HttpServers and configuration.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;239</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;240</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">public</span> <span class="keyword">synchronized</span> <span class="keyword">void</span> start() {</pre></td></tr>
<tr> <td class="numLine">&nbsp;241</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Since the Adaptor has been started, we can now issue other calls to it.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;242</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Usages of 'adaptor' are completely safe after this point.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;243</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; adaptorContext.freeze();</pre></td></tr>
<tr> <td class="numLine">&nbsp;244</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;245</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Since we are white-listing particular keys for auto-update, things aren't</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;246</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// ready enough to expose to adaptors.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;247</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/*if (adaptor instanceof ConfigModificationListener) {</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;248</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> config.addConfigModificationListener(</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;249</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> (ConfigModificationListener) adaptor);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;250</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> }*/</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;251</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;252</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; SamlServiceProvider samlServiceProvider = <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;253</td> <td class="nbHitsCovered"><a title="Line 253: Conditional coverage 100% (2/2).">&nbsp;15</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 253: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (config.isServerSecure()) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;254</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; bootstrapOpenSaml();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;255</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; SamlMetadata metadata = <span class="keyword">new</span> SamlMetadata(config.getServerHostname(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;256</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getServerPort(), config.getGsaHostname(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;257</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getGsaSamlEntityId(), config.getServerSamlEntityId());</pre></td></tr>
<tr> <td class="numLine">&nbsp;258</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;259</td> <td class="nbHitsUncovered"><a title="Line 259: Conditional coverage 50% (1/2).">&nbsp;1</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 259: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (adaptorContext.authnAuthority != <span class="keyword">null</span>) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;260</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; log.config(<span class="string">"Adaptor-based authentication supported"</span>);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;261</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; SamlIdentityProvider samlIdentityProvider = <span class="keyword">new</span> SamlIdentityProvider(</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;262</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; adaptorContext.authnAuthority, metadata, keyPair,</pre></td></tr>
<tr> <td class="numLine">&nbsp;263</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getSamlIdpExpirationMillis());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;264</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; addFilters(scope.createContext(<span class="string">"/samlip"</span>,</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;265</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; samlIdentityProvider.getSingleSignOnHandler()));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;266</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">else</span> {</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;267</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; log.config(<span class="string">"Adaptor-based authentication not supported"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;268</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;269</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; samlServiceProvider</pre></td></tr>
<tr> <td class="numLine">&nbsp;270</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; = <span class="keyword">new</span> SamlServiceProvider(sessionManager, metadata, keyPair);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;271</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; addFilters(scope.createContext(<span class="string">"/samlassertionconsumer"</span>,</pre></td></tr>
<tr> <td class="numLine">&nbsp;272</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; samlServiceProvider.getAssertionConsumer()));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;273</td> <td class="nbHitsUncovered"><a title="Line 273: Conditional coverage 50% (1/2).">&nbsp;1</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 273: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (adaptorContext.authzAuthority != <span class="keyword">null</span>) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;274</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; log.config(<span class="string">"Adaptor-based authorization supported"</span>);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;275</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; addFilters(scope.createContext(<span class="string">"/saml-authz"</span>, <span class="keyword">new</span> SamlBatchAuthzHandler(</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;276</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; adaptorContext.authzAuthority, docIdCodec, metadata)));</pre></td></tr>
<tr> <td class="numLine">&nbsp;277</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">else</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;278</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; log.config(<span class="string">"Adaptor-based authorization not supported"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;279</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;280</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;281</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; scheduleExecutor = Executors.newSingleThreadScheduledExecutor(</pre></td></tr>
<tr> <td class="numLine">&nbsp;282</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> ThreadFactoryBuilder().setDaemon(<span class="keyword">true</span>).setNameFormat(<span class="string">"schedule"</span>)</pre></td></tr>
<tr> <td class="numLine">&nbsp;283</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; .build());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;284</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; Watchdog watchdog = <span class="keyword">new</span> Watchdog(scheduleExecutor);</pre></td></tr>
<tr> <td class="numLine">&nbsp;285</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;286</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// The cachedThreadPool implementation created here is considerably better</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;287</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// than using ThreadPoolExecutor. ThreadPoolExecutor does not create threads</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;288</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// as would be expected from a thread pool.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;289</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; backgroundExecutor = Executors.newCachedThreadPool(</pre></td></tr>
<tr> <td class="numLine">&nbsp;290</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> ThreadFactoryBuilder().setDaemon(<span class="keyword">true</span>).setNameFormat(<span class="string">"background"</span>)</pre></td></tr>
<tr> <td class="numLine">&nbsp;291</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; .build());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;292</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; backgroundExecutor.execute(waiter.runnable(asyncDocIdSender.worker()));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;293</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; DocumentHandler docHandler = <span class="keyword">new</span> DocumentHandler(</pre></td></tr>
<tr> <td class="numLine">&nbsp;294</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; docIdCodec, docIdCodec, journal, adaptor, adaptorContext.authzAuthority,</pre></td></tr>
<tr> <td class="numLine">&nbsp;295</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getGsaHostname(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;296</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getServerFullAccessHosts(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;297</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; samlServiceProvider, createTransformPipeline(), aclTransform,</pre></td></tr>
<tr> <td class="numLine">&nbsp;298</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.isServerToUseCompression(), watchdog,</pre></td></tr>
<tr> <td class="numLine">&nbsp;299</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; asyncDocIdSender, </pre></td></tr>
<tr> <td class="numLine">&nbsp;300</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.doesGsaAcceptDocControlsHeader(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;301</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.markAllDocsAsPublic(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;302</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getAdaptorDocHeaderTimeoutMillis(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;303</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getAdaptorDocContentTimeoutMillis(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;304</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getScoringType());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;305</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; String handlerPath = config.getServerBaseUri().getPath()</pre></td></tr>
<tr> <td class="numLine">&nbsp;306</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + config.getServerDocIdPath();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;307</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; addFilters(scope.createContext(handlerPath, docHandler));</pre></td></tr>
<tr> <td class="numLine">&nbsp;308</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;309</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Start communicating with other services. As a general rule, by this time</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;310</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// we want all services we provide to be up and running. However, note that</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;311</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// the adaptor may have started sending feeds as soon as we called init(),</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;312</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// and that is "okay." In addition, the HttpServer we were provided may not</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;313</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// have been started yet.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;314</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;315</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; scheduler = <span class="keyword">new</span> CronScheduler(scheduleExecutor);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;316</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; docIdFullPusher = <span class="keyword">new</span> OneAtATimeRunnable(</pre></td></tr>
<tr> <td class="numLine">&nbsp;317</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> PushRunnable(adaptorContext.fullExceptionHandler),</pre></td></tr>
<tr> <td class="numLine">&nbsp;318</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> AlreadyRunningRunnable());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;319</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; sendDocIdsFuture = scheduler.schedule(</pre></td></tr>
<tr> <td class="numLine">&nbsp;320</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getAdaptorFullListingSchedule(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;321</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; waiter.runnable(<span class="keyword">new</span> BackgroundRunnable(docIdFullPusher)));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;322</td> <td class="nbHitsCovered"><a title="Line 322: Conditional coverage 100% (2/2).">&nbsp;15</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 322: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (config.isAdaptorPushDocIdsOnStartup()) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;323</td> <td class="nbHitsCovered">&nbsp;11</td> <td class="src"><pre class="src">&nbsp; log.info(<span class="string">"Pushing once at program start"</span>);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;324</td> <td class="nbHitsCovered">&nbsp;11</td> <td class="src"><pre class="src">&nbsp; checkAndScheduleImmediatePushOfDocIds();</pre></td></tr>
<tr> <td class="numLine">&nbsp;325</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;326</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;327</td> <td class="nbHitsCovered"><a title="Line 327: Conditional coverage 100% (2/2).">&nbsp;15</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 327: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (adaptorContext.pollingIncrementalLister != <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;328</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; docIdIncrementalPusher = <span class="keyword">new</span> OneAtATimeRunnable(</pre></td></tr>
<tr> <td class="numLine">&nbsp;329</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> IncrementalPushRunnable(adaptorContext.pollingIncrementalLister,</pre></td></tr>
<tr> <td class="numLine">&nbsp;330</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; adaptorContext.incrExceptionHandler),</pre></td></tr>
<tr> <td class="numLine">&nbsp;331</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> AlreadyRunningRunnable());</pre></td></tr>
<tr> <td class="numLine">&nbsp;332</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;333</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; scheduleExecutor.scheduleAtFixedRate(</pre></td></tr>
<tr> <td class="numLine">&nbsp;334</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; waiter.runnable(<span class="keyword">new</span> BackgroundRunnable(docIdIncrementalPusher)),</pre></td></tr>
<tr> <td class="numLine">&nbsp;335</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; 0,</pre></td></tr>
<tr> <td class="numLine">&nbsp;336</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.getAdaptorIncrementalPollPeriodMillis(),</pre></td></tr>
<tr> <td class="numLine">&nbsp;337</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; TimeUnit.MILLISECONDS);</pre></td></tr>
<tr> <td class="numLine">&nbsp;338</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;339</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;340</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; dashboard = <span class="keyword">new</span> Dashboard(config, <span class="keyword">this</span>, journal, sessionManager,</pre></td></tr>
<tr> <td class="numLine">&nbsp;341</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; secureValueCodec, adaptor, adaptorContext.statusSources);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;342</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; dashboard.start(dashboardScope);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;343</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;344</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; </pre></td></tr>
<tr> <td class="numLine">&nbsp;345</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">void</span> tryToPutVersionIntoConfig() <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLine">&nbsp;346</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;347</td> <td class="nbHitsUncovered"><a title="Line 347: Conditional coverage 50% (1/2).">&nbsp;13</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 347: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (<span class="string">"GENERATE"</span>.equals(config.getGsaVersion())) { <span class="comment">// is not set</span></a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;348</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; GsaVersion ver = GsaVersion.get(config.getGsaHostname(),</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;349</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; config.isServerSecure());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;350</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; config.overrideKey(<span class="string">"gsa.version"</span>, <span class="string">""</span> + ver);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;351</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;352</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (FileNotFoundException fne) {</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;353</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// we're talking to an older GSA that cannot tell us its version.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;354</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; log.log(Level.FINE, <span class="string">"gsa didn't provide version"</span>, fne);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;355</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; config.setValue(<span class="string">"gsa.version"</span>, <span class="string">"7.0.14-114"</span>);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;356</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (IllegalArgumentException iae) {</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;357</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// we're talking to a GSA whose version we don't understand </span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;358</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; log.log(Level.FINE, <span class="string">"gsa provided incomprehensible version"</span>, iae);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;359</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; config.setValue(<span class="string">"gsa.version"</span>, <span class="string">"7.0.14-114"</span>);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;360</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (IOException ioe) {</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;361</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> handleGsaException(config.getGsaHostname(), ioe);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;362</td> <td class="nbHitsCovered">&nbsp;13</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;363</td> <td class="nbHitsCovered">&nbsp;13</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;364</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;365</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> TransformPipeline createTransformPipeline() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;366</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> createTransformPipeline(config.getTransformPipelineSpec());</pre></td></tr>
<tr> <td class="numLine">&nbsp;367</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;368</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;369</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; @VisibleForTesting</pre></td></tr>
<tr> <td class="numLine">&nbsp;370</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">static</span> TransformPipeline createTransformPipeline(</pre></td></tr>
<tr> <td class="numLine">&nbsp;371</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; List&lt;Map&lt;String, String&gt;&gt; pipelineConfig) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;372</td> <td class="nbHitsCovered">&nbsp;23</td> <td class="src"><pre class="src">&nbsp; List&lt;DocumentTransform&gt; elements = <span class="keyword">new</span> LinkedList&lt;DocumentTransform&gt;();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;373</td> <td class="nbHitsCovered">&nbsp;23</td> <td class="src"><pre class="src">&nbsp; List&lt;String&gt; names = <span class="keyword">new</span> LinkedList&lt;String&gt;();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;374</td> <td class="nbHitsCovered"><a title="Line 374: Conditional coverage 100% (2/2).">&nbsp;23</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 374: Conditional coverage 100% (2/2)."> <span class="keyword">for</span> (Map&lt;String, String&gt; element : pipelineConfig) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;375</td> <td class="nbHitsCovered">&nbsp;7</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">final</span> String name = element.get(<span class="string">"name"</span>);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;376</td> <td class="nbHitsCovered">&nbsp;7</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">final</span> String confPrefix = <span class="string">"transform.pipeline."</span> + name + <span class="string">"."</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;377</td> <td class="nbHitsCovered">&nbsp;7</td> <td class="src"><pre class="src">&nbsp; String factoryMethodName = element.get(<span class="string">"factoryMethod"</span>);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;378</td> <td class="nbHitsCovered"><a title="Line 378: Conditional coverage 100% (2/2).">&nbsp;7</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 378: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (factoryMethodName == <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;379</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(</pre></td></tr>
<tr> <td class="numLine">&nbsp;380</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="string">"Missing "</span> + confPrefix + <span class="string">"factoryMethod configuration setting"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;381</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;382</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">int</span> sepIndex = factoryMethodName.lastIndexOf(<span class="string">"."</span>);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;383</td> <td class="nbHitsCovered"><a title="Line 383: Conditional coverage 100% (2/2).">&nbsp;6</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 383: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (sepIndex == -1) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;384</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(<span class="string">"Could not separate method name from class "</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;385</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">"name"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;386</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;387</td> <td class="nbHitsCovered">&nbsp;5</td> <td class="src"><pre class="src">&nbsp; String className = factoryMethodName.substring(0, sepIndex);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;388</td> <td class="nbHitsCovered">&nbsp;5</td> <td class="src"><pre class="src">&nbsp; String methodName = factoryMethodName.substring(sepIndex + 1);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;389</td> <td class="nbHitsCovered">&nbsp;5</td> <td class="src"><pre class="src">&nbsp; log.log(Level.FINE, <span class="string">"Split {0} into class {1} and method {2}"</span>,</pre></td></tr>
<tr> <td class="numLine">&nbsp;390</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> Object[] {factoryMethodName, className, methodName});</pre></td></tr>
<tr> <td class="numLine">&nbsp;391</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; Class&lt;?&gt; klass;</pre></td></tr>
<tr> <td class="numLine">&nbsp;392</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;393</td> <td class="nbHitsCovered">&nbsp;5</td> <td class="src"><pre class="src">&nbsp; klass = Class.forName(className);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;394</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; } <span class="keyword">catch</span> (ClassNotFoundException ex) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;395</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(</pre></td></tr>
<tr> <td class="numLine">&nbsp;396</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="string">"Could not load class for transform "</span> + name, ex);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;397</td> <td class="nbHitsCovered">&nbsp;4</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;398</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; Method method;</pre></td></tr>
<tr> <td class="numLine">&nbsp;399</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;400</td> <td class="nbHitsCovered">&nbsp;4</td> <td class="src"><pre class="src">&nbsp; method = klass.getDeclaredMethod(methodName, Map.<span class="keyword">class</span>);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;401</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; } <span class="keyword">catch</span> (NoSuchMethodException ex) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;402</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(<span class="string">"Could not find method "</span> + methodName</pre></td></tr>
<tr> <td class="numLine">&nbsp;403</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">" on class "</span> + className, ex);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;404</td> <td class="nbHitsCovered">&nbsp;3</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;405</td> <td class="nbHitsCovered">&nbsp;3</td> <td class="src"><pre class="src">&nbsp; log.log(Level.FINE, <span class="string">"Found method {0}"</span>, <span class="keyword">new</span> Object[] {method});</pre></td></tr>
<tr> <td class="numLine">&nbsp;406</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; Object o;</pre></td></tr>
<tr> <td class="numLine">&nbsp;407</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;408</td> <td class="nbHitsCovered">&nbsp;3</td> <td class="src"><pre class="src">&nbsp; o = method.invoke(<span class="keyword">null</span>, Collections.unmodifiableMap(element));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;409</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; } <span class="keyword">catch</span> (Exception ex) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;410</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(<span class="string">"Failure while running factory method "</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;411</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + factoryMethodName, ex);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;412</td> <td class="nbHitsCovered">&nbsp;2</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;413</td> <td class="nbHitsCovered"><a title="Line 413: Conditional coverage 100% (2/2).">&nbsp;2</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 413: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (!(o <span class="keyword">instanceof</span> DocumentTransform)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;414</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> ClassCastException(o.getClass().getName()</pre></td></tr>
<tr> <td class="numLine">&nbsp;415</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">" is not an instance of DocumentTransform"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;416</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;417</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; DocumentTransform transform = (DocumentTransform) o;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;418</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; elements.add(transform);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;419</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; names.add(name);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;420</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;421</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// If we created an empty pipeline, then we don't need the pipeline at all.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;422</td> <td class="nbHitsCovered"><a title="Line 422: Conditional coverage 100% (2/2).">&nbsp;17</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 422: Conditional coverage 100% (2/2)."> <span class="keyword">return</span> elements.size() &gt; 0 ? <span class="keyword">new</span> TransformPipeline(elements, names) : <span class="keyword">null</span>;</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;423</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;424</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;425</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> AclTransform createAclTransform() {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;426</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> createAclTransform(config.getValuesWithPrefix(<span class="string">"transform.acl."</span>));</pre></td></tr>
<tr> <td class="numLine">&nbsp;427</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;428</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;429</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; @VisibleForTesting</pre></td></tr>
<tr> <td class="numLine">&nbsp;430</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">static</span> AclTransform createAclTransform(Map&lt;String, String&gt; aclConfigRaw) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;431</td> <td class="nbHitsCovered">&nbsp;20</td> <td class="src"><pre class="src">&nbsp; Map&lt;Integer, String&gt; aclConfig = <span class="keyword">new</span> TreeMap&lt;Integer, String&gt;();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;432</td> <td class="nbHitsCovered"><a title="Line 432: Conditional coverage 100% (2/2).">&nbsp;20</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 432: Conditional coverage 100% (2/2)."> <span class="keyword">for</span> (Map.Entry&lt;String, String&gt; me : aclConfigRaw.entrySet()) {</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;433</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;434</td> <td class="nbHitsCovered">&nbsp;9</td> <td class="src"><pre class="src">&nbsp; aclConfig.put(Integer.parseInt(me.getKey()), me.getValue());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;435</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; } <span class="keyword">catch</span> (NumberFormatException ex) {</pre></td></tr>
<tr> <td class="numLine">&nbsp;436</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// Don't insert into map.</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;437</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; log.log(Level.FINE, <span class="string">"Ignorning transform.acl.{0} because {0} is not an "</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;438</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + <span class="string">"integer"</span>, me.getKey());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;439</td> <td class="nbHitsCovered">&nbsp;17</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;440</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;441</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;442</td> <td class="nbHitsCovered">&nbsp;20</td> <td class="src"><pre class="src">&nbsp; List&lt;AclTransform.Rule&gt; rules = <span class="keyword">new</span> LinkedList&lt;AclTransform.Rule&gt;();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;443</td> <td class="nbHitsCovered"><a title="Line 443: Conditional coverage 100% (2/2).">&nbsp;20</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 443: Conditional coverage 100% (2/2)."> <span class="keyword">for</span> (String value : aclConfig.values()) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;444</td> <td class="nbHitsCovered">&nbsp;8</td> <td class="src"><pre class="src">&nbsp; String[] parts = value.split(<span class="string">";"</span>, 2);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;445</td> <td class="nbHitsCovered"><a title="Line 445: Conditional coverage 100% (2/2).">&nbsp;8</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 445: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (parts.length != 2) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;446</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; log.log(Level.WARNING, <span class="string">"Could not find semicolon in acl transform: {0}"</span>,</pre></td></tr>
<tr> <td class="numLine">&nbsp;447</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; value);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;448</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">continue</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;449</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;450</td> <td class="nbHitsCovered">&nbsp;7</td> <td class="src"><pre class="src">&nbsp; AclTransform.MatchData search = parseAclTransformMatchData(parts[0]);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;451</td> <td class="nbHitsCovered">&nbsp;7</td> <td class="src"><pre class="src">&nbsp; AclTransform.MatchData replace = parseAclTransformMatchData(parts[1]);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;452</td> <td class="nbHitsUncovered"><a title="Line 452: Conditional coverage 75% (3/4) [each condition: 100%, 50%].">&nbsp;7</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 452: Conditional coverage 75% (3/4) [each condition: 100%, 50%]."> <span class="keyword">if</span> (search == <span class="keyword">null</span> || replace == <span class="keyword">null</span>) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;453</td> <td class="nbHitsCovered">&nbsp;3</td> <td class="src"><pre class="src">&nbsp; log.log(Level.WARNING,</pre></td></tr>
<tr> <td class="numLine">&nbsp;454</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="string">"Could not parse acl transform rule: {0}"</span>, value);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;455</td> <td class="nbHitsCovered">&nbsp;3</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">continue</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;456</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;457</td> <td class="nbHitsCovered"><a title="Line 457: Conditional coverage 100% (2/2).">&nbsp;4</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 457: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (replace.isGroup != <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;458</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; log.log(Level.WARNING,</pre></td></tr>
<tr> <td class="numLine">&nbsp;459</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="string">"Replacement cannot change type. Failed in rule: {0}"</span>, value);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;460</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">continue</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;461</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;462</td> <td class="nbHitsCovered">&nbsp;3</td> <td class="src"><pre class="src">&nbsp; rules.add(<span class="keyword">new</span> AclTransform.Rule(search, replace));</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;463</td> <td class="nbHitsCovered">&nbsp;3</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;464</td> <td class="nbHitsCovered">&nbsp;20</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> <span class="keyword">new</span> AclTransform(rules);</pre></td></tr>
<tr> <td class="numLine">&nbsp;465</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;466</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;467</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> AclTransform.MatchData parseAclTransformMatchData(String s) {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;468</td> <td class="nbHitsCovered">&nbsp;14</td> <td class="src"><pre class="src">&nbsp; String[] decls = s.split(<span class="string">","</span>, -1);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;469</td> <td class="nbHitsCovered"><a title="Line 469: Conditional coverage 100% (4/4) [each condition: 100%, 100%].">&nbsp;14</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 469: Conditional coverage 100% (4/4) [each condition: 100%, 100%]."> <span class="keyword">if</span> (decls.length == 1 &amp;&amp; decls[0].trim().equals(<span class="string">""</span>)) {</a></pre></td></tr>
<tr> <td class="numLine">&nbsp;470</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">// No declarations are required</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;471</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> <span class="keyword">new</span> AclTransform.MatchData(<span class="keyword">null</span>, <span class="keyword">null</span>, <span class="keyword">null</span>, <span class="keyword">null</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;472</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;473</td> <td class="nbHitsCovered">&nbsp;13</td> <td class="src"><pre class="src">&nbsp; Boolean isGroup = <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;474</td> <td class="nbHitsCovered">&nbsp;13</td> <td class="src"><pre class="src">&nbsp; String name = <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;475</td> <td class="nbHitsCovered">&nbsp;13</td> <td class="src"><pre class="src">&nbsp; String domain = <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;476</td> <td class="nbHitsCovered">&nbsp;13</td> <td class="src"><pre class="src">&nbsp; String namespace = <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;477</td> <td class="nbHitsCovered"><a title="Line 477: Conditional coverage 100% (2/2).">&nbsp;25</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 477: Conditional coverage 100% (2/2)."> <span class="keyword">for</span> (String decl : decls) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;478</td> <td class="nbHitsCovered">&nbsp;15</td> <td class="src"><pre class="src">&nbsp; String parts[] = decl.split(<span class="string">"="</span>, 2);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;479</td> <td class="nbHitsCovered"><a title="Line 479: Conditional coverage 100% (2/2).">&nbsp;15</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 479: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (parts.length != 2) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;480</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; log.log(Level.WARNING,</pre></td></tr>
<tr> <td class="numLine">&nbsp;481</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="string">"Could not find \"=\" in \"{0}\" as part of \"{1}\""</span>,</pre></td></tr>
<tr> <td class="numLine">&nbsp;482</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> Object[] {decl, s});</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;483</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;484</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;485</td> <td class="nbHitsCovered">&nbsp;14</td> <td class="src"><pre class="src">&nbsp; String key = parts[0].trim();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;486</td> <td class="nbHitsCovered">&nbsp;14</td> <td class="src"><pre class="src">&nbsp; String value = parts[1];</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;487</td> <td class="nbHitsCovered"><a title="Line 487: Conditional coverage 100% (2/2).">&nbsp;14</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 487: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (key.equals(<span class="string">"type"</span>)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;488</td> <td class="nbHitsCovered"><a title="Line 488: Conditional coverage 100% (2/2).">&nbsp;4</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 488: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (value.equals(<span class="string">"group"</span>)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;489</td> <td class="nbHitsCovered">&nbsp;2</td> <td class="src"><pre class="src">&nbsp; isGroup = <span class="keyword">true</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;490</td> <td class="nbHitsCovered"><a title="Line 490: Conditional coverage 100% (2/2).">&nbsp;2</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 490: Conditional coverage 100% (2/2)."> } <span class="keyword">else</span> <span class="keyword">if</span> (value.equals(<span class="string">"user"</span>)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;491</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; isGroup = <span class="keyword">false</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;492</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">else</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;493</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; log.log(Level.WARNING, <span class="string">"Unknown type \"{0}\" as part of \"{1}\""</span>,</pre></td></tr>
<tr> <td class="numLine">&nbsp;494</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> Object[] {value, s});</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;495</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;496</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;497</td> <td class="nbHitsCovered"><a title="Line 497: Conditional coverage 100% (2/2).">&nbsp;10</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 497: Conditional coverage 100% (2/2)."> } <span class="keyword">else</span> <span class="keyword">if</span> (key.equals(<span class="string">"name"</span>)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;498</td> <td class="nbHitsCovered">&nbsp;6</td> <td class="src"><pre class="src">&nbsp; name = value;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;499</td> <td class="nbHitsCovered"><a title="Line 499: Conditional coverage 100% (2/2).">&nbsp;4</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 499: Conditional coverage 100% (2/2)."> } <span class="keyword">else</span> <span class="keyword">if</span> (key.equals(<span class="string">"domain"</span>)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;500</td> <td class="nbHitsCovered">&nbsp;2</td> <td class="src"><pre class="src">&nbsp; domain = value;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;501</td> <td class="nbHitsCovered"><a title="Line 501: Conditional coverage 100% (2/2).">&nbsp;2</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 501: Conditional coverage 100% (2/2)."> } <span class="keyword">else</span> <span class="keyword">if</span> (key.equals(<span class="string">"namespace"</span>)) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;502</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; namespace = value;</pre></td></tr>
<tr> <td class="numLine">&nbsp;503</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">else</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;504</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; log.log(Level.WARNING, <span class="string">"Unknown key \"{0}\" as part of \"{1}\""</span>,</pre></td></tr>
<tr> <td class="numLine">&nbsp;505</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">new</span> Object[] {key, s});</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;506</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;507</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;508</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;509</td> <td class="nbHitsCovered">&nbsp;10</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> <span class="keyword">new</span> AclTransform.MatchData(isGroup, name, domain, namespace);</pre></td></tr>
<tr> <td class="numLine">&nbsp;510</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;511</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;512</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;513</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * Retrieve our default KeyPair from the default keystore. The key should have</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;514</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> * the same password as the keystore.</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;515</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;516</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">private</span> <span class="keyword">static</span> KeyPair getKeyPair(String alias) <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;517</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">final</span> String keystoreKey = <span class="string">"javax.net.ssl.keyStore"</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;518</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">final</span> String keystorePasswordKey = <span class="string">"javax.net.ssl.keyStorePassword"</span>;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;519</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; String keystore = System.getProperty(keystoreKey);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;520</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; String keystoreType = System.getProperty(<span class="string">"javax.net.ssl.keyStoreType"</span>,</pre></td></tr>
<tr> <td class="numLine">&nbsp;521</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; KeyStore.getDefaultType());</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;522</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; String keystorePassword = System.getProperty(keystorePasswordKey);</pre></td></tr>
<tr> <td class="numLine">&nbsp;523</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;524</td> <td class="nbHitsUncovered"><a title="Line 524: Conditional coverage 50% (1/2).">&nbsp;18</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 524: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (keystore == <span class="keyword">null</span>) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;525</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> NullPointerException(<span class="string">"You must set "</span> + keystoreKey);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;526</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;527</td> <td class="nbHitsUncovered"><a title="Line 527: Conditional coverage 50% (1/2).">&nbsp;18</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 527: Conditional coverage 50% (1/2)."> <span class="keyword">if</span> (keystorePassword == <span class="keyword">null</span>) {</a></span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;528</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> NullPointerException(<span class="string">"You must set "</span> + keystorePasswordKey);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;529</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;530</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;531</td> <td class="nbHitsCovered">&nbsp;18</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">return</span> getKeyPair(alias, keystore, keystoreType, keystorePassword);</pre></td></tr>
<tr> <td class="numLine">&nbsp;532</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLine">&nbsp;533</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr> <td class="numLine">&nbsp;534</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">static</span> KeyPair getKeyPair(String alias, String keystoreFile,</pre></td></tr>
<tr> <td class="numLine">&nbsp;535</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; String keystoreType, String keystorePasswordStr) <span class="keyword">throws</span> IOException {</pre></td></tr>
<tr> <td class="numLine">&nbsp;536</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; PrivateKey privateKey;</pre></td></tr>
<tr> <td class="numLine">&nbsp;537</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; PublicKey publicKey;</pre></td></tr>
<tr> <td class="numLine">&nbsp;538</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;539</td> <td class="nbHitsCovered">&nbsp;22</td> <td class="src"><pre class="src">&nbsp; KeyStore ks = KeyStore.getInstance(keystoreType);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;540</td> <td class="nbHitsCovered">&nbsp;21</td> <td class="src"><pre class="src">&nbsp; InputStream ksis = <span class="keyword">new</span> FileInputStream(keystoreFile);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;541</td> <td class="nbHitsUncovered"><a title="Line 541: Conditional coverage 50% (1/2).">&nbsp;20</a></td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<a title="Line 541: Conditional coverage 50% (1/2)."> <span class="keyword">char</span>[] keystorePassword = keystorePasswordStr == <span class="keyword">null</span> ? <span class="keyword">null</span></a></span></pre></td></tr>
<tr> <td class="numLine">&nbsp;542</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; : keystorePasswordStr.toCharArray();</pre></td></tr>
<tr> <td class="numLine">&nbsp;543</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;544</td> <td class="nbHitsCovered">&nbsp;20</td> <td class="src"><pre class="src">&nbsp; ks.load(ksis, keystorePassword);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;545</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (NoSuchAlgorithmException ex) {</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;546</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(ex);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;547</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (CertificateException ex) {</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;548</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(ex);</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;549</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; } <span class="keyword">finally</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;550</td> <td class="nbHitsCovered">&nbsp;20</td> <td class="src"><pre class="src">&nbsp; ksis.close();</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;551</td> <td class="nbHitsCovered">&nbsp;20</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;552</td> <td class="nbHitsCovered">&nbsp;20</td> <td class="src"><pre class="src">&nbsp; Key key = <span class="keyword">null</span>;</pre></td></tr>
<tr> <td class="numLine">&nbsp;553</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; <span class="keyword">try</span> {</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;554</td> <td class="nbHitsCovered">&nbsp;20</td> <td class="src"><pre class="src">&nbsp; key = ks.getKey(alias, keystorePassword);</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;555</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (NoSuchAlgorithmException ex) {</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;556</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(ex);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;557</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; } <span class="keyword">catch</span> (UnrecoverableKeyException ex) {</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;558</td> <td class="nbHitsUncovered">&nbsp;0</td> <td class="src"><pre class="src"><span class="srcUncovered">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(ex);</span></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;559</td> <td class="nbHitsCovered">&nbsp;20</td> <td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;560</td> <td class="nbHitsCovered"><a title="Line 560: Conditional coverage 100% (2/2).">&nbsp;20</a></td> <td class="src"><pre class="src">&nbsp;<a title="Line 560: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (key == <span class="keyword">null</span>) {</a></pre></td></tr>
<tr> <td class="numLineCover">&nbsp;561</td> <td class="nbHitsCovered">&nbsp;1</td> <td class="src"><pre class="src">&nbsp; <span class="keyword">throw</span> <span class="keyword">new</span> IllegalStateException(<span class="string">"Could not find key for alias '"</span></pre></td></tr>
<tr> <td class="numLine">&nbsp;562</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; + alias + <span class="string">"'"</span>);</pre></td></tr>
<tr> <td class="numLine">&nbsp;563</td> <td class="nbHits">&nbsp;</td>
<td class="src"><pre class="src">&nbsp; }</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;564</td> <td class="nbHitsCovered">&nbsp;19</td> <td class="src"><pre class="src">&nbsp; privateKey = (PrivateKey) key;</pre></td></tr>
<tr> <td class="numLineCover">&nbsp;565</td> <td class="nbHitsCovered">&nbsp;19</td> <td class="src"><pre class