org.apache.oodt.cas.workflow.instrepo
Class DataSourceWorkflowInstanceRepository

java.lang.Object
  extended by org.apache.oodt.cas.workflow.instrepo.AbstractPaginatibleInstanceRepository
      extended by org.apache.oodt.cas.workflow.instrepo.DataSourceWorkflowInstanceRepository
All Implemented Interfaces:
WorkflowInstanceRepository, Pagination

public class DataSourceWorkflowInstanceRepository
extends AbstractPaginatibleInstanceRepository

Version:
$Revision$

A WorkflowInstanceRepository that persists WorkflowInstances to a JDBC-accessible DBMS.

.
Author:
mattmann

Field Summary
 
Fields inherited from class org.apache.oodt.cas.workflow.instrepo.AbstractPaginatibleInstanceRepository
pageSize
 
Fields inherited from interface org.apache.oodt.cas.workflow.instrepo.WorkflowInstanceRepository
X_POINT_ID
 
Constructor Summary
DataSourceWorkflowInstanceRepository(DataSource ds, boolean quoteFields, int pageSize)
           
 
Method Summary
 void addWorkflowInstance(WorkflowInstance wInst)
          Persists the specified WorkflowInstance to the instance repository.
 int getNumWorkflowInstances()
          Gets the number of WorkflowInstances with any status being managed by this WorkflowInstanceRepository.
 int getNumWorkflowInstancesByStatus(String status)
          Gets the number of WorkflowInstances with the given status being managed by this WorkflowInstanceRepository.
 WorkflowInstance getWorkflowInstanceById(String workflowInstId)
           Returns the WorkflowInstances with the specified workflowInstId.
 List getWorkflowInstances()
           
 List getWorkflowInstancesByStatus(String status)
           Returns a List of WorkflowInstances, with the specified status String.
protected  List paginateWorkflows(int pageNum, String status)
           
 void removeWorkflowInstance(WorkflowInstance wInst)
          Removes the specified WorkflowInstance from the instance repository.
 void updateWorkflowInstance(WorkflowInstance wInst)
          Updates and persists the specified WorkflowInstance to the instance repository.
 
Methods inherited from class org.apache.oodt.cas.workflow.instrepo.AbstractPaginatibleInstanceRepository
getFirstPage, getLastPage, getNextPage, getPagedWorkflows, getPagedWorkflows, getPrevPage, paginateWorkflows
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceWorkflowInstanceRepository

public DataSourceWorkflowInstanceRepository(DataSource ds,
                                            boolean quoteFields,
                                            int pageSize)
Method Detail

addWorkflowInstance

public void addWorkflowInstance(WorkflowInstance wInst)
                         throws InstanceRepositoryException
Description copied from interface: WorkflowInstanceRepository
Persists the specified WorkflowInstance to the instance repository.

Parameters:
wInst - The workflow instance to persist.
Throws:
InstanceRepositoryException - If any error occurs.

updateWorkflowInstance

public void updateWorkflowInstance(WorkflowInstance wInst)
                            throws InstanceRepositoryException
Description copied from interface: WorkflowInstanceRepository
Updates and persists the specified WorkflowInstance to the instance repository.

Parameters:
wInst - The workflow instance to update and persist.
Throws:
InstanceRepositoryException - If any error occurs.

removeWorkflowInstance

public void removeWorkflowInstance(WorkflowInstance wInst)
                            throws InstanceRepositoryException
Description copied from interface: WorkflowInstanceRepository
Removes the specified WorkflowInstance from the instance repository.

Parameters:
wInst - The workflow instance to remove.
Throws:
InstanceRepositoryException - If any error occurs.

getWorkflowInstanceById

public WorkflowInstance getWorkflowInstanceById(String workflowInstId)
                                         throws InstanceRepositoryException
Description copied from interface: WorkflowInstanceRepository

Returns the WorkflowInstances with the specified workflowInstId.

Parameters:
workflowInstId - The ID of the WorkflowInstance to return.
Returns:
The specified WorkflowInstance.
Throws:
InstanceRepositoryException - If any error occurs.

getWorkflowInstances

public List getWorkflowInstances()
                          throws InstanceRepositoryException
Returns:
A List of WorkflowInstances that this WorkflowEngine is managing.
Throws:
InstanceRepositoryException - If any error occurs.

getWorkflowInstancesByStatus

public List getWorkflowInstancesByStatus(String status)
                                  throws InstanceRepositoryException
Description copied from interface: WorkflowInstanceRepository

Returns a List of WorkflowInstances, with the specified status String.

Parameters:
status - A string representation of the status of the WorkflowInstance.
Returns:
A List of WorkflowInstances, with the specified status String.
Throws:
InstanceRepositoryException - If there is any error that occurs.

getNumWorkflowInstances

public int getNumWorkflowInstances()
                            throws InstanceRepositoryException
Description copied from interface: WorkflowInstanceRepository
Gets the number of WorkflowInstances with any status being managed by this WorkflowInstanceRepository.

Returns:
The number of WorkflowInstances associated with any status being managed by this WorkflowInstanceRepository.
Throws:
InstanceRepositoryException

getNumWorkflowInstancesByStatus

public int getNumWorkflowInstancesByStatus(String status)
                                    throws InstanceRepositoryException
Description copied from interface: WorkflowInstanceRepository
Gets the number of WorkflowInstances with the given status being managed by this WorkflowInstanceRepository.

Parameters:
status - The status to obtain the number of WorkflowInstances for.
Returns:
The number of WorkflowInstances with the given status.
Throws:
InstanceRepositoryException - If there is any error that occurs.

paginateWorkflows

protected List paginateWorkflows(int pageNum,
                                 String status)
                          throws InstanceRepositoryException
Specified by:
paginateWorkflows in class AbstractPaginatibleInstanceRepository
Returns:
Throws:
InstanceRepositoryException


Copyright © 1999-2011 Apache OODT. All Rights Reserved.