org.intermine.dataloader
Class PriorityConfig

java.lang.Object
  extended by org.intermine.dataloader.PriorityConfig

public class PriorityConfig
extends java.lang.Object

Class holding data source priority configuration for a Model.


Constructor Summary
PriorityConfig(Model model)
          Constructor.
 
Method Summary
protected  java.util.List<java.lang.String> getPriorities(java.lang.Class<? extends FastPathObject> clazz, java.lang.String fieldName)
          Returns a List of data source names representing the priority for a given class and fieldname pair.
static void verify(Model model, java.lang.String sources)
          Verifies the priorities config given the list of data sources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriorityConfig

public PriorityConfig(Model model)
Constructor.

Parameters:
model - the Model of the production database
Throws:
java.lang.IllegalArgumentException - if the priorities are misconfigured
Method Detail

verify

public static void verify(Model model,
                          java.lang.String sources)
Verifies the priorities config given the list of data sources.

Parameters:
model - the Model of the production database
sources - the space-separated list of data sources
Throws:
java.lang.IllegalArgumentException - if a source is mentioned in the priorities file but not the project.xml file

getPriorities

protected java.util.List<java.lang.String> getPriorities(java.lang.Class<? extends FastPathObject> clazz,
                                                         java.lang.String fieldName)
Returns a List of data source names representing the priority for a given class and fieldname pair. This method searches all the parent classes for a priority config, and throws an exception if more than one is found. Results are cached for performance.

Parameters:
clazz - the class of the object being created
fieldName - the name of the field that the priority is for
Returns:
a List of data source names
Throws:
java.lang.IllegalArgumentException - if more than one priority config matches