manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1605620 - /manifoldcf/trunk/connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/AmazonCloudSearchConnector.java
Date Wed, 25 Jun 2014 22:14:03 GMT
Author: kwright
Date: Wed Jun 25 22:14:02 2014
New Revision: 1605620

URL: http://svn.apache.org/r1605620
Log:
Fix for change in Amazon API

Modified:
    manifoldcf/trunk/connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/AmazonCloudSearchConnector.java

Modified: manifoldcf/trunk/connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/AmazonCloudSearchConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/AmazonCloudSearchConnector.java?rev=1605620&r1=1605619&r2=1605620&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/AmazonCloudSearchConnector.java
(original)
+++ manifoldcf/trunk/connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/AmazonCloudSearchConnector.java
Wed Jun 25 22:14:02 2014
@@ -247,9 +247,9 @@ public class AmazonCloudSearchConnector 
   public String check() throws ManifoldCFException {
     try {
       getSession();
-      String responseBody;
       String responsbody = postData(new ReaderInputStream(new StringReader("[]"),Consts.UTF_8));
       String status = "";
+      
       try
       {
         status = getStatusFromJsonResponse(responsbody);
@@ -258,31 +258,12 @@ public class AmazonCloudSearchConnector 
         Logging.ingest.debug(e);
         return "Could not get status from response body. Check Access Policy setting of your
domain of Amazon CloudSearch.: " + e.getMessage();
       }
-          
-      // check status message
-      String message = "";
-      if ("error".equals(status)) {
-        JsonParser parser = new JsonFactory().createJsonParser(responsbody);
-        while (parser.nextToken() != JsonToken.END_OBJECT) {
-          String name = parser.getCurrentName();
-          if ("errors".equalsIgnoreCase(name)) {
-            message = parseMessage(parser);
-            break;
-          }
-        }
-      }
-      if ("error".equalsIgnoreCase(status)
-          && "batch must contain at least one operation".equals(message)) {
-        return "Connection working.";
+      
+      if ("error".equalsIgnoreCase(status)) {
+        return "Connection working. responsbody : " + responsbody;
       }
-      return "Connection NOT working.";
+      return "Connection NOT working. responsbody : " + responsbody;
       
-    } catch (ClientProtocolException e) {
-      Logging.ingest.debug(e);
-      return "Protocol exception: "+e.getMessage();
-    } catch (IOException e) {
-      Logging.ingest.debug(e);
-      return "IO exception: "+e.getMessage();
     } catch (ServiceInterruption e) {
       Logging.ingest.debug(e);
       return "Transient exception: "+e.getMessage();



Mime
View raw message