org.intermine.bio.dataconversion
Class ChadoProcessor

java.lang.Object
  extended by org.intermine.bio.dataconversion.ChadoProcessor
Direct Known Subclasses:
ModEncodeMetaDataProcessor, SequenceProcessor, StockProcessor

public abstract class ChadoProcessor
extends java.lang.Object

A processor for a chado module. See http://www.gmod.org/wiki/index.php/Chado#Modules for documentation about the possible modules.


Constructor Summary
ChadoProcessor(ChadoDBConverter chadoDBConverter)
          Create a new ChadoModuleProcessor object.
 
Method Summary
 ChadoDBConverter getChadoDBConverter()
          Return the ChadoDBConverter that was passed to the constructor.
 Database getDatabase()
          Return the database to read from
 ItemWriter getItemWriter()
          Return an ItemWriter used to handle the resultant Items
 Model getModel()
          Return the Model of the target database.
abstract  void process(java.sql.Connection connection)
          Do the processing for this module - called by ChadoDBConverter.
protected  void setAttribute(java.lang.Integer intermineObjectId, java.lang.String attributeName, java.lang.String value)
          Set an attribute in an Item by creating an Attribute object and storing it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChadoProcessor

public ChadoProcessor(ChadoDBConverter chadoDBConverter)
Create a new ChadoModuleProcessor object.

Parameters:
chadoDBConverter - the converter that created this Processor
Method Detail

getChadoDBConverter

public ChadoDBConverter getChadoDBConverter()
Return the ChadoDBConverter that was passed to the constructor.

Returns:
the chadoDBConverter

getDatabase

public Database getDatabase()
Return the database to read from

Returns:
the database

getItemWriter

public ItemWriter getItemWriter()
Return an ItemWriter used to handle the resultant Items

Returns:
the writer

getModel

public Model getModel()
Return the Model of the target database.

Returns:
the model

process

public abstract void process(java.sql.Connection connection)
                      throws java.lang.Exception
Do the processing for this module - called by ChadoDBConverter.

Parameters:
connection - the database connection to chado
Throws:
java.lang.Exception - if the is a problem while processing

setAttribute

protected void setAttribute(java.lang.Integer intermineObjectId,
                            java.lang.String attributeName,
                            java.lang.String value)
                     throws ObjectStoreException
Set an attribute in an Item by creating an Attribute object and storing it.

Parameters:
intermineObjectId - the intermine object ID of the item to create this attribute for.
attributeName - the attribute name
value - the value to set
Throws:
ObjectStoreException - if there is a problem while storing