manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1293978 - in /incubator/lcf/branches/CONNECTORS-288/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch: ElasticSearchAction.java ElasticSearchConnector.java
Date Mon, 27 Feb 2012 00:27:20 GMT
Author: kwright
Date: Mon Feb 27 00:27:20 2012
New Revision: 1293978

URL: http://svn.apache.org/viewvc?rev=1293978&view=rev
Log:
Fix the check() method.

Modified:
    incubator/lcf/branches/CONNECTORS-288/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchAction.java
    incubator/lcf/branches/CONNECTORS-288/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java

Modified: incubator/lcf/branches/CONNECTORS-288/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchAction.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-288/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchAction.java?rev=1293978&r1=1293977&r2=1293978&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-288/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchAction.java
(original)
+++ incubator/lcf/branches/CONNECTORS-288/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchAction.java
Mon Feb 27 00:27:20 2012
@@ -34,6 +34,7 @@ public class ElasticSearchAction extends
     super(config);
     StringBuffer url = getApiUrl(cmd.toString());
     GetMethod method = new GetMethod(url.toString());
+    System.out.println("URL is '"+url.toString()+"'");
     call(method);
     if ("true".equals(checkJson(jsonStatus)))
       return;

Modified: incubator/lcf/branches/CONNECTORS-288/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-288/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java?rev=1293978&r1=1293977&r2=1293978&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-288/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java
(original)
+++ incubator/lcf/branches/CONNECTORS-288/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java
Mon Feb 27 00:27:20 2012
@@ -384,9 +384,20 @@ public class ElasticSearchConnector exte
   @Override
   public String check() throws ManifoldCFException
   {
-    ElasticSearchAction oss = new ElasticSearchAction(CommandEnum._status,
-        getConfigParameters(null));
-    return oss.getResult().name() + " " + oss.getResultDescription();
+    try
+    {
+      ElasticSearchAction oss = new ElasticSearchAction(CommandEnum._status,
+          getConfigParameters(null));
+      String resultName = oss.getResult().name();
+      if (resultName.equals("OK"))
+        return super.check();
+      return resultName + " " + oss.getResultDescription();
+    }
+    catch (ManifoldCFException e)
+    {
+      e.printStackTrace();
+      throw e;
+    }
   }
 
   @Override



Mime
View raw message