manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1438665 - in /manifoldcf/branches/CONNECTORS-552-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler: interfaces/IJobDescription.java jobs/JobDescription.java
Date Fri, 25 Jan 2013 19:48:43 GMT
Author: kwright
Date: Fri Jan 25 19:48:42 2013
New Revision: 1438665

URL: http://svn.apache.org/viewvc?rev=1438665&view=rev
Log:
Add JobDescription ability to handle forced metadata.

Modified:
    manifoldcf/branches/CONNECTORS-552-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobDescription.java
    manifoldcf/branches/CONNECTORS-552-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobDescription.java

Modified: manifoldcf/branches/CONNECTORS-552-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobDescription.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-552-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobDescription.java?rev=1438665&r1=1438664&r2=1438665&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-552-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobDescription.java
(original)
+++ manifoldcf/branches/CONNECTORS-552-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobDescription.java
Fri Jan 25 19:48:42 2013
@@ -225,4 +225,19 @@ public interface IJobDescription
   /** Set the hopcount mode. */
   public void setHopcountMode(int mode);
 
+  // Forced metadata
+  
+  /** Get the forced metadata.
+  *@return the set as a map, keyed by metadata name, with value a set of strings.
+  */
+  public Map<String,Set<String>> getForcedMetadata();
+  
+  /** Clear forced metadata.
+  */
+  public void clearForcedMetadata();
+  
+  /** Add a forced metadata name/value pair.
+  */
+  public void addForcedMetadataValue(String name, String value);
+  
 }

Modified: manifoldcf/branches/CONNECTORS-552-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobDescription.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-552-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobDescription.java?rev=1438665&r1=1438664&r2=1438665&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-552-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobDescription.java
(original)
+++ manifoldcf/branches/CONNECTORS-552-2/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobDescription.java
Fri Jan 25 19:48:42 2013
@@ -75,6 +75,9 @@ public class JobDescription implements I
   // Hopcount mode
   protected int hopcountMode = HOPCOUNT_ACCURATE;
 
+  // Forced metadata
+  protected Map<String,Set<String>> forcedMetadata = new HashMap<String,Set<String>>();
+  
   // Read-only mode
   protected boolean readOnly = false;
 
@@ -109,6 +112,14 @@ public class JobDescription implements I
       Long maxHops = (Long)hopCountFilters.get(linkType);
       rval.hopCountFilters.put(linkType,maxHops);
     }
+    for (String forcedParamName : forcedMetadata.keySet())
+    {
+      Set<String> values = forcedMetadata.get(forcedParamName);
+      for (String value : values)
+      {
+        rval.addForcedMetadataValue(forcedParamName,value);
+      }
+    }
     // Direct modification of this object is possible - so it also has to know if it is read-only!!
     rval.outputSpecification = outputSpecification.duplicate(readOnly);
     // Direct modification of this object is possible - so it also has to know if it is read-only!!
@@ -444,4 +455,34 @@ public class JobDescription implements I
     hopcountMode = mode;
   }
 
+  // Forced metadata
+  
+  /** Get the forced metadata.
+  *@return the set as a map, keyed by metadata name, with value a set of strings.
+  */
+  public Map<String,Set<String>> getForcedMetadata()
+  {
+    return forcedMetadata;
+  }
+  
+  /** Clear forced metadata.
+  */
+  public void clearForcedMetadata()
+  {
+    forcedMetadata.clear();
+  }
+  
+  /** Add a forced metadata name/value pair.
+  */
+  public void addForcedMetadataValue(String name, String value)
+  {
+    Set<String> rval = forcedMetadata.get(name);
+    if (rval == null)
+    {
+      rval = new HashSet<String>();
+      forcedMetadata.put(name,rval);
+    }
+    rval.add(value);
+  }
+
 }



Mime
View raw message