Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.instance.orient.storage
Class StoreInstancesJob

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.core.internal.jobs.InternalJob
          extended by org.eclipse.core.runtime.jobs.Job
              extended by eu.esdihumboldt.hale.common.instance.orient.storage.StoreInstancesJob
All Implemented Interfaces:
Comparable, org.eclipse.core.runtime.IAdaptable
Direct Known Subclasses:
HaleStoreInstancesJob

public abstract class StoreInstancesJob
extends org.eclipse.core.runtime.jobs.Job

Store instances in a database

Author:
Simon Templer

Field Summary
protected  Reporter<Message> report
          The job report, may be null.
 
Fields inherited from class org.eclipse.core.runtime.jobs.Job
ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING
 
Fields inherited from class org.eclipse.core.internal.jobs.InternalJob
manager
 
Constructor Summary
StoreInstancesJob(String name, LocalOrientDB database, InstanceCollection instances, ReportHandler reportHandler)
          Create a job that stores instances in a database
 
Method Summary
protected abstract  void onComplete()
          Called when the job has been completed
protected  void processInstance(Instance instance)
          Process an instance before it is saved.
 org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
           
protected  void updateInstance(MutableInstance instance)
          Update an instance before it is converted and saved, e.g.
 
Methods inherited from class org.eclipse.core.runtime.jobs.Job
addJobChangeListener, belongsTo, cancel, canceling, done, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, removeJobChangeListener, schedule, schedule, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRule
 
Methods inherited from class org.eclipse.core.internal.jobs.InternalJob
compareTo
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

report

protected final Reporter<Message> report
The job report, may be null.

Constructor Detail

StoreInstancesJob

public StoreInstancesJob(String name,
                         LocalOrientDB database,
                         InstanceCollection instances,
                         ReportHandler reportHandler)
Create a job that stores instances in a database

Parameters:
name - the (human readable) job name
instances - the instances to store in the database
database - the database
reportHandler - the report handler, null if no report should be generated
Method Detail

run

public org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
Specified by:
run in class org.eclipse.core.runtime.jobs.Job
See Also:
Job.run(IProgressMonitor)

updateInstance

protected void updateInstance(MutableInstance instance)
Update an instance before it is converted and saved, e.g. adding metadata. The default implementation does nothing and may be overridden.

Parameters:
instance - the instance

processInstance

protected void processInstance(Instance instance)
Process an instance before it is saved. The default implementation does nothing and may be overridden.

Parameters:
instance - the instance, may not be changed in any way

onComplete

protected abstract void onComplete()
Called when the job has been completed


Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d