offlineProcessing
Class OfflineTaskGroup

java.lang.Object
  extended by offlineProcessing.OfflineTaskGroup

public class OfflineTaskGroup
extends java.lang.Object

Author:
Doug Gillespie Handles a series of offline tasks which all use a common data block so that data can be loaded, a whole series of tasks completed and the data then saved in a single operation.

This will be the primary interface to OfflineTasks - even if there is only one task it will be in a group of one !


Nested Class Summary
(package private)  class OfflineTaskGroup.TaskGroupWorker
          Swing worker to do the actual work.
 
Field Summary
private  java.util.ArrayList<PamDataBlock> affectedDataBlocks
          Summary list of all data blocks affected by the list.
private  java.util.ArrayList<OfflineTask> offlineTasks
           
private  PamControlledUnit pamControlledUnit
           
private  PamDataBlock primaryDataBlock
          Data block used by ALL tasks in the group.
static int PROCESS_ALL
          Process all data in the datastore (binary, database, or wherever).
static int PROCESS_LOADED
          process only the data currently loaded in memory.
private  int processTime
          time period flag = PROCESS_LOADED or PROCESS_ALL
private  java.util.ArrayList<PamDataBlock> requiredDataBlocks
          Summary list of all data blocks required by all tasks in the list.
private  TaskMonitor taskMonitor
          A task monitor which will receive progress updates as the tasks complete.
private  OfflineTaskGroup.TaskGroupWorker worker
           
 
Constructor Summary
OfflineTaskGroup(PamControlledUnit pamControlledUnit)
          PamControlledunit required in constructor since some bookkeeping will be goign on in the backgroun which will need the unit type and name.
 
Method Summary
 void addTask(OfflineTask task)
           
 int getNTasks()
           
 PamDataBlock getPrimaryDataBlock()
           
 int getProcessTime()
           
 OfflineTask getTask(int iTask)
           
 TaskMonitor getTaskMonitor()
           
 void killTasks()
           
private  void newMonitorData(TaskMonitorData monData)
           
 boolean runTasks(int dataChoice)
          Run all the tasks.
 void setProcessTime(int processTime)
           
 void setSummaryLists()
          Setup summary lists of required and affected datablocks based on which tasks are actually going to run .
 void setTaskMonitor(TaskMonitor taskMonitor)
           
 void tasksDone()
          some bookkeeping - write information about task completion to the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requiredDataBlocks

private java.util.ArrayList<PamDataBlock> requiredDataBlocks
Summary list of all data blocks required by all tasks in the list.


affectedDataBlocks

private java.util.ArrayList<PamDataBlock> affectedDataBlocks
Summary list of all data blocks affected by the list.


pamControlledUnit

private PamControlledUnit pamControlledUnit

taskMonitor

private TaskMonitor taskMonitor
A task monitor which will receive progress updates as the tasks complete.


PROCESS_LOADED

public static final int PROCESS_LOADED
process only the data currently loaded in memory.

See Also:
Constant Field Values

PROCESS_ALL

public static final int PROCESS_ALL
Process all data in the datastore (binary, database, or wherever).

See Also:
Constant Field Values

processTime

private int processTime
time period flag = PROCESS_LOADED or PROCESS_ALL


primaryDataBlock

private PamDataBlock primaryDataBlock
Data block used by ALL tasks in the group.


offlineTasks

private java.util.ArrayList<OfflineTask> offlineTasks

worker

private OfflineTaskGroup.TaskGroupWorker worker
Constructor Detail

OfflineTaskGroup

public OfflineTaskGroup(PamControlledUnit pamControlledUnit)
PamControlledunit required in constructor since some bookkeeping will be goign on in the backgroun which will need the unit type and name.

Parameters:
pamControlledUnit -
Method Detail

setSummaryLists

public void setSummaryLists()
Setup summary lists of required and affected datablocks based on which tasks are actually going to run .


runTasks

public boolean runTasks(int dataChoice)
Run all the tasks.

Parameters:
dataChoice -
Returns:

killTasks

public void killTasks()

addTask

public void addTask(OfflineTask task)
Parameters:
task - task to add to the group

getNTasks

public int getNTasks()
Returns:
the number of tasks in the group

getTask

public OfflineTask getTask(int iTask)
Parameters:
iTask - the task number
Returns:
the task.

getProcessTime

public int getProcessTime()
Returns:
the processTime

setProcessTime

public void setProcessTime(int processTime)
Parameters:
processTime - the processTime to set

getPrimaryDataBlock

public PamDataBlock getPrimaryDataBlock()
Returns:
the primaryDataBlock

getTaskMonitor

public TaskMonitor getTaskMonitor()
Returns:
the taskMonitor

setTaskMonitor

public void setTaskMonitor(TaskMonitor taskMonitor)
Parameters:
taskMonitor - the taskMonitor to set

newMonitorData

private void newMonitorData(TaskMonitorData monData)

tasksDone

public void tasksDone()
some bookkeeping - write information about task completion to the database.