You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2012/12/11 17:50:44 UTC

svn commit: r1420277 - /manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java

Author: kwright
Date: Tue Dec 11 16:50:43 2012
New Revision: 1420277

URL: http://svn.apache.org/viewvc?rev=1420277&view=rev
Log:
Set host for httpcomponents interactions

Modified:
    manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java

Modified: manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java?rev=1420277&r1=1420276&r2=1420277&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java (original)
+++ manifoldcf/branches/CONNECTORS-578/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java Tue Dec 11 16:50:43 2012
@@ -282,6 +282,11 @@ public class LivelinkConnector extends o
     return new String[]{serverName};
   }
 
+  protected HttpHost getHost()
+  {
+    return new HttpHost(llServer.getHost(),ingestPortNumber,ingestProtocol);
+  }
+
   protected void getSession()
     throws ManifoldCFException, ServiceInterruption
   {
@@ -473,10 +478,10 @@ public class LivelinkConnector extends o
   // on this instance!
 
 
-  protected static int executeMethodViaThread(HttpClient client, HttpRequestBase executeMethod)
+  protected static int executeMethodViaThread(HttpHost host, HttpClient client, HttpRequestBase executeMethod)
     throws InterruptedException, HttpException, IOException
   {
-    ExecuteMethodThread t = new ExecuteMethodThread(client,executeMethod);
+    ExecuteMethodThread t = new ExecuteMethodThread(host, client,executeMethod);
     t.start();
     try
     {
@@ -514,7 +519,7 @@ public class LivelinkConnector extends o
       HttpGet method = new HttpGet(ingestHttpAddress);
       try
       {
-        int statusCode = executeMethodViaThread(client,method);
+        int statusCode = executeMethodViaThread(getHost(),client,method);
         switch (statusCode)
         {
         case 502:
@@ -3849,7 +3854,7 @@ public class LivelinkConnector extends o
     Long readSize = null;
 
     HttpGet method = new HttpGet(ingestHttpAddress);
-    ExecuteMethodThread methodThread = new ExecuteMethodThread(client,method);
+    ExecuteMethodThread methodThread = new ExecuteMethodThread(getHost(), client,method);
     methodThread.start();
     try
     {
@@ -4073,7 +4078,7 @@ public class LivelinkConnector extends o
     {
       if (Logging.connectors.isDebugEnabled())
         Logging.connectors.debug("Livelink: Created new HttpGet "+contextMsg+"; executing authentication method");
-      int statusCode = executeMethodViaThread(httpClient,authget);
+      int statusCode = executeMethodViaThread(getHost(),httpClient,authget);
 
       if (statusCode == 502 || statusCode == 500)
       {
@@ -6707,6 +6712,7 @@ public class LivelinkConnector extends o
   protected static class ExecuteMethodThread extends Thread
   {
     /** Client and method, all preconfigured */
+    protected final HttpHost host;
     protected final HttpClient httpClient;
     protected final HttpRequestBase executeMethod;
     
@@ -6721,10 +6727,11 @@ public class LivelinkConnector extends o
 
     protected Throwable generalException = null;
     
-    public ExecuteMethodThread(HttpClient httpClient, HttpRequestBase executeMethod)
+    public ExecuteMethodThread(HttpHost host, HttpClient httpClient, HttpRequestBase executeMethod)
     {
       super();
       setDaemon(true);
+      this.host = host;
       this.httpClient = httpClient;
       this.executeMethod = executeMethod;
     }
@@ -6742,7 +6749,7 @@ public class LivelinkConnector extends o
             {
               try
               {
-                response = httpClient.execute(executeMethod);
+                response = httpClient.execute(host,executeMethod);
               }
               catch (java.net.SocketTimeoutException e)
               {