You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2014/06/05 14:51:43 UTC

svn commit: r1600639 - in /manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents: incrementalingest/IncrementalIngester.java interfaces/DocumentIngestStatus.java interfaces/IIncrementalIngester.java

Author: kwright
Date: Thu Jun  5 12:51:43 2014
New Revision: 1600639

URL: http://svn.apache.org/r1600639
Log:
More IIncrementalIngester modifications

Modified:
    manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/incrementalingest/IncrementalIngester.java
    manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/DocumentIngestStatus.java
    manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IIncrementalIngester.java

Modified: manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/incrementalingest/IncrementalIngester.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/incrementalingest/IncrementalIngester.java?rev=1600639&r1=1600638&r2=1600639&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/incrementalingest/IncrementalIngester.java (original)
+++ manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/incrementalingest/IncrementalIngester.java Thu Jun  5 12:51:43 2014
@@ -555,6 +555,54 @@ public class IncrementalIngester extends
     IOutputActivity activities)
     throws ManifoldCFException, ServiceInterruption
   {
+    return documentIngest(new String[0],
+      outputConnectionName,
+      identifierClass, identifierHash,
+      documentVersion,
+      new String[0],
+      outputVersion,
+      parameterVersion,
+      authorityName,
+      data,
+      ingestTime, documentURI,
+      activities);
+  }
+  
+  /** 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
+  * 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 outputConnectionName is the name of the output connection associated with this action.
+  *@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 parameterVersion is the forced parameter version.
+  *@param transformationVersions are the version strings for the transformations to be performed on the document.
+  *@param outputVersion is the output version string constructed from the output specification by the output connector.
+  *@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.
+  *@param ingestTime is the time at which the ingestion took place, in milliseconds since epoch.
+  *@param documentURI is the URI of the document, which will be used as the key of the document in the index.
+  *@param activities is an object providing a set of methods that the implementer can use to perform the operation.
+  *@return true if the ingest was ok, false if the ingest is illegal (and should not be repeated).
+  */
+  public boolean documentIngest(
+    String[] transformationConnectionNames,
+    String outputConnectionName,
+    String identifierClass, String identifierHash,
+    String documentVersion,
+    String[] transformationVersions,
+    String outputVersion,
+    String parameterVersion,
+    String authorityName,
+    RepositoryDocument data,
+    long ingestTime, String documentURI,
+    IOutputActivity activities)
+    throws ManifoldCFException, ServiceInterruption
+  {
+    // MHL
     IOutputConnection connection = connectionManager.load(outputConnectionName);
 
     String docKey = makeKey(identifierClass,identifierHash);
@@ -1803,7 +1851,7 @@ public class IncrementalIngester extends
         String lastOutputVersion = (String)row.getValue(lastOutputVersionField);
         String authorityName = (String)row.getValue(authorityNameField);
         String paramVersion = (String)row.getValue(forcedParamsField);
-        rval[position.intValue()] = new DocumentIngestStatus(lastVersion,lastOutputVersion,authorityName,paramVersion);
+        rval[position.intValue()] = new DocumentIngestStatus(lastVersion,new String[0],lastOutputVersion,authorityName,paramVersion);
       }
     }
   }

Modified: manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/DocumentIngestStatus.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/DocumentIngestStatus.java?rev=1600639&r1=1600638&r2=1600639&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/DocumentIngestStatus.java (original)
+++ manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/DocumentIngestStatus.java Thu Jun  5 12:51:43 2014
@@ -32,15 +32,18 @@ public class DocumentIngestStatus
   public static final String _rcsid = "@(#)$Id: DocumentIngestStatus.java 988245 2010-08-23 18:39:35Z kwright $";
 
   protected final String documentVersionString;
+  protected final String[] transformationVersionStrings;
   protected final String outputVersionString;
   protected final String documentAuthorityNameString;
   protected final String parameterVersionString;
 
   /** Constructor */
-  public DocumentIngestStatus(String documentVersionString, String outputVersionString,
+  public DocumentIngestStatus(String documentVersionString,
+    String[] transformationVersionStrings, String outputVersionString,
     String documentAuthorityNameString, String parameterVersionString)
   {
     this.documentVersionString = documentVersionString;
+    this.transformationVersionStrings = transformationVersionStrings;
     this.outputVersionString = outputVersionString;
     this.documentAuthorityNameString = documentAuthorityNameString;
     this.parameterVersionString = parameterVersionString;
@@ -52,6 +55,12 @@ public class DocumentIngestStatus
     return documentVersionString;
   }
 
+  /** Get the transformation version strings */
+  public String[] getTransformationVersions()
+  {
+    return transformationVersionStrings;
+  }
+  
   /** Get the output version */
   public String getOutputVersion()
   {

Modified: manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IIncrementalIngester.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IIncrementalIngester.java?rev=1600639&r1=1600638&r2=1600639&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IIncrementalIngester.java (original)
+++ manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IIncrementalIngester.java Thu Jun  5 12:51:43 2014
@@ -252,6 +252,40 @@ public interface IIncrementalIngester
     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
+  * 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 outputConnectionName is the name of the output connection associated with this action.
+  *@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 parameterVersion is the forced parameter version.
+  *@param transformationVersions are the version strings for the transformations to be performed on the document.
+  *@param outputVersion is the output version string constructed from the output specification by the output connector.
+  *@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.
+  *@param ingestTime is the time at which the ingestion took place, in milliseconds since epoch.
+  *@param documentURI is the URI of the document, which will be used as the key of the document in the index.
+  *@param activities is an object providing a set of methods that the implementer can use to perform the operation.
+  *@return true if the ingest was ok, false if the ingest is illegal (and should not be repeated).
+  */
+  public boolean documentIngest(
+    String[] transformationConnectionNames,
+    String outputConnectionName,
+    String identifierClass, String identifierHash,
+    String documentVersion,
+    String[] transformationVersions,
+    String outputVersion,
+    String parameterVersion,
+    String authorityName,
+    RepositoryDocument data,
+    long ingestTime, String documentURI,
+    IOutputActivity activities)
+    throws ManifoldCFException, ServiceInterruption;
+
   /** Note the fact that we checked a document (and found that it did not need to be ingested, because the
   * versions agreed).
   *@param outputConnectionName is the name of the output connection associated with this action.