Return-Path: Delivered-To: apmail-incubator-connectors-commits-archive@minotaur.apache.org Received: (qmail 18942 invoked from network); 21 Dec 2010 00:55:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Dec 2010 00:55:04 -0000 Received: (qmail 36873 invoked by uid 500); 21 Dec 2010 00:55:04 -0000 Delivered-To: apmail-incubator-connectors-commits-archive@incubator.apache.org Received: (qmail 36839 invoked by uid 500); 21 Dec 2010 00:55:03 -0000 Mailing-List: contact connectors-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: connectors-dev@incubator.apache.org Delivered-To: mailing list connectors-commits@incubator.apache.org Received: (qmail 36832 invoked by uid 99); 21 Dec 2010 00:55:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Dec 2010 00:55:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Dec 2010 00:55:00 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5AC8323888CF; Tue, 21 Dec 2010 00:54:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: connectors-commits@incubator.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101221005439.5AC8323888CF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 @@ outputconnections/<encoded_connection_name>DELETEDelete an output connectionN/A{ } OR {"error":<error_text>} status/outputconnections/<encoded_connection_name>GETCheck the status of an output connectionN/A{"check_result":<message>} OR {"error":<error_text>} info/outputconnections/<encoded_connection_name>/<connector_specific_resource>GETRetrieve arbitrary connector-specific resourceN/A<response_data> OR {"error":<error_text>} OR {"service_interruption":<error_text>} + reset/outputconnections/<encoded_connection_name>PUTForget previous indexing stateN/A{ } OR {"error":<error_text>} authorityconnectionsGETList all authority connectionsN/A{"authorityconnection":[<list_of_authority_connection_objects>]} OR {"error":<error_text>} authorityconnections/<encoded_connection_name>GETGet a specific authority connectionN/A{"authorityconnection":<authority_connection_object>} OR { } OR {"error":<error_text>} authorityconnections/<encoded_connection_name>PUTSave or create an authority connection{"authorityconnection":<authority_connection_object>}{"connection_name":<connection_name>} OR {"error":<error_text>}