net.sf.taverna.t2.provenance.connector
Class ProvenanceConnector

java.lang.Object
  extended by net.sf.taverna.t2.provenance.connector.ProvenanceConnector
All Implemented Interfaces:
net.sf.taverna.t2.provenance.reporter.ProvenanceReporter

public abstract class ProvenanceConnector
extends java.lang.Object
implements net.sf.taverna.t2.provenance.reporter.ProvenanceReporter

Collects ProvenanceItems as it travels up and down the dispatch stack inside the InvocationContext

Author:
Ian Dunlop, Stuart Owen

Constructor Summary
ProvenanceConnector()
           
 
Method Summary
 void addProvenanceItem(net.sf.taverna.t2.provenance.item.ProvenanceItem provenanceItem)
          Uses a ScheduledThreadPoolExecutor to process events in a Thread safe manner
 void clearDatabase()
           
 void clearDatabase(boolean isClearDB)
          Clear all the values in the database but keep the db there
 java.util.List<LineageQueryResultRecord> computeLineage(java.lang.String wfInstance, java.lang.String var, java.lang.String proc, java.lang.String path, java.util.Set<java.lang.String> selectedProcessors)
           
abstract  void createDatabase()
          Used by database backed provenance stores.
protected  java.sql.Connection getConnection()
           
 java.lang.String getDataflowInstance(java.lang.String dataflowId)
           
 EventProcessor getEventProcessor()
           
 java.util.concurrent.ExecutorService getExecutor()
           
 net.sf.taverna.t2.invocation.InvocationContext getInvocationContext()
           
abstract  java.lang.String getName()
          The name for this type of provenance connector.
 Provenance getProvenance()
           
 ProvenanceAnalysis getProvenanceAnalysis()
          Use this ProvenanceAnalysis to carry out lineage queries on the provenance
 ProvenanceQuery getQuery()
           
 net.sf.taverna.t2.reference.ReferenceService getReferenceService()
           
 java.lang.String getSaveEvents()
           
 java.lang.String getSessionID()
          What is the unique identifier used by this connector
 WorkflowDataProcessor getWfdp()
           
 ProvenanceWriter getWriter()
           
 void init()
          Set up the the EventProcessor, ProvenanceWriter & ProvenanceQuery.
 boolean isFinished()
           
 void setEventProcessor(EventProcessor eventProcessor)
           
 void setExecutor(java.util.concurrent.ExecutorService executor)
           
 void setFinished(boolean finished)
           
 void setInvocationContext(net.sf.taverna.t2.invocation.InvocationContext invocationContext)
           
 void setProvenance(Provenance provenance)
           
 void setProvenanceAnalysis(ProvenanceAnalysis provenanceAnalysis)
           
protected  void setQuery(ProvenanceQuery query)
           
 void setReferenceService(net.sf.taverna.t2.reference.ReferenceService referenceService)
           
 void setSaveEvents(java.lang.String saveEvents)
           
 void setSessionID(java.lang.String sessionID)
          A unique identifier for this run of provenance, should correspond to the initial WorkflowProvenanceItem idenifier that gets sent through
 void setWfdp(WorkflowDataProcessor wfdp)
           
protected  void setWriter(ProvenanceWriter writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.taverna.t2.provenance.reporter.ProvenanceReporter
getProvenanceCollection
 

Constructor Detail

ProvenanceConnector

public ProvenanceConnector()
Method Detail

init

public void init()
Set up the the EventProcessor, ProvenanceWriter & ProvenanceQuery. Since it is an SPI you don't want any code cluttering the default constructor. Call this method after instantiation and after the dbURL has been set.


getInvocationContext

public net.sf.taverna.t2.invocation.InvocationContext getInvocationContext()
Specified by:
getInvocationContext in interface net.sf.taverna.t2.provenance.reporter.ProvenanceReporter
Returns:
the invocationContext

setInvocationContext

public void setInvocationContext(net.sf.taverna.t2.invocation.InvocationContext invocationContext)
Specified by:
setInvocationContext in interface net.sf.taverna.t2.provenance.reporter.ProvenanceReporter
Parameters:
invocationContext - the invocationContext to set

getReferenceService

public net.sf.taverna.t2.reference.ReferenceService getReferenceService()
Specified by:
getReferenceService in interface net.sf.taverna.t2.provenance.reporter.ProvenanceReporter
Returns:
the referenceService

setReferenceService

public void setReferenceService(net.sf.taverna.t2.reference.ReferenceService referenceService)
Specified by:
setReferenceService in interface net.sf.taverna.t2.provenance.reporter.ProvenanceReporter
Parameters:
referenceService - the referenceService to set

addProvenanceItem

public void addProvenanceItem(net.sf.taverna.t2.provenance.item.ProvenanceItem provenanceItem)
Uses a ScheduledThreadPoolExecutor to process events in a Thread safe manner

Specified by:
addProvenanceItem in interface net.sf.taverna.t2.provenance.reporter.ProvenanceReporter

getConnection

protected java.sql.Connection getConnection()
                                     throws java.lang.InstantiationException,
                                            java.lang.IllegalAccessException,
                                            java.lang.ClassNotFoundException,
                                            java.sql.SQLException
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.sql.SQLException

createDatabase

public abstract void createDatabase()
Used by database backed provenance stores. Ask the implementation to create the database. Requires each datbase type to create all its own tables


clearDatabase

public void clearDatabase()

clearDatabase

public void clearDatabase(boolean isClearDB)
Clear all the values in the database but keep the db there


getName

public abstract java.lang.String getName()
The name for this type of provenance connector. Is used by the workbench to ensure it adds the correct one to the InvocationContext

Returns:

setSessionID

public void setSessionID(java.lang.String sessionID)
A unique identifier for this run of provenance, should correspond to the initial WorkflowProvenanceItem idenifier that gets sent through

Specified by:
setSessionID in interface net.sf.taverna.t2.provenance.reporter.ProvenanceReporter
Parameters:
identifier -

getSessionID

public java.lang.String getSessionID()
What is the unique identifier used by this connector

Specified by:
getSessionID in interface net.sf.taverna.t2.provenance.reporter.ProvenanceReporter
Returns:

computeLineage

public java.util.List<LineageQueryResultRecord> computeLineage(java.lang.String wfInstance,
                                                               java.lang.String var,
                                                               java.lang.String proc,
                                                               java.lang.String path,
                                                               java.util.Set<java.lang.String> selectedProcessors)

getDataflowInstance

public java.lang.String getDataflowInstance(java.lang.String dataflowId)

getSaveEvents

public java.lang.String getSaveEvents()
Returns:
the saveEvents

setSaveEvents

public void setSaveEvents(java.lang.String saveEvents)
Parameters:
saveEvents - the saveEvents to set

setProvenance

public void setProvenance(Provenance provenance)

getProvenance

public Provenance getProvenance()

setFinished

public void setFinished(boolean finished)

isFinished

public boolean isFinished()

setExecutor

public void setExecutor(java.util.concurrent.ExecutorService executor)

getExecutor

public java.util.concurrent.ExecutorService getExecutor()

setProvenanceAnalysis

public void setProvenanceAnalysis(ProvenanceAnalysis provenanceAnalysis)

getProvenanceAnalysis

public ProvenanceAnalysis getProvenanceAnalysis()
Use this ProvenanceAnalysis to carry out lineage queries on the provenance

Returns:

getWriter

public ProvenanceWriter getWriter()
Returns:
the writer

setWriter

protected void setWriter(ProvenanceWriter writer)
Parameters:
writer - the writer to set

getQuery

public ProvenanceQuery getQuery()
Returns:
the query

setQuery

protected void setQuery(ProvenanceQuery query)
Parameters:
query - the query to set

getWfdp

public WorkflowDataProcessor getWfdp()
Returns:
the wfdp

setWfdp

public void setWfdp(WorkflowDataProcessor wfdp)
Parameters:
wfdp - the wfdp to set

getEventProcessor

public EventProcessor getEventProcessor()
Returns:
the eventProcessor

setEventProcessor

public void setEventProcessor(EventProcessor eventProcessor)
Parameters:
eventProcessor - the eventProcessor to set