Modified: 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IIncrementalIngester.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IIncrementalIngester.java?rev=1602428&r1=1602427&r2=1602428&view=diff
==============================================================================
--- 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IIncrementalIngester.java
 (original)
+++ 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IIncrementalIngester.java
 Fri Jun 13 13:51:11 2014
@@ -68,26 +68,22 @@ public interface IIncrementalIngester
   public String getOutputDescription(String outputConnectionName, 
OutputSpecification spec)
     throws ManifoldCFException, ServiceInterruption;
 
-  /** Get transformation version strings for a document.
-  *@param transformationConnectionNames are the names of the transformation 
connections associated with this action.
-  *@param specs are the transformation specifications.
-  *@return the description strings.
+  /** Get transformation version string for a document.
+  *@param transformationConnectionName is the names of the transformation 
connection associated with this action.
+  *@param spec is the transformation specification.
+  *@return the description string.
   */
-  public String[] getTransformationDescriptions(String[] 
transformationConnectionNames, OutputSpecification[] specs)
+  public String getTransformationDescription(String 
transformationConnectionName, OutputSpecification spec)
     throws ManifoldCFException, ServiceInterruption;
 
   /** Check if a mime type is indexable.
-  *@param transformationConnectionNames is the ordered list of transformation 
connection names.
-  *@param transformationDescriptions is the ordered list of transformation 
description strings.
-  *@param outputConnectionName is the name of the output connection associated 
with this action.
-  *@param outputDescription is the output description string.
+  *@param pipelineSpecification is the pipeline specification.
   *@param mimeType is the mime type to check.
   *@param activity are the activities available to this method.
   *@return true if the mimeType is indexable.
   */
   public boolean checkMimeTypeIndexable(
-    String[] transformationConnectionNames, String[] 
transformationDescriptions,
-    String outputConnectionName, String outputDescription,
+    IPipelineSpecification pipelineSpecification,
     String mimeType,
     IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption;
@@ -102,17 +98,13 @@ public interface IIncrementalIngester
     throws ManifoldCFException, ServiceInterruption;
 
   /** Check if a file is indexable.
-  *@param transformationConnectionNames is the ordered list of transformation 
connection names.
-  *@param transformationDescriptions is the ordered list of transformation 
description strings.
-  *@param outputConnectionName is the name of the output connection associated 
with this action.
-  *@param outputDescription is the output description string.
+  *@param pipelineSpecification is the pipeline specification.
   *@param localFile is the local file to check.
   *@param activity are the activities available to this method.
   *@return true if the local file is indexable.
   */
   public boolean checkDocumentIndexable(
-    String[] transformationConnectionNames, String[] 
transformationDescriptions,
-    String outputConnectionName, String outputDescription,
+    IPipelineSpecification pipelineSpecification,
     File localFile,
     IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption;
@@ -128,17 +120,13 @@ public interface IIncrementalIngester
 
   /** Pre-determine whether a document's length is indexable by this 
connector.  This method is used by participating repository connectors
   * to help filter out documents that are too long to be indexable.
-  *@param transformationConnectionNames is the ordered list of transformation 
connection names.
-  *@param transformationDescriptions is the ordered list of transformation 
description strings.
-  *@param outputConnectionName is the name of the output connection associated 
with this action.
-  *@param outputDescription is the output description string.
+  *@param pipelineSpecification is the pipeline specification.
   *@param length is the length of the document.
   *@param activity are the activities available to this method.
   *@return true if the file is indexable.
   */
   public boolean checkLengthIndexable(
-    String[] transformationConnectionNames, String[] 
transformationDescriptions,
-    String outputConnectionName, String outputDescription,
+    IPipelineSpecification pipelineSpecification,
     long length,
     IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption;
@@ -155,17 +143,13 @@ public interface IIncrementalIngester
 
   /** Pre-determine whether a document's URL is indexable by this connector.  
This method is used by participating repository connectors
   * to help filter out documents that not indexable.
-  *@param transformationConnectionNames is the ordered list of transformation 
connection names.
-  *@param transformationDescriptions is the ordered list of transformation 
description strings.
-  *@param outputConnectionName is the name of the output connection associated 
with this action.
-  *@param outputDescription is the output description string.
+  *@param pipelineSpecification is the pipeline specification.
   *@param url is the url of the document.
   *@param activity are the activities available to this method.
   *@return true if the file is indexable.
   */
   public boolean checkURLIndexable(
-    String[] transformationConnectionNames, String[] 
transformationDescriptions,
-    String outputConnectionName, String outputDescription,
+    IPipelineSpecification pipelineSpecification,
     String url,
     IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption;
@@ -180,6 +164,22 @@ public interface IIncrementalIngester
   public boolean checkURLIndexable(String outputConnectionName, String 
outputDescription, String url)
     throws ManifoldCFException, ServiceInterruption;
 
+  /** Determine whether we need to fetch or refetch a document.
+  * Pass in information including the pipeline specification with existing 
version info, plus new document and parameter version strings.
+  * If no outputs need to be updated, then this method will return false.  If 
any outputs need updating, then true is returned.
+  *@param pipelineSpecificationWithVersions is the pipeline specification 
including new version info for all transformation and output
+  *  connections.
+  *@param newDocumentVersion is the newly-determined document version.
+  *@param newParameterVersion is the newly-determined parameter version.
+  *@param newAuthorityNameString is the newly-determined authority name.
+  *@return true if the document needs to be refetched.
+  */
+  public boolean checkFetchDocument(
+    IPipelineSpecificationWithVersions pipelineSpecificationWithVersions,
+    String newDocumentVersion,
+    String newParameterVersion,
+    String newAuthorityNameString);
+
   /** Record a document version, but don't ingest it.
   * The purpose of this method is to keep track of the frequency at which 
ingestion "attempts" take place.
   * ServiceInterruption is thrown if this action must be rescheduled.
@@ -190,12 +190,30 @@ public interface IIncrementalIngester
   *@param recordTime is the time at which the recording took place, in 
milliseconds since epoch.
   *@param activities is the object used in case a document needs to be removed 
from the output index as the result of this operation.
   */
+  @Deprecated
   public void documentRecord(String outputConnectionName,
     String identifierClass, String identifierHash,
     String documentVersion, long recordTime,
     IOutputActivity activities)
     throws ManifoldCFException, ServiceInterruption;
 
+  /** Record a document version, but don't ingest it.
+  * The purpose of this method is to keep track of the frequency at which 
ingestion "attempts" take place.
+  * ServiceInterruption is thrown if this action must be rescheduled.
+  *@param pipelineSpecificationBasic is the basic pipeline specification 
needed.
+  *@param identifierClass is the name of the space in which the identifier 
hash should be interpreted.
+  *@param identifierHash is the hashed document identifier.
+  *@param documentVersion is the document version.
+  *@param recordTime is the time at which the recording took place, in 
milliseconds since epoch.
+  *@param activities is the object used in case a document needs to be removed 
from the output index as the result of this operation.
+  */
+  public void documentRecord(
+    IPipelineSpecificationBasic pipelineSpecificationBasic,
+    String identifierClass, String identifierHash,
+    String documentVersion, long recordTime,
+    IOutputActivity activities)
+    throws ManifoldCFException, ServiceInterruption;
+
   /** Ingest a document.
   * This ingests the document, and notes it.  If this is a repeat ingestion of 
the document, this
   * method also REMOVES ALL OLD METADATA.  When complete, the index will 
contain only the metadata
@@ -259,15 +277,10 @@ public interface IIncrementalIngester
   * method also REMOVES ALL OLD METADATA.  When complete, the index will 
contain only the metadata
   * described by the RepositoryDocument object passed to this method.
   * ServiceInterruption is thrown if the document ingestion must be 
rescheduled.
-  *@param transformationConnectionNames are the names of the transformation 
connections associated with this action.
-  *@param transformationDescriptionStrings are the description strings 
corresponding to the transformation connection names.
-  *@param outputConnectionName is the name of the output connection associated 
with this action.
-  *@param otuputDescriptionString is the description string corresponding to 
the output connection.
+  *@param pipelineSpecificationWithVersions is the pipeline specification with 
already-fetched output versioning information.
   *@param identifierClass is the name of the space in which the identifier 
hash should be interpreted.
   *@param identifierHash is the hashed document identifier.
   *@param documentVersion is the document version.
-  *@param transformationVersion is the version string for the transformations 
to be performed on the document.
-  *@param outputVersion is the output version string for the output connection.
   *@param parameterVersion is the version string for the forced parameters.
   *@param authorityName is the name of the authority associated with the 
document, if any.
   *@param data is the document data.  The data is closed after ingestion is 
complete.
@@ -278,14 +291,9 @@ public interface IIncrementalIngester
   *@throws IOException only if data stream throws an IOException.
   */
   public boolean documentIngest(
-    String[] transformationConnectionNames,
-    String[] transformationDescriptionStrings,
-    String outputConnectionName,
-    String outputDescriptionString,
+    IPipelineSpecificationWithVersions pipelineSpecificationWithVersions,
     String identifierClass, String identifierHash,
     String documentVersion,
-    String transformationVersion,
-    String outputVersion,
     String parameterVersion,
     String authorityName,
     RepositoryDocument data,
@@ -300,6 +308,7 @@ public interface IIncrementalIngester
   *@param identifierHashes are the set of document identifier hashes.
   *@param checkTime is the time at which the check took place, in milliseconds 
since epoch.
   */
+  @Deprecated
   public void documentCheckMultiple(String outputConnectionName,
     String[] identifierClasses, String[] identifierHashes,
     long checkTime)
@@ -312,17 +321,45 @@ public interface IIncrementalIngester
   *@param identifierHash is the hashed document identifier.
   *@param checkTime is the time at which the check took place, in milliseconds 
since epoch.
   */
+  @Deprecated
   public void documentCheck(String outputConnectionName,
     String identifierClass, String identifierHash,
     long checkTime)
     throws ManifoldCFException;
 
+  /** Note the fact that we checked a document (and found that it did not need 
to be ingested, because the
+  * versions agreed).
+  *@param pipelineSpecificationBasic is a pipeline specification.
+  *@param identifierClasses are the names of the spaces in which the 
identifier hashes should be interpreted.
+  *@param identifierHashes are the set of document identifier hashes.
+  *@param checkTime is the time at which the check took place, in milliseconds 
since epoch.
+  */
+  public void documentCheckMultiple(
+    IPipelineSpecificationBasic pipelineSpecificationBasic,
+    String[] identifierClasses, String[] identifierHashes,
+    long checkTime)
+    throws ManifoldCFException;
+
+  /** Note the fact that we checked a document (and found that it did not need 
to be ingested, because the
+  * versions agreed).
+  *@param pipelineSpecificationBasic is a basic pipeline specification.
+  *@param identifierClass is the name of the space in which the identifier 
hash should be interpreted.
+  *@param identifierHash is the hashed document identifier.
+  *@param checkTime is the time at which the check took place, in milliseconds 
since epoch.
+  */
+  public void documentCheck(
+    IPipelineSpecificationBasic pipelineSpecificationBasic,
+    String identifierClass, String identifierHash,
+    long checkTime)
+    throws ManifoldCFException;
+
   /** Delete multiple documents from the search engine index.
   *@param outputConnectionNames are the names of the output connections 
associated with this action.
   *@param identifierClasses are the names of the spaces in which the 
identifier hashes should be interpreted.
   *@param identifierHashes is tha array of document identifier hashes if the 
documents.
   *@param activities is the object to use to log the details of the ingestion 
attempt.  May be null.
   */
+  @Deprecated
   public void documentDeleteMultiple(String[] outputConnectionNames,
     String[] identifierClasses, String[] identifierHashes,
     IOutputRemoveActivity activities)
@@ -334,6 +371,7 @@ public interface IIncrementalIngester
   *@param identifierHashes is tha array of document identifier hashes if the 
documents.
   *@param activities is the object to use to log the details of the ingestion 
attempt.  May be null.
   */
+  @Deprecated
   public void documentDeleteMultiple(String outputConnectionName,
     String[] identifierClasses, String[] identifierHashes,
     IOutputRemoveActivity activities)
@@ -345,11 +383,48 @@ public interface IIncrementalIngester
   *@param identifierHash is the hash of the id of the document.
   *@param activities is the object to use to log the details of the ingestion 
attempt.  May be null.
   */
+  @Deprecated
   public void documentDelete(String outputConnectionName,
     String identifierClass, String identifierHash,
     IOutputRemoveActivity activities)
     throws ManifoldCFException, ServiceInterruption;
 
+  /** Delete multiple documents from the search engine index.
+  *@param pipelineSpecificationBasics are the pipeline specifications 
associated with the documents.
+  *@param identifierClasses are the names of the spaces in which the 
identifier hashes should be interpreted.
+  *@param identifierHashes is tha array of document identifier hashes if the 
documents.
+  *@param activities is the object to use to log the details of the ingestion 
attempt.  May be null.
+  */
+  public void documentDeleteMultiple(
+    IPipelineSpecificationBasic[] pipelineSpecificationBasics,
+    String[] identifierClasses, String[] identifierHashes,
+    IOutputRemoveActivity activities)
+    throws ManifoldCFException, ServiceInterruption;
+
+  /** Delete multiple documents from the search engine index.
+  *@param pipelineSpecificationBasic is the basic pipeline specification.
+  *@param identifierClasses are the names of the spaces in which the 
identifier hashes should be interpreted.
+  *@param identifierHashes is tha array of document identifier hashes if the 
documents.
+  *@param activities is the object to use to log the details of the ingestion 
attempt.  May be null.
+  */
+  public void documentDeleteMultiple(
+    IPipelineSpecificationBasic pipelineSpecificationBasic,
+    String[] identifierClasses, String[] identifierHashes,
+    IOutputRemoveActivity activities)
+    throws ManifoldCFException, ServiceInterruption;
+
+  /** Delete a document from the search engine index.
+  *@param pipelineSpecificationBasic is the basic pipeline specification.
+  *@param identifierClass is the name of the space in which the identifier 
hash should be interpreted.
+  *@param identifierHash is the hash of the id of the document.
+  *@param activities is the object to use to log the details of the ingestion 
attempt.  May be null.
+  */
+  public void documentDelete(
+    IPipelineSpecificationBasic pipelineSpecificationBasic,
+    String identifierClass, String identifierHash,
+    IOutputRemoveActivity activities)
+    throws ManifoldCFException, ServiceInterruption;
+
   /** Look up ingestion data for a SET of documents.
   *@param outputConnectionNames are the names of the output connections 
associated with this action.
   *@param identifierClasses are the names of the spaces in which the 
identifier hashes should be interpreted.

Modified: 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecification.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecification.java?rev=1602428&r1=1602427&r2=1602428&view=diff
==============================================================================
--- 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecification.java
 (original)
+++ 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecification.java
 Fri Jun 13 13:51:11 2014
@@ -20,35 +20,17 @@ package org.apache.manifoldcf.agents.int
 
 import org.apache.manifoldcf.core.interfaces.*;
 
-/** This interface describes a multi-output pipeline.  Each stage of the 
pipeline is
-* given a rank number, and dependencies between stages refer to that rank 
number.
+/** This interface describes a multi-output pipeline, where each stage has an 
already-computed
+* description string.
 */
-public interface IPipelineSpecification
+public interface IPipelineSpecification extends IPipelineSpecificationBasic
 {
   public static final String _rcsid = "@(#)$Id$";
 
-  /** Find children of a given pipeline stage.  Pass -1 to find the children 
of the root stage.
-  *@param stage is the stage index to get the children of.
-  *@return the pipeline stages that represent those children.
-  */
-  public int[] getStageChildren(int stage);
-  
-  /** Get the connection name for a pipeline stage.
-  *@param stage is the stage to get the connection name for.
-  *@return the connection name for that stage.
-  */
-  public String getStageConnectionName(int stage);
-
   /** Get the description string for a pipeline stage.
   *@param stage is the stage to get the connection name for.
   *@return the description string that stage.
   */
   public String getStageDescriptionString(int stage);
   
-  /** Check if a stage is an output stage.
-  *@param stage is the stage to check.
-  *@return true if the stage represents an output connection.
-  */
-  public boolean checkStageOutputConnection(int stage);
-  
 }

Added: 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationBasic.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationBasic.java?rev=1602428&view=auto
==============================================================================
--- 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationBasic.java
 (added)
+++ 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationBasic.java
 Fri Jun 13 13:51:11 2014
@@ -0,0 +1,74 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.agents.interfaces;
+
+import org.apache.manifoldcf.core.interfaces.*;
+
+/** This interface describes a multi-output pipeline.  Each stage of the 
pipeline is
+* given a rank number, and dependencies between stages refer to that rank 
number.
+*/
+public interface IPipelineSpecificationBasic
+{
+  public static final String _rcsid = "@(#)$Id$";
+
+  /** Get a count of all stages.
+  *@return the total count of all stages.
+  */
+  public int getStageCount();
+  
+  /** Find children of a given pipeline stage.  Pass -1 to find the children 
of the root stage.
+  *@param stage is the stage index to get the children of.
+  *@return the pipeline stages that represent those children.
+  */
+  public int[] getStageChildren(int stage);
+  
+  /** Find parent of a given pipeline stage.  Returns -1 if there's no parent 
(it's the root).
+  *@param stage is the stage index to get the parent of.
+  *@return the pipeline stage that is the parent, or -1.
+  */
+  public int getStageParent(int stage);
+
+  /** Get the connection name for a pipeline stage.
+  *@param stage is the stage to get the connection name for.
+  *@return the connection name for that stage.
+  */
+  public String getStageConnectionName(int stage);
+
+  /** Check if a stage is an output stage.
+  *@param stage is the stage to check.
+  *@return true if the stage represents an output connection.
+  */
+  public boolean checkStageOutputConnection(int stage);
+  
+  // This part of the interface describes the output connections within.  They
+  // are intrinsically ordered independently of stages.  It is presumed that
+  // no single output connection appears more than once.
+  
+  /** Return the number of output connections.
+  *@return the total number of output connections in this specification.
+  */
+  public int getOutputCount();
+  
+  /** Given an output index, return the stage number for that output.
+  *@param index is the output connection index.
+  *@return the stage number.
+  */
+  public int getOutputStage(int index);
+  
+}

Propchange: 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationBasic.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationBasic.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationWithVersions.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationWithVersions.java?rev=1602428&view=auto
==============================================================================
--- 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationWithVersions.java
 (added)
+++ 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationWithVersions.java
 Fri Jun 13 13:51:11 2014
@@ -0,0 +1,60 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.manifoldcf.agents.interfaces;
+
+import org.apache.manifoldcf.core.interfaces.*;
+
+/** This interface describes a multi-output pipeline, with existing document 
version information from
+* each output.. 
+*/
+public interface IPipelineSpecificationWithVersions extends 
IPipelineSpecification
+{
+  public static final String _rcsid = "@(#)$Id$";
+
+  /** For a given output index, return a document version string.
+  *@param index is the output index.
+  *@return the document version string.
+  */
+  public String getOutputDocumentVersionString(int index);
+  
+  /** For a given output index, return a parameter version string.
+  *@param index is the output index.
+  *@return the parameter version string.
+  */
+  public String getOutputParameterVersionString(int index);
+
+  /** For a given output index, return a transformation version string.
+  *@param index is the output index.
+  *@return the transformation version string.
+  */
+  public String getOutputTransformationVersionString(int index);
+
+  /** For a given output index, return an output version string.
+  *@param index is the output index.
+  *@return the output version string.
+  */
+  public String getOutputVersionString(int index);
+  
+  /** For a given output index, return an authority name string.
+  *@param index is the output index.
+  *@return the authority name string.
+  */
+  public String getAuthorityNameString(int index);
+  
+}

Propchange: 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationWithVersions.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
manifoldcf/branches/CONNECTORS-962/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineSpecificationWithVersions.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: 
manifoldcf/branches/CONNECTORS-962/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/WorkerThread.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-962/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/WorkerThread.java?rev=1602428&r1=1602427&r2=1602428&view=diff
==============================================================================
--- 
manifoldcf/branches/CONNECTORS-962/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/WorkerThread.java
 (original)
+++ 
manifoldcf/branches/CONNECTORS-962/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/WorkerThread.java
 Fri Jun 13 13:51:11 2014
@@ -1804,6 +1804,7 @@ public class WorkerThread extends Thread
     public void recordDocument(String documentIdentifier, String version)
       throws ManifoldCFException, ServiceInterruption
     {
+      // MHL -- this must write a record for all records!!
       String documentIdentifierHash = ManifoldCF.hash(documentIdentifier);
       
ingester.documentRecord(outputName,connectionName,documentIdentifierHash,version,currentTime,ingestLogger);
     }
@@ -2787,15 +2788,12 @@ public class WorkerThread extends Thread
 
   /** Pipeline specification implementation.
   */
-  protected static class PipelineSpecification implements 
IPipelineSpecification
+  protected static class PipelineSpecificationBasic implements 
IPipelineSpecificationBasic
   {
     protected final String[] transformationConnectionNames;
     protected final String outputConnectionName;
-    protected final String[] transformationDescriptionStrings;
-    protected final String outputDescriptionString;
     
-    public PipelineSpecification(IJobDescription job, String[] 
transformationDescriptionStrings,
-      String outputDescriptionString)
+    public PipelineSpecificationBasic(IJobDescription job)
     {
       transformationConnectionNames = new String[job.countPipelineStages()];
       outputConnectionName = job.getOutputConnectionName();
@@ -2803,14 +2801,22 @@ public class WorkerThread extends Thread
       {
         transformationConnectionNames[i] = 
job.getPipelineStageConnectionName(i);
       }
-      this.transformationDescriptionStrings = transformationDescriptionStrings;
-      this.outputDescriptionString = outputDescriptionString;
     }
     
+    /** Get a count of all stages.
+    *@return the total count of all stages.
+    */
+    @Override
+    public int getStageCount()
+    {
+      return transformationConnectionNames.length + 1;
+    }
+
     /** Find children of a given pipeline stage.  Pass -1 to find the children 
of the root stage.
     *@param stage is the stage index to get the children of.
     *@return the pipeline stages that represent those children.
     */
+    @Override
     public int[] getStageChildren(int stage)
     {
       if (stage < transformationConnectionNames.length + 1)
@@ -2818,10 +2824,20 @@ public class WorkerThread extends Thread
       return new int[0];
     }
     
+    /** Find parent of a given pipeline stage.  Returns -1 if there's no 
parent (it's the root).
+    *@param stage is the stage index to get the parent of.
+    *@return the pipeline stage that is the parent, or -1.
+    */
+    public int getStageParent(int stage)
+    {
+      return stage - 1;
+    }
+
     /** Get the connection name for a pipeline stage.
     *@param stage is the stage to get the connection name for.
     *@return the connection name for that stage.
     */
+    @Override
     public String getStageConnectionName(int stage)
     {
       if (stage < transformationConnectionNames.length)
@@ -2829,10 +2845,53 @@ public class WorkerThread extends Thread
       return outputConnectionName;
     }
     
+    /** Check if a stage is an output stage.
+    *@param stage is the stage to check.
+    *@return true if the stage represents an output connection.
+    */
+    @Override
+    public boolean checkStageOutputConnection(int stage)
+    {
+      return stage == transformationConnectionNames.length;
+    }
+
+    /** Return the number of output connections.
+    *@return the total number of output connections in this specification.
+    */
+    public int getOutputCount()
+    {
+      return 1;
+    }
+    
+    /** Given an output index, return the stage number for that output.
+    *@param index is the output connection index.
+    *@return the stage number.
+    */
+    public int getOutputStage(int index)
+    {
+      return transformationConnectionNames.length;
+    }
+
+  }
+  
+  protected static class PipelineSpecification extends 
PipelineSpecificationBasic implements IPipelineSpecification
+  {
+    protected final String[] transformationDescriptionStrings;
+    protected final String outputDescriptionString;
+    
+    public PipelineSpecificationBasic(IJobDescription job, String[] 
transformationDescriptionStrings,
+      String outputDescriptionString)
+    {
+      super(job);
+      this.transformationDescriptionStrings = transformationDescriptionStrings;
+      this.outputDescriptionString = outputDescriptionString;
+    }
+    
     /** Get the description string for a pipeline stage.
     *@param stage is the stage to get the connection name for.
     *@return the description string that stage.
     */
+    @Override
     public String getStageDescriptionString(int stage)
     {
       if (stage < transformationConnectionNames.length)
@@ -2840,15 +2899,5 @@ public class WorkerThread extends Thread
       return outputDescriptionString;
     }
 
-    /** Check if a stage is an output stage.
-    *@param stage is the stage to check.
-    *@return true if the stage represents an output connection.
-    */
-    public boolean checkStageOutputConnection(int stage)
-    {
-      return stage == transformationConnectionNames.length;
-    }
-
   }
-  
 }


Reply via email to