hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1750192 [12/18] - in /httpcomponents/site/httpcomponents-asyncclient-4.1.x: ./ httpasyncclient-cache/ httpasyncclient-cache/apidocs/ httpasyncclient-cache/apidocs/org/apache/http/impl/client/cache/ httpasyncclient-cache/apidocs/org/apache/...
Date Sat, 25 Jun 2016 09:37:09 GMT
Modified: httpcomponents/site/httpcomponents-asyncclient-4.1.x/httpasyncclient/xref/org/apache/http/impl/nio/client/CloseableHttpPipeliningClient.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-asyncclient-4.1.x/httpasyncclient/xref/org/apache/http/impl/nio/client/CloseableHttpPipeliningClient.html?rev=1750192&r1=1750191&r2=1750192&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-asyncclient-4.1.x/httpasyncclient/xref/org/apache/http/impl/nio/client/CloseableHttpPipeliningClient.html
(original)
+++ httpcomponents/site/httpcomponents-asyncclient-4.1.x/httpasyncclient/xref/org/apache/http/impl/nio/client/CloseableHttpPipeliningClient.html
Sat Jun 25 09:35:53 2016
@@ -43,63 +43,64 @@
 <a class="jxr_linenumber" name="33" href="#33">33</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.HttpHost;
 <a class="jxr_linenumber" name="34" href="#34">34</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.HttpRequest;
 <a class="jxr_linenumber" name="35" href="#35">35</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.HttpResponse;
-<a class="jxr_linenumber" name="36" href="#36">36</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.annotation.ThreadSafe;
-<a class="jxr_linenumber" name="37" href="#37">37</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.client.protocol.HttpClientContext;
-<a class="jxr_linenumber" name="38" href="#38">38</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.concurrent.FutureCallback;
-<a class="jxr_linenumber" name="39" href="#39">39</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.nio.client.HttpPipeliningClient;
-<a class="jxr_linenumber" name="40" href="#40">40</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.nio.client.methods.HttpAsyncMethods;
-<a class="jxr_linenumber" name="41" href="#41">41</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.nio.protocol.HttpAsyncRequestProducer;
-<a class="jxr_linenumber" name="42" href="#42">42</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.nio.protocol.HttpAsyncResponseConsumer;
-<a class="jxr_linenumber" name="43" href="#43">43</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.protocol.HttpContext;
-<a class="jxr_linenumber" name="44" href="#44">44</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.util.Args;
-<a class="jxr_linenumber" name="45" href="#45">45</a>  
-<a class="jxr_linenumber" name="46" href="#46">46</a>  <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="47" href="#47">47</a>  <em class="jxr_javadoccomment">
* Base implementation of {@link org.apache.http.nio.client.HttpPipeliningClient} that also</em>
-<a class="jxr_linenumber" name="48" href="#48">48</a>  <em class="jxr_javadoccomment">
* implements {@link java.io.Closeable}.</em>
-<a class="jxr_linenumber" name="49" href="#49">49</a>  <em class="jxr_javadoccomment">
*</em>
-<a class="jxr_linenumber" name="50" href="#50">50</a>  <em class="jxr_javadoccomment">
* @since 4.1</em>
-<a class="jxr_linenumber" name="51" href="#51">51</a>  <em class="jxr_javadoccomment">
*/</em>
-<a class="jxr_linenumber" name="52" href="#52">52</a>  @ThreadSafe
-<a class="jxr_linenumber" name="53" href="#53">53</a>  <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">class</strong>
<a href="../../../../../../org/apache/http/impl/nio/client/CloseableHttpPipeliningClient.html">CloseableHttpPipeliningClient</a>
-<a class="jxr_linenumber" name="54" href="#54">54</a>          <strong class="jxr_keyword">extends</strong>
<a href="../../../../../../org/apache/http/impl/nio/client/CloseableHttpAsyncClient.html">CloseableHttpAsyncClient</a>
<strong class="jxr_keyword">implements</strong> <a href="../../../../../../org/apache/http/nio/client/HttpPipeliningClient.html">HttpPipeliningClient</a>
{
-<a class="jxr_linenumber" name="55" href="#55">55</a>  
-<a class="jxr_linenumber" name="56" href="#56">56</a>      @Override
-<a class="jxr_linenumber" name="57" href="#57">57</a>      <strong class="jxr_keyword">public</strong>
&lt;T&gt; Future&lt;List&lt;T&gt;&gt; execute(
-<a class="jxr_linenumber" name="58" href="#58">58</a>              <strong
class="jxr_keyword">final</strong> HttpHost target,
-<a class="jxr_linenumber" name="59" href="#59">59</a>              <strong
class="jxr_keyword">final</strong> List&lt;? <strong class="jxr_keyword">extends</strong>
HttpAsyncRequestProducer&gt; requestProducers,
-<a class="jxr_linenumber" name="60" href="#60">60</a>              <strong
class="jxr_keyword">final</strong> List&lt;? <strong class="jxr_keyword">extends</strong>
HttpAsyncResponseConsumer&lt;T&gt;&gt; responseConsumers,
-<a class="jxr_linenumber" name="61" href="#61">61</a>              <strong
class="jxr_keyword">final</strong> FutureCallback&lt;List&lt;T&gt;&gt;
callback) {
-<a class="jxr_linenumber" name="62" href="#62">62</a>          <strong class="jxr_keyword">return</strong>
execute(target, requestProducers, responseConsumers, HttpClientContext.create(), callback);
-<a class="jxr_linenumber" name="63" href="#63">63</a>      }
-<a class="jxr_linenumber" name="64" href="#64">64</a>  
-<a class="jxr_linenumber" name="65" href="#65">65</a>      @Override
-<a class="jxr_linenumber" name="66" href="#66">66</a>      <strong class="jxr_keyword">public</strong>
Future&lt;List&lt;HttpResponse&gt;&gt; execute(
-<a class="jxr_linenumber" name="67" href="#67">67</a>              <strong
class="jxr_keyword">final</strong> HttpHost target,
-<a class="jxr_linenumber" name="68" href="#68">68</a>              <strong
class="jxr_keyword">final</strong> List&lt;HttpRequest&gt; requests,
-<a class="jxr_linenumber" name="69" href="#69">69</a>              <strong
class="jxr_keyword">final</strong> FutureCallback&lt;List&lt;HttpResponse&gt;&gt;
callback) {
-<a class="jxr_linenumber" name="70" href="#70">70</a>          <strong class="jxr_keyword">return</strong>
execute(target, requests, HttpClientContext.create(), callback);
-<a class="jxr_linenumber" name="71" href="#71">71</a>      }
-<a class="jxr_linenumber" name="72" href="#72">72</a>  
-<a class="jxr_linenumber" name="73" href="#73">73</a>      @Override
-<a class="jxr_linenumber" name="74" href="#74">74</a>      <strong class="jxr_keyword">public</strong>
Future&lt;List&lt;HttpResponse&gt;&gt; execute(
-<a class="jxr_linenumber" name="75" href="#75">75</a>              <strong
class="jxr_keyword">final</strong> HttpHost target,
-<a class="jxr_linenumber" name="76" href="#76">76</a>              <strong
class="jxr_keyword">final</strong> List&lt;HttpRequest&gt; requests,
-<a class="jxr_linenumber" name="77" href="#77">77</a>              <strong
class="jxr_keyword">final</strong> HttpContext context,
-<a class="jxr_linenumber" name="78" href="#78">78</a>              <strong
class="jxr_keyword">final</strong> FutureCallback&lt;List&lt;HttpResponse&gt;&gt;
callback) {
-<a class="jxr_linenumber" name="79" href="#79">79</a>          Args.notEmpty(requests,
<span class="jxr_string">"HTTP request list"</span>);
-<a class="jxr_linenumber" name="80" href="#80">80</a>          <strong class="jxr_keyword">final</strong>
List&lt;HttpAsyncRequestProducer&gt; requestProducers = <strong class="jxr_keyword">new</strong>
ArrayList&lt;HttpAsyncRequestProducer&gt;(
-<a class="jxr_linenumber" name="81" href="#81">81</a>                  requests.size());
-<a class="jxr_linenumber" name="82" href="#82">82</a>          <strong class="jxr_keyword">final</strong>
List&lt;HttpAsyncResponseConsumer&lt;HttpResponse&gt;&gt; responseConsumers
= <strong class="jxr_keyword">new</strong> ArrayList&lt;HttpAsyncResponseConsumer&lt;HttpResponse&gt;&gt;(
-<a class="jxr_linenumber" name="83" href="#83">83</a>                  requests.size());
-<a class="jxr_linenumber" name="84" href="#84">84</a>          <strong class="jxr_keyword">for</strong>
(<strong class="jxr_keyword">int</strong> i = 0; i &lt; requests.size(); i++)
{
-<a class="jxr_linenumber" name="85" href="#85">85</a>              <strong
class="jxr_keyword">final</strong> HttpRequest request = requests.get(i);
-<a class="jxr_linenumber" name="86" href="#86">86</a>              requestProducers.add(HttpAsyncMethods.create(target,
request));
-<a class="jxr_linenumber" name="87" href="#87">87</a>              responseConsumers.add(HttpAsyncMethods.createConsumer());
-<a class="jxr_linenumber" name="88" href="#88">88</a>          }
-<a class="jxr_linenumber" name="89" href="#89">89</a>          <strong class="jxr_keyword">return</strong>
execute(target, requestProducers, responseConsumers, context, callback);
-<a class="jxr_linenumber" name="90" href="#90">90</a>      }
-<a class="jxr_linenumber" name="91" href="#91">91</a>  
-<a class="jxr_linenumber" name="92" href="#92">92</a>  }
+<a class="jxr_linenumber" name="36" href="#36">36</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.annotation.Contract;
+<a class="jxr_linenumber" name="37" href="#37">37</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.annotation.ThreadingBehavior;
+<a class="jxr_linenumber" name="38" href="#38">38</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.client.protocol.HttpClientContext;
+<a class="jxr_linenumber" name="39" href="#39">39</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.concurrent.FutureCallback;
+<a class="jxr_linenumber" name="40" href="#40">40</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.nio.client.HttpPipeliningClient;
+<a class="jxr_linenumber" name="41" href="#41">41</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.nio.client.methods.HttpAsyncMethods;
+<a class="jxr_linenumber" name="42" href="#42">42</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.nio.protocol.HttpAsyncRequestProducer;
+<a class="jxr_linenumber" name="43" href="#43">43</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.nio.protocol.HttpAsyncResponseConsumer;
+<a class="jxr_linenumber" name="44" href="#44">44</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.protocol.HttpContext;
+<a class="jxr_linenumber" name="45" href="#45">45</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.util.Args;
+<a class="jxr_linenumber" name="46" href="#46">46</a>  
+<a class="jxr_linenumber" name="47" href="#47">47</a>  <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="48" href="#48">48</a>  <em class="jxr_javadoccomment">
* Base implementation of {@link org.apache.http.nio.client.HttpPipeliningClient} that also</em>
+<a class="jxr_linenumber" name="49" href="#49">49</a>  <em class="jxr_javadoccomment">
* implements {@link java.io.Closeable}.</em>
+<a class="jxr_linenumber" name="50" href="#50">50</a>  <em class="jxr_javadoccomment">
*</em>
+<a class="jxr_linenumber" name="51" href="#51">51</a>  <em class="jxr_javadoccomment">
* @since 4.1</em>
+<a class="jxr_linenumber" name="52" href="#52">52</a>  <em class="jxr_javadoccomment">
*/</em>
+<a class="jxr_linenumber" name="53" href="#53">53</a>  @Contract(threading =
ThreadingBehavior.SAFE)
+<a class="jxr_linenumber" name="54" href="#54">54</a>  <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">abstract</strong> <strong class="jxr_keyword">class</strong>
<a href="../../../../../../org/apache/http/impl/nio/client/CloseableHttpPipeliningClient.html">CloseableHttpPipeliningClient</a>
+<a class="jxr_linenumber" name="55" href="#55">55</a>          <strong class="jxr_keyword">extends</strong>
<a href="../../../../../../org/apache/http/impl/nio/client/CloseableHttpAsyncClient.html">CloseableHttpAsyncClient</a>
<strong class="jxr_keyword">implements</strong> <a href="../../../../../../org/apache/http/nio/client/HttpPipeliningClient.html">HttpPipeliningClient</a>
{
+<a class="jxr_linenumber" name="56" href="#56">56</a>  
+<a class="jxr_linenumber" name="57" href="#57">57</a>      @Override
+<a class="jxr_linenumber" name="58" href="#58">58</a>      <strong class="jxr_keyword">public</strong>
&lt;T&gt; Future&lt;List&lt;T&gt;&gt; execute(
+<a class="jxr_linenumber" name="59" href="#59">59</a>              <strong
class="jxr_keyword">final</strong> HttpHost target,
+<a class="jxr_linenumber" name="60" href="#60">60</a>              <strong
class="jxr_keyword">final</strong> List&lt;? <strong class="jxr_keyword">extends</strong>
HttpAsyncRequestProducer&gt; requestProducers,
+<a class="jxr_linenumber" name="61" href="#61">61</a>              <strong
class="jxr_keyword">final</strong> List&lt;? <strong class="jxr_keyword">extends</strong>
HttpAsyncResponseConsumer&lt;T&gt;&gt; responseConsumers,
+<a class="jxr_linenumber" name="62" href="#62">62</a>              <strong
class="jxr_keyword">final</strong> FutureCallback&lt;List&lt;T&gt;&gt;
callback) {
+<a class="jxr_linenumber" name="63" href="#63">63</a>          <strong class="jxr_keyword">return</strong>
execute(target, requestProducers, responseConsumers, HttpClientContext.create(), callback);
+<a class="jxr_linenumber" name="64" href="#64">64</a>      }
+<a class="jxr_linenumber" name="65" href="#65">65</a>  
+<a class="jxr_linenumber" name="66" href="#66">66</a>      @Override
+<a class="jxr_linenumber" name="67" href="#67">67</a>      <strong class="jxr_keyword">public</strong>
Future&lt;List&lt;HttpResponse&gt;&gt; execute(
+<a class="jxr_linenumber" name="68" href="#68">68</a>              <strong
class="jxr_keyword">final</strong> HttpHost target,
+<a class="jxr_linenumber" name="69" href="#69">69</a>              <strong
class="jxr_keyword">final</strong> List&lt;HttpRequest&gt; requests,
+<a class="jxr_linenumber" name="70" href="#70">70</a>              <strong
class="jxr_keyword">final</strong> FutureCallback&lt;List&lt;HttpResponse&gt;&gt;
callback) {
+<a class="jxr_linenumber" name="71" href="#71">71</a>          <strong class="jxr_keyword">return</strong>
execute(target, requests, HttpClientContext.create(), callback);
+<a class="jxr_linenumber" name="72" href="#72">72</a>      }
+<a class="jxr_linenumber" name="73" href="#73">73</a>  
+<a class="jxr_linenumber" name="74" href="#74">74</a>      @Override
+<a class="jxr_linenumber" name="75" href="#75">75</a>      <strong class="jxr_keyword">public</strong>
Future&lt;List&lt;HttpResponse&gt;&gt; execute(
+<a class="jxr_linenumber" name="76" href="#76">76</a>              <strong
class="jxr_keyword">final</strong> HttpHost target,
+<a class="jxr_linenumber" name="77" href="#77">77</a>              <strong
class="jxr_keyword">final</strong> List&lt;HttpRequest&gt; requests,
+<a class="jxr_linenumber" name="78" href="#78">78</a>              <strong
class="jxr_keyword">final</strong> HttpContext context,
+<a class="jxr_linenumber" name="79" href="#79">79</a>              <strong
class="jxr_keyword">final</strong> FutureCallback&lt;List&lt;HttpResponse&gt;&gt;
callback) {
+<a class="jxr_linenumber" name="80" href="#80">80</a>          Args.notEmpty(requests,
<span class="jxr_string">"HTTP request list"</span>);
+<a class="jxr_linenumber" name="81" href="#81">81</a>          <strong class="jxr_keyword">final</strong>
List&lt;HttpAsyncRequestProducer&gt; requestProducers = <strong class="jxr_keyword">new</strong>
ArrayList&lt;HttpAsyncRequestProducer&gt;(
+<a class="jxr_linenumber" name="82" href="#82">82</a>                  requests.size());
+<a class="jxr_linenumber" name="83" href="#83">83</a>          <strong class="jxr_keyword">final</strong>
List&lt;HttpAsyncResponseConsumer&lt;HttpResponse&gt;&gt; responseConsumers
= <strong class="jxr_keyword">new</strong> ArrayList&lt;HttpAsyncResponseConsumer&lt;HttpResponse&gt;&gt;(
+<a class="jxr_linenumber" name="84" href="#84">84</a>                  requests.size());
+<a class="jxr_linenumber" name="85" href="#85">85</a>          <strong class="jxr_keyword">for</strong>
(<strong class="jxr_keyword">int</strong> i = 0; i &lt; requests.size(); i++)
{
+<a class="jxr_linenumber" name="86" href="#86">86</a>              <strong
class="jxr_keyword">final</strong> HttpRequest request = requests.get(i);
+<a class="jxr_linenumber" name="87" href="#87">87</a>              requestProducers.add(HttpAsyncMethods.create(target,
request));
+<a class="jxr_linenumber" name="88" href="#88">88</a>              responseConsumers.add(HttpAsyncMethods.createConsumer());
+<a class="jxr_linenumber" name="89" href="#89">89</a>          }
+<a class="jxr_linenumber" name="90" href="#90">90</a>          <strong class="jxr_keyword">return</strong>
execute(target, requestProducers, responseConsumers, context, callback);
+<a class="jxr_linenumber" name="91" href="#91">91</a>      }
+<a class="jxr_linenumber" name="92" href="#92">92</a>  
+<a class="jxr_linenumber" name="93" href="#93">93</a>  }
 </pre>
 <hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
 </html>

Modified: httpcomponents/site/httpcomponents-asyncclient-4.1.x/httpasyncclient/xref/org/apache/http/impl/nio/client/DefaultAsyncUserTokenHandler.html
URL: http://svn.apache.org/viewvc/httpcomponents/site/httpcomponents-asyncclient-4.1.x/httpasyncclient/xref/org/apache/http/impl/nio/client/DefaultAsyncUserTokenHandler.html?rev=1750192&r1=1750191&r2=1750192&view=diff
==============================================================================
--- httpcomponents/site/httpcomponents-asyncclient-4.1.x/httpasyncclient/xref/org/apache/http/impl/nio/client/DefaultAsyncUserTokenHandler.html
(original)
+++ httpcomponents/site/httpcomponents-asyncclient-4.1.x/httpasyncclient/xref/org/apache/http/impl/nio/client/DefaultAsyncUserTokenHandler.html
Sat Jun 25 09:35:53 2016
@@ -37,80 +37,81 @@
 <a class="jxr_linenumber" name="27" href="#27">27</a>  <strong class="jxr_keyword">package</strong>
org.apache.http.impl.nio.client;
 <a class="jxr_linenumber" name="28" href="#28">28</a>  
 <a class="jxr_linenumber" name="29" href="#29">29</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.HttpConnection;
-<a class="jxr_linenumber" name="30" href="#30">30</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.annotation.Immutable;
-<a class="jxr_linenumber" name="31" href="#31">31</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.auth.AuthScheme;
-<a class="jxr_linenumber" name="32" href="#32">32</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.auth.AuthState;
-<a class="jxr_linenumber" name="33" href="#33">33</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.auth.Credentials;
-<a class="jxr_linenumber" name="34" href="#34">34</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.client.UserTokenHandler;
-<a class="jxr_linenumber" name="35" href="#35">35</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.client.protocol.HttpClientContext;
-<a class="jxr_linenumber" name="36" href="#36">36</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.nio.conn.ManagedNHttpClientConnection;
-<a class="jxr_linenumber" name="37" href="#37">37</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.protocol.HttpContext;
-<a class="jxr_linenumber" name="38" href="#38">38</a>  
-<a class="jxr_linenumber" name="39" href="#39">39</a>  <strong class="jxr_keyword">import</strong>
javax.net.ssl.SSLSession;
-<a class="jxr_linenumber" name="40" href="#40">40</a>  <strong class="jxr_keyword">import</strong>
java.security.Principal;
-<a class="jxr_linenumber" name="41" href="#41">41</a>  
-<a class="jxr_linenumber" name="42" href="#42">42</a>  <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="43" href="#43">43</a>  <em class="jxr_javadoccomment">
* Default implementation of {@link org.apache.http.client.UserTokenHandler}</em>
-<a class="jxr_linenumber" name="44" href="#44">44</a>  <em class="jxr_javadoccomment">
* for asynchrounous HTTP client communication. This class will use</em>
-<a class="jxr_linenumber" name="45" href="#45">45</a>  <em class="jxr_javadoccomment">
* an instance of {@link java.security.Principal} as a state object for</em>
-<a class="jxr_linenumber" name="46" href="#46">46</a>  <em class="jxr_javadoccomment">
* non-blocking HTTP connections, if it can be obtained from the given</em>
-<a class="jxr_linenumber" name="47" href="#47">47</a>  <em class="jxr_javadoccomment">
* execution context. This helps ensure persistent connections created with</em>
-<a class="jxr_linenumber" name="48" href="#48">48</a>  <em class="jxr_javadoccomment">
* a particular user identity within a particular security context can be</em>
-<a class="jxr_linenumber" name="49" href="#49">49</a>  <em class="jxr_javadoccomment">
* reused by the same user only.</em>
-<a class="jxr_linenumber" name="50" href="#50">50</a>  <em class="jxr_javadoccomment">
* &lt;p&gt;</em>
-<a class="jxr_linenumber" name="51" href="#51">51</a>  <em class="jxr_javadoccomment">
* This implementation will use the user principle of connection based</em>
-<a class="jxr_linenumber" name="52" href="#52">52</a>  <em class="jxr_javadoccomment">
* authentication schemes such as NTLM or that of the SSL session with</em>
-<a class="jxr_linenumber" name="53" href="#53">53</a>  <em class="jxr_javadoccomment">
* the client authentication turned on. If both are unavailable,</em>
-<a class="jxr_linenumber" name="54" href="#54">54</a>  <em class="jxr_javadoccomment">
* {@code null} token will be returned.</em>
-<a class="jxr_linenumber" name="55" href="#55">55</a>  <em class="jxr_javadoccomment">
*</em>
-<a class="jxr_linenumber" name="56" href="#56">56</a>  <em class="jxr_javadoccomment">
* @since 4.0</em>
-<a class="jxr_linenumber" name="57" href="#57">57</a>  <em class="jxr_javadoccomment">
*/</em>
-<a class="jxr_linenumber" name="58" href="#58">58</a>  @Immutable
-<a class="jxr_linenumber" name="59" href="#59">59</a>  <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">class</strong> <a href="../../../../../../org/apache/http/impl/nio/client/DefaultAsyncUserTokenHandler.html">DefaultAsyncUserTokenHandler</a>
<strong class="jxr_keyword">implements</strong> UserTokenHandler {
-<a class="jxr_linenumber" name="60" href="#60">60</a>  
-<a class="jxr_linenumber" name="61" href="#61">61</a>      <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong>
<a href="../../../../../../org/apache/http/impl/nio/client/DefaultAsyncUserTokenHandler.html">DefaultAsyncUserTokenHandler</a>
INSTANCE = <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/http/impl/nio/client/DefaultAsyncUserTokenHandler.html">DefaultAsyncUserTokenHandler</a>();
-<a class="jxr_linenumber" name="62" href="#62">62</a>  
-<a class="jxr_linenumber" name="63" href="#63">63</a>      @Override
-<a class="jxr_linenumber" name="64" href="#64">64</a>      <strong class="jxr_keyword">public</strong>
Object getUserToken(<strong class="jxr_keyword">final</strong> HttpContext context)
{
-<a class="jxr_linenumber" name="65" href="#65">65</a>  
-<a class="jxr_linenumber" name="66" href="#66">66</a>          <strong class="jxr_keyword">final</strong>
HttpClientContext clientContext = HttpClientContext.adapt(context);
-<a class="jxr_linenumber" name="67" href="#67">67</a>  
-<a class="jxr_linenumber" name="68" href="#68">68</a>          Principal userPrincipal
= <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="69" href="#69">69</a>  
-<a class="jxr_linenumber" name="70" href="#70">70</a>          <strong class="jxr_keyword">final</strong>
AuthState targetAuthState = clientContext.getTargetAuthState();
-<a class="jxr_linenumber" name="71" href="#71">71</a>          <strong class="jxr_keyword">if</strong>
(targetAuthState != <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="72" href="#72">72</a>              userPrincipal
= getAuthPrincipal(targetAuthState);
-<a class="jxr_linenumber" name="73" href="#73">73</a>              <strong
class="jxr_keyword">if</strong> (userPrincipal == <strong class="jxr_keyword">null</strong>)
{
-<a class="jxr_linenumber" name="74" href="#74">74</a>                  <strong
class="jxr_keyword">final</strong> AuthState proxyAuthState = clientContext.getProxyAuthState();
-<a class="jxr_linenumber" name="75" href="#75">75</a>                  userPrincipal
= getAuthPrincipal(proxyAuthState);
-<a class="jxr_linenumber" name="76" href="#76">76</a>              }
-<a class="jxr_linenumber" name="77" href="#77">77</a>          }
-<a class="jxr_linenumber" name="78" href="#78">78</a>  
-<a class="jxr_linenumber" name="79" href="#79">79</a>          <strong class="jxr_keyword">if</strong>
(userPrincipal == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="80" href="#80">80</a>              <strong
class="jxr_keyword">final</strong> HttpConnection conn = clientContext.getConnection();
-<a class="jxr_linenumber" name="81" href="#81">81</a>              <strong
class="jxr_keyword">if</strong> (conn.isOpen() &amp;&amp; conn instanceof
ManagedNHttpClientConnection) {
-<a class="jxr_linenumber" name="82" href="#82">82</a>                  <strong
class="jxr_keyword">final</strong> SSLSession sslsession = ((ManagedNHttpClientConnection)
conn).getSSLSession();
-<a class="jxr_linenumber" name="83" href="#83">83</a>                  <strong
class="jxr_keyword">if</strong> (sslsession != <strong class="jxr_keyword">null</strong>)
{
-<a class="jxr_linenumber" name="84" href="#84">84</a>                      userPrincipal
= sslsession.getLocalPrincipal();
-<a class="jxr_linenumber" name="85" href="#85">85</a>                  }
-<a class="jxr_linenumber" name="86" href="#86">86</a>              }
-<a class="jxr_linenumber" name="87" href="#87">87</a>          }
-<a class="jxr_linenumber" name="88" href="#88">88</a>  
-<a class="jxr_linenumber" name="89" href="#89">89</a>          <strong class="jxr_keyword">return</strong>
userPrincipal;
-<a class="jxr_linenumber" name="90" href="#90">90</a>      }
-<a class="jxr_linenumber" name="91" href="#91">91</a>  
-<a class="jxr_linenumber" name="92" href="#92">92</a>      <strong class="jxr_keyword">private</strong>
<strong class="jxr_keyword">static</strong> Principal getAuthPrincipal(<strong
class="jxr_keyword">final</strong> AuthState authState) {
-<a class="jxr_linenumber" name="93" href="#93">93</a>          <strong class="jxr_keyword">final</strong>
AuthScheme scheme = authState.getAuthScheme();
-<a class="jxr_linenumber" name="94" href="#94">94</a>          <strong class="jxr_keyword">if</strong>
(scheme != <strong class="jxr_keyword">null</strong> &amp;&amp; scheme.isComplete()
&amp;&amp; scheme.isConnectionBased()) {
-<a class="jxr_linenumber" name="95" href="#95">95</a>              <strong
class="jxr_keyword">final</strong> Credentials creds = authState.getCredentials();
-<a class="jxr_linenumber" name="96" href="#96">96</a>              <strong
class="jxr_keyword">if</strong> (creds != <strong class="jxr_keyword">null</strong>)
{
-<a class="jxr_linenumber" name="97" href="#97">97</a>                  <strong
class="jxr_keyword">return</strong> creds.getUserPrincipal();
-<a class="jxr_linenumber" name="98" href="#98">98</a>              }
-<a class="jxr_linenumber" name="99" href="#99">99</a>          }
-<a class="jxr_linenumber" name="100" href="#100">100</a>         <strong class="jxr_keyword">return</strong>
<strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="101" href="#101">101</a>     }
-<a class="jxr_linenumber" name="102" href="#102">102</a> 
-<a class="jxr_linenumber" name="103" href="#103">103</a> }
+<a class="jxr_linenumber" name="30" href="#30">30</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.annotation.Contract;
+<a class="jxr_linenumber" name="31" href="#31">31</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.annotation.ThreadingBehavior;
+<a class="jxr_linenumber" name="32" href="#32">32</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.auth.AuthScheme;
+<a class="jxr_linenumber" name="33" href="#33">33</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.auth.AuthState;
+<a class="jxr_linenumber" name="34" href="#34">34</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.auth.Credentials;
+<a class="jxr_linenumber" name="35" href="#35">35</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.client.UserTokenHandler;
+<a class="jxr_linenumber" name="36" href="#36">36</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.client.protocol.HttpClientContext;
+<a class="jxr_linenumber" name="37" href="#37">37</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.nio.conn.ManagedNHttpClientConnection;
+<a class="jxr_linenumber" name="38" href="#38">38</a>  <strong class="jxr_keyword">import</strong>
org.apache.http.protocol.HttpContext;
+<a class="jxr_linenumber" name="39" href="#39">39</a>  
+<a class="jxr_linenumber" name="40" href="#40">40</a>  <strong class="jxr_keyword">import</strong>
javax.net.ssl.SSLSession;
+<a class="jxr_linenumber" name="41" href="#41">41</a>  <strong class="jxr_keyword">import</strong>
java.security.Principal;
+<a class="jxr_linenumber" name="42" href="#42">42</a>  
+<a class="jxr_linenumber" name="43" href="#43">43</a>  <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="44" href="#44">44</a>  <em class="jxr_javadoccomment">
* Default implementation of {@link org.apache.http.client.UserTokenHandler}</em>
+<a class="jxr_linenumber" name="45" href="#45">45</a>  <em class="jxr_javadoccomment">
* for asynchrounous HTTP client communication. This class will use</em>
+<a class="jxr_linenumber" name="46" href="#46">46</a>  <em class="jxr_javadoccomment">
* an instance of {@link java.security.Principal} as a state object for</em>
+<a class="jxr_linenumber" name="47" href="#47">47</a>  <em class="jxr_javadoccomment">
* non-blocking HTTP connections, if it can be obtained from the given</em>
+<a class="jxr_linenumber" name="48" href="#48">48</a>  <em class="jxr_javadoccomment">
* execution context. This helps ensure persistent connections created with</em>
+<a class="jxr_linenumber" name="49" href="#49">49</a>  <em class="jxr_javadoccomment">
* a particular user identity within a particular security context can be</em>
+<a class="jxr_linenumber" name="50" href="#50">50</a>  <em class="jxr_javadoccomment">
* reused by the same user only.</em>
+<a class="jxr_linenumber" name="51" href="#51">51</a>  <em class="jxr_javadoccomment">
* &lt;p&gt;</em>
+<a class="jxr_linenumber" name="52" href="#52">52</a>  <em class="jxr_javadoccomment">
* This implementation will use the user principle of connection based</em>
+<a class="jxr_linenumber" name="53" href="#53">53</a>  <em class="jxr_javadoccomment">
* authentication schemes such as NTLM or that of the SSL session with</em>
+<a class="jxr_linenumber" name="54" href="#54">54</a>  <em class="jxr_javadoccomment">
* the client authentication turned on. If both are unavailable,</em>
+<a class="jxr_linenumber" name="55" href="#55">55</a>  <em class="jxr_javadoccomment">
* {@code null} token will be returned.</em>
+<a class="jxr_linenumber" name="56" href="#56">56</a>  <em class="jxr_javadoccomment">
*</em>
+<a class="jxr_linenumber" name="57" href="#57">57</a>  <em class="jxr_javadoccomment">
* @since 4.0</em>
+<a class="jxr_linenumber" name="58" href="#58">58</a>  <em class="jxr_javadoccomment">
*/</em>
+<a class="jxr_linenumber" name="59" href="#59">59</a>  @Contract(threading =
ThreadingBehavior.IMMUTABLE)
+<a class="jxr_linenumber" name="60" href="#60">60</a>  <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">class</strong> <a href="../../../../../../org/apache/http/impl/nio/client/DefaultAsyncUserTokenHandler.html">DefaultAsyncUserTokenHandler</a>
<strong class="jxr_keyword">implements</strong> UserTokenHandler {
+<a class="jxr_linenumber" name="61" href="#61">61</a>  
+<a class="jxr_linenumber" name="62" href="#62">62</a>      <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong>
<a href="../../../../../../org/apache/http/impl/nio/client/DefaultAsyncUserTokenHandler.html">DefaultAsyncUserTokenHandler</a>
INSTANCE = <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/http/impl/nio/client/DefaultAsyncUserTokenHandler.html">DefaultAsyncUserTokenHandler</a>();
+<a class="jxr_linenumber" name="63" href="#63">63</a>  
+<a class="jxr_linenumber" name="64" href="#64">64</a>      @Override
+<a class="jxr_linenumber" name="65" href="#65">65</a>      <strong class="jxr_keyword">public</strong>
Object getUserToken(<strong class="jxr_keyword">final</strong> HttpContext context)
{
+<a class="jxr_linenumber" name="66" href="#66">66</a>  
+<a class="jxr_linenumber" name="67" href="#67">67</a>          <strong class="jxr_keyword">final</strong>
HttpClientContext clientContext = HttpClientContext.adapt(context);
+<a class="jxr_linenumber" name="68" href="#68">68</a>  
+<a class="jxr_linenumber" name="69" href="#69">69</a>          Principal userPrincipal
= <strong class="jxr_keyword">null</strong>;
+<a class="jxr_linenumber" name="70" href="#70">70</a>  
+<a class="jxr_linenumber" name="71" href="#71">71</a>          <strong class="jxr_keyword">final</strong>
AuthState targetAuthState = clientContext.getTargetAuthState();
+<a class="jxr_linenumber" name="72" href="#72">72</a>          <strong class="jxr_keyword">if</strong>
(targetAuthState != <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="73" href="#73">73</a>              userPrincipal
= getAuthPrincipal(targetAuthState);
+<a class="jxr_linenumber" name="74" href="#74">74</a>              <strong
class="jxr_keyword">if</strong> (userPrincipal == <strong class="jxr_keyword">null</strong>)
{
+<a class="jxr_linenumber" name="75" href="#75">75</a>                  <strong
class="jxr_keyword">final</strong> AuthState proxyAuthState = clientContext.getProxyAuthState();
+<a class="jxr_linenumber" name="76" href="#76">76</a>                  userPrincipal
= getAuthPrincipal(proxyAuthState);
+<a class="jxr_linenumber" name="77" href="#77">77</a>              }
+<a class="jxr_linenumber" name="78" href="#78">78</a>          }
+<a class="jxr_linenumber" name="79" href="#79">79</a>  
+<a class="jxr_linenumber" name="80" href="#80">80</a>          <strong class="jxr_keyword">if</strong>
(userPrincipal == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="81" href="#81">81</a>              <strong
class="jxr_keyword">final</strong> HttpConnection conn = clientContext.getConnection();
+<a class="jxr_linenumber" name="82" href="#82">82</a>              <strong
class="jxr_keyword">if</strong> (conn.isOpen() &amp;&amp; conn instanceof
ManagedNHttpClientConnection) {
+<a class="jxr_linenumber" name="83" href="#83">83</a>                  <strong
class="jxr_keyword">final</strong> SSLSession sslsession = ((ManagedNHttpClientConnection)
conn).getSSLSession();
+<a class="jxr_linenumber" name="84" href="#84">84</a>                  <strong
class="jxr_keyword">if</strong> (sslsession != <strong class="jxr_keyword">null</strong>)
{
+<a class="jxr_linenumber" name="85" href="#85">85</a>                      userPrincipal
= sslsession.getLocalPrincipal();
+<a class="jxr_linenumber" name="86" href="#86">86</a>                  }
+<a class="jxr_linenumber" name="87" href="#87">87</a>              }
+<a class="jxr_linenumber" name="88" href="#88">88</a>          }
+<a class="jxr_linenumber" name="89" href="#89">89</a>  
+<a class="jxr_linenumber" name="90" href="#90">90</a>          <strong class="jxr_keyword">return</strong>
userPrincipal;
+<a class="jxr_linenumber" name="91" href="#91">91</a>      }
+<a class="jxr_linenumber" name="92" href="#92">92</a>  
+<a class="jxr_linenumber" name="93" href="#93">93</a>      <strong class="jxr_keyword">private</strong>
<strong class="jxr_keyword">static</strong> Principal getAuthPrincipal(<strong
class="jxr_keyword">final</strong> AuthState authState) {
+<a class="jxr_linenumber" name="94" href="#94">94</a>          <strong class="jxr_keyword">final</strong>
AuthScheme scheme = authState.getAuthScheme();
+<a class="jxr_linenumber" name="95" href="#95">95</a>          <strong class="jxr_keyword">if</strong>
(scheme != <strong class="jxr_keyword">null</strong> &amp;&amp; scheme.isComplete()
&amp;&amp; scheme.isConnectionBased()) {
+<a class="jxr_linenumber" name="96" href="#96">96</a>              <strong
class="jxr_keyword">final</strong> Credentials creds = authState.getCredentials();
+<a class="jxr_linenumber" name="97" href="#97">97</a>              <strong
class="jxr_keyword">if</strong> (creds != <strong class="jxr_keyword">null</strong>)
{
+<a class="jxr_linenumber" name="98" href="#98">98</a>                  <strong
class="jxr_keyword">return</strong> creds.getUserPrincipal();
+<a class="jxr_linenumber" name="99" href="#99">99</a>              }
+<a class="jxr_linenumber" name="100" href="#100">100</a>         }
+<a class="jxr_linenumber" name="101" href="#101">101</a>         <strong class="jxr_keyword">return</strong>
<strong class="jxr_keyword">null</strong>;
+<a class="jxr_linenumber" name="102" href="#102">102</a>     }
+<a class="jxr_linenumber" name="103" href="#103">103</a> 
+<a class="jxr_linenumber" name="104" href="#104">104</a> }
 </pre>
 <hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
 </html>



Mime
View raw message