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 11:15:59 UTC

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

Author: kwright
Date: Thu Jun  5 09:15:59 2014
New Revision: 1600571

URL: http://svn.apache.org/r1600571
Log:
More IIncrementalIngester revision

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/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=1600571&r1=1600570&r2=1600571&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 09:15:59 2014
@@ -215,7 +215,7 @@ public class IncrementalIngester extends
   {
     return checkMimeTypeIndexable(new String[0], new String[0],
       outputConnectionName, outputDescription,
-      mimeType);
+      mimeType,null);
   }
 
   /** Check if a mime type is indexable.
@@ -224,13 +224,15 @@ public class IncrementalIngester extends
   *@param outputConnectionName is the name of the output connection associated with this action.
   *@param outputDescription is the output description string.
   *@param mimeType is the mime type to check.
+  *@param activity are the activities available to this method.
   *@return true if the mimeType is indexable.
   */
   @Override
   public boolean checkMimeTypeIndexable(
     String[] transformationConnectionNames, String[] transformationDescriptions,
     String outputConnectionName, String outputDescription,
-    String mimeType)
+    String mimeType,
+    IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption
   {
     // MHL to handle the pipeline
@@ -241,7 +243,7 @@ public class IncrementalIngester extends
       throw new ServiceInterruption("Output connector not installed",0L);
     try
     {
-      return connector.checkMimeTypeIndexable(outputDescription,mimeType,null);
+      return connector.checkMimeTypeIndexable(outputDescription,mimeType,activity);
     }
     finally
     {
@@ -261,7 +263,7 @@ public class IncrementalIngester extends
   {
     return checkDocumentIndexable(new String[0], new String[0],
       outputConnectionName, outputDescription,
-      localFile);
+      localFile,null);
   }
   
   /** Check if a file is indexable.
@@ -270,13 +272,15 @@ public class IncrementalIngester extends
   *@param outputConnectionName is the name of the output connection associated with this action.
   *@param outputDescription is the output description string.
   *@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.
   */
   @Override
   public boolean checkDocumentIndexable(
     String[] transformationConnectionNames, String[] transformationDescriptions,
     String outputConnectionName, String outputDescription,
-    File localFile)
+    File localFile,
+    IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption
   {
     // MHL
@@ -287,7 +291,7 @@ public class IncrementalIngester extends
       throw new ServiceInterruption("Output connector not installed",0L);
     try
     {
-      return connector.checkDocumentIndexable(outputDescription,localFile,null);
+      return connector.checkDocumentIndexable(outputDescription,localFile,activity);
     }
     finally
     {
@@ -308,7 +312,7 @@ public class IncrementalIngester extends
   {
     return checkLengthIndexable(new String[0], new String[0],
       outputConnectionName, outputDescription,
-      length);
+      length,null);
   }
   
   /** Pre-determine whether a document's length is indexable by this connector.  This method is used by participating repository connectors
@@ -318,13 +322,15 @@ public class IncrementalIngester extends
   *@param outputConnectionName is the name of the output connection associated with this action.
   *@param outputDescription is the output description string.
   *@param length is the length of the document.
+  *@param activity are the activities available to this method.
   *@return true if the file is indexable.
   */
   @Override
   public boolean checkLengthIndexable(
     String[] transformationConnectionNames, String[] transformationDescriptions,
     String outputConnectionName, String outputDescription,
-    long length)
+    long length,
+    IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption
   {
     // MHL
@@ -335,7 +341,7 @@ public class IncrementalIngester extends
       throw new ServiceInterruption("Output connector not installed",0L);
     try
     {
-      return connector.checkLengthIndexable(outputDescription,length,null);
+      return connector.checkLengthIndexable(outputDescription,length,activity);
     }
     finally
     {
@@ -356,7 +362,7 @@ public class IncrementalIngester extends
   {
     return checkURLIndexable(new String[0], new String[0],
       outputConnectionName, outputDescription,
-      url);
+      url,null);
   }
   
   /** Pre-determine whether a document's URL is indexable by this connector.  This method is used by participating repository connectors
@@ -366,13 +372,15 @@ public class IncrementalIngester extends
   *@param outputConnectionName is the name of the output connection associated with this action.
   *@param outputDescription is the output description string.
   *@param url is the url of the document.
+  *@param activity are the activities available to this method.
   *@return true if the file is indexable.
   */
   @Override
   public boolean checkURLIndexable(
     String[] transformationConnectionNames, String[] transformationDescriptions,
     String outputConnectionName, String outputDescription,
-    String url)
+    String url,
+    IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption
   {
     // MHL
@@ -383,7 +391,7 @@ public class IncrementalIngester extends
       throw new ServiceInterruption("Output connector not installed",0L);
     try
     {
-      return connector.checkURLIndexable(outputDescription,url,null);
+      return connector.checkURLIndexable(outputDescription,url,activity);
     }
     finally
     {
@@ -416,28 +424,35 @@ public class IncrementalIngester extends
 
   }
 
-  /** Get a transformation version string for a document.
-  *@param transformationConnectionName is the name of the transformation connection associated with this action.
-  *@param spec is the transformation specification.
-  *@return the description string.
+  /** 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.
   */
   @Override
-  public String getTransformationDescription(String transformationConnectionName, OutputSpecification spec)
+  public String[] getTransformationDescriptions(String[] transformationConnectionNames, OutputSpecification[] specs)
     throws ManifoldCFException, ServiceInterruption
   {
-    ITransformationConnection connection = transformationConnectionManager.load(transformationConnectionName);
-    ITransformationConnector connector = transformationConnectorPool.grab(connection);
-    if (connector == null)
-      // The connector is not installed; treat this as a service interruption.
-      throw new ServiceInterruption("Transformation connector not installed",0L);
-    try
-    {
-      return connector.getPipelineDescription(spec);
-    }
-    finally
+    String[] rval = new String[transformationConnectionNames.length];
+    for (int i = 0; i < rval.length; i++)
     {
-      transformationConnectorPool.release(connection,connector);
+      String transformationConnectionName = transformationConnectionNames[i];
+      OutputSpecification spec = specs[i];
+      ITransformationConnection connection = transformationConnectionManager.load(transformationConnectionName);
+      ITransformationConnector connector = transformationConnectorPool.grab(connection);
+      if (connector == null)
+        // The connector is not installed; treat this as a service interruption.
+        throw new ServiceInterruption("Transformation connector not installed",0L);
+      try
+      {
+        rval[i] = connector.getPipelineDescription(spec);
+      }
+      finally
+      {
+        transformationConnectorPool.release(connection,connector);
+      }
     }
+    return rval;
   }
 
   /** Record a document version, but don't ingest it.

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=1600571&r1=1600570&r2=1600571&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 09:15:59 2014
@@ -68,12 +68,12 @@ public interface IIncrementalIngester
   public String getOutputDescription(String outputConnectionName, OutputSpecification spec)
     throws ManifoldCFException, ServiceInterruption;
 
-  /** Get a transformation version string for a document.
-  *@param transformationConnectionName is the name of the transformation connection associated with this action.
-  *@param spec is the transformation specification.
-  *@return the description string.
+  /** 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.
   */
-  public String getTransformationDescription(String transformationConnectionName, OutputSpecification spec)
+  public String[] getTransformationDescriptions(String[] transformationConnectionNames, OutputSpecification[] specs)
     throws ManifoldCFException, ServiceInterruption;
 
   /** Check if a mime type is indexable.
@@ -82,12 +82,14 @@ public interface IIncrementalIngester
   *@param outputConnectionName is the name of the output connection associated with this action.
   *@param outputDescription is the output description string.
   *@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,
-    String mimeType)
+    String mimeType,
+    IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption;
 
   /** Check if a mime type is indexable.
@@ -105,12 +107,14 @@ public interface IIncrementalIngester
   *@param outputConnectionName is the name of the output connection associated with this action.
   *@param outputDescription is the output description string.
   *@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,
-    File localFile)
+    File localFile,
+    IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption;
 
   /** Check if a file is indexable.
@@ -129,12 +133,14 @@ public interface IIncrementalIngester
   *@param outputConnectionName is the name of the output connection associated with this action.
   *@param outputDescription is the output description string.
   *@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,
-    long length)
+    long length,
+    IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption;
 
   /** Pre-determine whether a document's length is indexable by this connector.  This method is used by participating repository connectors
@@ -154,12 +160,14 @@ public interface IIncrementalIngester
   *@param outputConnectionName is the name of the output connection associated with this action.
   *@param outputDescription is the output description string.
   *@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,
-    String url)
+    String url,
+    IOutputCheckActivity activity)
     throws ManifoldCFException, ServiceInterruption;
 
   /** Pre-determine whether a document's URL is indexable by this connector.  This method is used by participating repository connectors