incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1051352 - in /incubator/lcf/trunk: framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java site/src/documentation/content/xdocs/programmatic-operation.xml
Date Tue, 21 Dec 2010 00:54:39 GMT
Author: kwright
Date: Tue Dec 21 00:54:38 2010
New Revision: 1051352

URL: http://svn.apache.org/viewvc?rev=1051352&view=rev
Log:
Add an API command to reset the output connection.  Fix for CONNECTORS-129.

Modified:
    incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
    incubator/lcf/trunk/site/src/documentation/content/xdocs/programmatic-operation.xml

Modified: incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java?rev=1051352&r1=1051351&r2=1051352&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
(original)
+++ incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
Tue Dec 21 00:54:38 2010
@@ -1870,6 +1870,41 @@ public class ManifoldCF extends org.apac
         createErrorNode(output,e);
       }
     }
+    else if (path.startsWith("reset/"))
+    {
+      int firstSeparator = "reset/".length();
+      int secondSeparator = path.indexOf("/",firstSeparator);
+      if (secondSeparator == -1)
+      {
+        ConfigurationNode error = new ConfigurationNode(API_ERRORNODE);
+        error.setValue("Need connection name.");
+        output.addChild(output.getChildCount(),error);
+        return WRITERESULT_NOTFOUND;
+      }
+      
+      String connectionType = path.substring(firstSeparator,secondSeparator);
+      String connectionName = decodeAPIPathElement(path.substring(secondSeparator+1));
+      
+      if (connectionType.equals("outputconnections"))
+      {
+        try
+        {
+          signalOutputConnectionRedo(tc,connectionName);
+          return WRITERESULT_CREATED;
+        }
+        catch (ManifoldCFException e)
+        {
+          createErrorNode(output,e);
+        }
+      }
+      else
+      {
+        ConfigurationNode error = new ConfigurationNode(API_ERRORNODE);
+        error.setValue("Unknown connection type '"+connectionType+"'.");
+        output.addChild(output.getChildCount(),error);
+        return WRITERESULT_NOTFOUND;
+      }
+    }
     else
     {
       ConfigurationNode error = new ConfigurationNode(API_ERRORNODE);

Modified: incubator/lcf/trunk/site/src/documentation/content/xdocs/programmatic-operation.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/site/src/documentation/content/xdocs/programmatic-operation.xml?rev=1051352&r1=1051351&r2=1051352&view=diff
==============================================================================
--- incubator/lcf/trunk/site/src/documentation/content/xdocs/programmatic-operation.xml (original)
+++ incubator/lcf/trunk/site/src/documentation/content/xdocs/programmatic-operation.xml Tue
Dec 21 00:54:38 2010
@@ -56,6 +56,7 @@
           <tr><td>outputconnections/<em>&lt;encoded_connection_name&gt;</em></td><td>DELETE</td><td>Delete
an output connection</td><td>N/A</td><td>{ } <strong>OR</strong>
{"error":<em>&lt;error_text&gt;</em>}</td></tr>
           <tr><td>status/outputconnections/<em>&lt;encoded_connection_name&gt;</em></td><td>GET</td><td>Check
the status of an output connection</td><td>N/A</td><td>{"check_result":<em>&lt;message&gt;</em>}
<strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>
           <tr><td>info/outputconnections/<em>&lt;encoded_connection_name&gt;</em>/<em>&lt;connector_specific_resource&gt;</em></td><td>GET</td><td>Retrieve
arbitrary connector-specific resource</td><td>N/A</td><td><em>&lt;response_data&gt;</em>
<strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}
<strong>OR</strong> {"service_interruption":<em>&lt;error_text&gt;</em>}</td></tr>
+          <tr><td>reset/outputconnections/<em>&lt;encoded_connection_name&gt;</em></td><td>PUT</td><td>Forget
previous indexing state</td><td>N/A</td><td>{ } <strong>OR</strong>
{"error":<em>&lt;error_text&gt;</em>}</td></tr>
           <tr><td>authorityconnections</td><td>GET</td><td>List
all authority connections</td><td>N/A</td><td>{"authorityconnection":[<em>&lt;list_of_authority_connection_objects&gt;</em>]}
<strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>
           <tr><td>authorityconnections/<em>&lt;encoded_connection_name&gt;</em></td><td>GET</td><td>Get
a specific authority connection</td><td>N/A</td><td>{"authorityconnection":<em>&lt;authority_connection_object&gt;</em>}
<strong>OR</strong> { } <strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>
           <tr><td>authorityconnections/<em>&lt;encoded_connection_name&gt;</em></td><td>PUT</td><td>Save
or create an authority connection</td><td>{"authorityconnection":<em>&lt;authority_connection_object&gt;</em>}</td><td>{"connection_name":<em>&lt;connection_name&gt;</em>}
<strong>OR</strong> {"error":<em>&lt;error_text&gt;</em>}</td></tr>



Mime
View raw message