Package org.intermine.task
Class DirectDataLoaderTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.intermine.task.DynamicAttributeTask
-
- org.intermine.task.DirectDataLoaderTask
-
- Direct Known Subclasses:
FileDirectDataLoaderTask
public abstract class DirectDataLoaderTask extends DynamicAttributeTask
This task uses a DirectDataLoader to create objects and store them directly into an ObjectStore using an IntegrationWriter.- Author:
- Kim Rutherford
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
sourceName
-
Constructor Summary
Constructors Constructor Description DirectDataLoaderTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
execute()
DirectDataLoader
getDirectDataLoader()
Return the DirectDataLoader for this Task.protected IntegrationWriter
getIntegrationWriter()
Return the IntegrationWriter for this task.abstract void
process()
Called by execute() to process the data.void
setIgnoreDuplicates(boolean ignoreDuplicates)
Set the value of ignoreDuplicates for the IntegrationWritervoid
setIntegrationWriterAlias(java.lang.String integrationWriterAlias)
Set the IntegrationWriter.void
setSourceName(java.lang.String sourceName)
Set the source name, as used by primary key priority config.void
setSourceType(java.lang.String sourceType)
Set the source type, as used by primary key priority config.-
Methods inherited from class org.intermine.task.DynamicAttributeTask
configureDynamicAttributes
-
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
setIntegrationWriterAlias
public void setIntegrationWriterAlias(java.lang.String integrationWriterAlias)
Set the IntegrationWriter.- Parameters:
integrationWriterAlias
- the name of the IntegrationWriter
-
setSourceName
public void setSourceName(java.lang.String sourceName)
Set the source name, as used by primary key priority config.- Parameters:
sourceName
- the name of the data source
-
setSourceType
public void setSourceType(java.lang.String sourceType)
Set the source type, as used by primary key priority config.- Parameters:
sourceType
- the type of the data source
-
setIgnoreDuplicates
public void setIgnoreDuplicates(boolean ignoreDuplicates)
Set the value of ignoreDuplicates for the IntegrationWriter- Parameters:
ignoreDuplicates
- the value of ignoreDuplicates
-
getIntegrationWriter
protected IntegrationWriter getIntegrationWriter() throws ObjectStoreException
Return the IntegrationWriter for this task.- Returns:
- the IntegrationWriter
- Throws:
ObjectStoreException
- if anything goes wrong
-
getDirectDataLoader
public DirectDataLoader getDirectDataLoader() throws ObjectStoreException
Return the DirectDataLoader for this Task. Must be called only after execute() has been called.- Returns:
- the DirectDataLoader
- Throws:
ObjectStoreException
- if there is an ObjectStore problem when creating the DirectDataLoader
-
process
public abstract void process()
Called by execute() to process the data. This implementation should call DirectDataLoader.createObject() and then DirectDataLoader.store() while processing.
-
execute
public void execute()
- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
- if an ObjectStore method fails
-
-