manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1633367 - in /manifoldcf/branches/dev_1x: ./ connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/ framework/ framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/
Date Tue, 21 Oct 2014 13:01:26 GMT
Author: kwright
Date: Tue Oct 21 13:01:25 2014
New Revision: 1633367

URL: http://svn.apache.org/r1633367
Log:
Pull up more changes for CONNECTORS-1077.

Modified:
    manifoldcf/branches/dev_1x/   (props changed)
    manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerAction.java
    manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnection.java
    manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
    manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerDelete.java
    manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerIndex.java
    manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerSchema.java
    manifoldcf/branches/dev_1x/framework/   (props changed)
    manifoldcf/branches/dev_1x/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IOutputHistoryActivity.java

Propchange: manifoldcf/branches/dev_1x/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk:r1633364

Modified: manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerAction.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerAction.java?rev=1633367&r1=1633366&r2=1633367&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerAction.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerAction.java
Tue Oct 21 13:01:25 2014
@@ -20,6 +20,7 @@ package org.apache.manifoldcf.agents.out
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpGet;
 
+import org.apache.manifoldcf.agents.interfaces.IOutputHistoryActivity;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 
 public class OpenSearchServerAction extends OpenSearchServerConnection {
@@ -38,6 +39,6 @@ public class OpenSearchServerAction exte
     call(method);
     if ("OK".equals(checkXPath(xPathStatus)))
       return;
-    setResult(Result.ERROR, checkXPath(xPathException));
+    setResult(IOutputHistoryActivity.JSON_ERROR,Result.ERROR, checkXPath(xPathException));
   }
 }

Modified: manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnection.java?rev=1633367&r1=1633366&r2=1633367&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnection.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnection.java
Tue Oct 21 13:01:25 2014
@@ -27,6 +27,7 @@ import java.io.InputStream;
 import java.io.InterruptedIOException;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
+import java.util.Locale;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -50,6 +51,7 @@ import org.apache.http.NoHttpResponseExc
 import org.apache.http.HttpException;
 import org.apache.http.ParseException;
 
+import org.apache.manifoldcf.agents.interfaces.IOutputHistoryActivity;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 import org.apache.manifoldcf.core.util.URLEncoder;
 import org.w3c.dom.Document;
@@ -84,6 +86,8 @@ public class OpenSearchServerConnection 
   }
 
   private Result result;
+
+  private String resultCode;
     
   protected OpenSearchServerConnection(HttpClient client, OpenSearchServerConfig config)
{
     this.httpClient = client;
@@ -231,22 +235,22 @@ public class OpenSearchServerConnection 
     }
     catch (java.net.SocketTimeoutException e)
     {
-      setResult(Result.ERROR, e.getMessage());
+      setResult(e.getClass().getSimpleName().toUpperCase(Locale.ROOT),Result.ERROR, e.getMessage());
       throw new ManifoldCFException("SocketTimeoutException while calling " + method.getURI()
+": " + e.getMessage(), e);
     }
     catch (InterruptedIOException e)
     {
-      setResult(Result.ERROR, e.getMessage());
+      setResult(e.getClass().getSimpleName().toUpperCase(Locale.ROOT),Result.ERROR, e.getMessage());
       throw new ManifoldCFException("Interrupted: "+e.getMessage(), e, ManifoldCFException.INTERRUPTED);
     }
     catch (HttpException e)
     {
-      setResult(Result.ERROR, e.getMessage());
+      setResult(e.getClass().getSimpleName().toUpperCase(Locale.ROOT),Result.ERROR, e.getMessage());
       throw new ManifoldCFException("HttpException while calling " + method.getURI() +":
" + e.getMessage(), e);
     }
     catch (IOException e)
     {
-      setResult(Result.ERROR, e.getMessage());
+      setResult(e.getClass().getSimpleName().toUpperCase(Locale.ROOT),Result.ERROR, e.getMessage());
       throw new ManifoldCFException("IOException while calling " + method.getURI() +": "
+ e.getMessage(), e);
     }
   }
@@ -287,12 +291,13 @@ public class OpenSearchServerConnection 
     }
   }
 
-  protected void setResult(Result res, String desc) {
+  protected void setResult(String resultCode,Result res, String desc) {
     if (res != null)
       result = res;
     if (desc != null)
       if (desc.length() > 0)
         resultDescription = desc;
+    setResultCode(resultCode);
   }
 
   public String getResultDescription() {
@@ -306,16 +311,16 @@ public class OpenSearchServerConnection 
   private boolean checkResultCode(int code) {
     switch (code) {
     case 0:
-      setResult(Result.UNKNOWN, null);
+      setResult(IOutputHistoryActivity.HTTP_ERROR,Result.UNKNOWN, null);
       return false;
     case 200:
-      setResult(Result.OK, null);
+      setResult("OK",Result.OK, null);
       return true;
     case 404:
-      setResult(Result.ERROR, "Server/page not found");
+      setResult(IOutputHistoryActivity.HTTP_ERROR,Result.ERROR, "Server/page not found");
       return false;
     default:
-      setResult(Result.ERROR, null);
+      setResult(IOutputHistoryActivity.HTTP_ERROR,Result.ERROR, null);
       return false;
     }
   }
@@ -327,4 +332,8 @@ public class OpenSearchServerConnection 
   public String getCallUrlSnippet() {
     return callUrlSnippet;
   }
+
+  public void setResultCode(String resultCode){ this.resultCode = resultCode; }
+
+  public String getResultCode(){ return resultCode; }
 }

Modified: manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java?rev=1633367&r1=1633366&r2=1633367&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
Tue Oct 21 13:01:25 2014
@@ -540,7 +540,7 @@ public class OpenSearchServerConnector e
             documentURI, config, document, authorityNameString, activities);
         activities.recordActivity(startTime,
             OPENSEARCHSERVER_INDEXATION_ACTIVITY, document.getBinaryLength(),
-            documentURI, oi.getResult().name(), oi.getResultDescription());
+            documentURI, oi.getResultCode(), oi.getResultDescription());
         if (oi.getResult() != Result.OK)
           return DOCUMENTSTATUS_REJECTED;
       }
@@ -562,7 +562,7 @@ public class OpenSearchServerConnector e
     OpenSearchServerDelete od = new OpenSearchServerDelete(client, documentURI,
         getConfigParameters(null));
     activities.recordActivity(startTime, OPENSEARCHSERVER_DELETION_ACTIVITY,
-        null, documentURI, od.getResult().name(), od.getResultDescription());
+        null, documentURI, od.getResultCode(), od.getResultDescription());
   }
 
   @Override
@@ -588,7 +588,7 @@ public class OpenSearchServerConnector e
       OpenSearchServerScheduler oo = new OpenSearchServerScheduler(client,
           getConfigParameters(null), schedulerJob.trim());
       activities.recordActivity(startTime, OPENSEARCHSERVER_SCHEDULER_ACTIVITY,
-          null, oo.getCallUrlSnippet(), oo.getResult().name(),
+          null, oo.getCallUrlSnippet(), oo.getResultCode(),
           oo.getResultDescription());
     }
   }

Modified: manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerDelete.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerDelete.java?rev=1633367&r1=1633366&r2=1633367&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerDelete.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerDelete.java
Tue Oct 21 13:01:25 2014
@@ -17,9 +17,11 @@
 
 package org.apache.manifoldcf.agents.output.opensearchserver;
 
+import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpGet;
 
+import org.apache.manifoldcf.agents.interfaces.IOutputHistoryActivity;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 import org.apache.manifoldcf.core.util.URLEncoder;
 
@@ -35,6 +37,6 @@ public class OpenSearchServerDelete exte
     call(method);
     if ("OK".equals(checkXPath(xPathStatus)))
       return;
-    setResult(Result.ERROR, checkXPath(xPathException));
+    setResult(IOutputHistoryActivity.XPATH_EXCEPTION,Result.ERROR, checkXPath(xPathException));
   }
 }

Modified: manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerIndex.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerIndex.java?rev=1633367&r1=1633366&r2=1633367&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerIndex.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerIndex.java
Tue Oct 21 13:01:25 2014
@@ -38,6 +38,7 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.message.BasicHeader;
 import org.apache.http.util.EntityUtils;
 import org.apache.manifoldcf.agents.interfaces.IOutputAddActivity;
+import org.apache.manifoldcf.agents.interfaces.IOutputHistoryActivity;
 import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.core.common.Base64;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
@@ -302,7 +303,7 @@ public class OpenSearchServerIndex exten
         else
         {
           // Don't know how to deal with it
-          setResult(Result.ERROR, "Unhandled security type: " + securityType);
+          setResult(activities.UNKNOWN_SECURITY,Result.ERROR, "Unhandled security type: "
+ securityType);
           return;
         }
       }
@@ -315,7 +316,7 @@ public class OpenSearchServerIndex exten
     if ("OK".equals(checkXPath(xPathStatus)))
       return;
     String error = checkXPath(xPathException);
-    setResult(Result.ERROR, error);
+    setResult(activities.XPATH_EXCEPTION,Result.ERROR, error);
     throw new ManifoldCFException("Error, unexpected response: " + error);
   }
 

Modified: manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerSchema.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerSchema.java?rev=1633367&r1=1633366&r2=1633367&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerSchema.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerSchema.java
Tue Oct 21 13:01:25 2014
@@ -20,6 +20,7 @@ package org.apache.manifoldcf.agents.out
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpGet;
 
+import org.apache.manifoldcf.agents.interfaces.IOutputHistoryActivity;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 
 public class OpenSearchServerSchema extends OpenSearchServerConnection {
@@ -35,6 +36,6 @@ public class OpenSearchServerSchema exte
     call(method);
     if ("1".equals(checkXPath(xpath)))
       return;
-    setResult(Result.ERROR, "Index not found");
+    setResult(IOutputHistoryActivity.INDEX_NOT_FOUND,Result.ERROR, "Index not found");
   }
 }

Propchange: manifoldcf/branches/dev_1x/framework/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk/framework:r1633364

Modified: manifoldcf/branches/dev_1x/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IOutputHistoryActivity.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IOutputHistoryActivity.java?rev=1633367&r1=1633366&r2=1633367&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IOutputHistoryActivity.java
(original)
+++ manifoldcf/branches/dev_1x/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IOutputHistoryActivity.java
Tue Oct 21 13:01:25 2014
@@ -38,6 +38,8 @@ public interface IOutputHistoryActivity
   public static final String UNKNOWN_SECURITY = "UNKNOWNSECURITY";
   public static final String HTTP_ERROR = "HTTPERROR";
   public static final String JSON_ERROR = "JSONERROR";
+  public static final String INDEX_NOT_FOUND = "INDEXNOTFOUND";
+  public static final String XPATH_EXCEPTION = "XPATHEXCEPTION";
   /** Record time-stamped information about the activity of the output connector.
   *@param startTime is either null or the time since the start of epoch in milliseconds (Jan
1, 1970).  Every
   *       activity has an associated time; the startTime field records when the activity
began.  A null value



Mime
View raw message