com.atlassian.jira.task
Class StepTaskProgressSink

java.lang.Object
  extended by com.atlassian.jira.task.StepTaskProgressSink
All Implemented Interfaces:
TaskProgressSink

public class StepTaskProgressSink
extends Object
implements TaskProgressSink

Sink that divides a range a progress range into a number of steps. For instance, this can be used to divide a percentage range up to progress can be reported.

This can be used to track the progress of a task that is made up of a number of individual steps. For example, migrating issue workflow requires that each issue in a project be updated with the new workflow. This class can be used to output a percentage based on the number of issues currently processed using:

   TaskProgressSink stepSink = new StepTaskProgressSink(0, 100, numberOfIssues, rootSink).
   for (each issue)
   {
      stepSink.makeProgress(currentIssue, "Migrating Issue Workflow", "Processing issue.....");
   }
 

Since:
v3.13

Field Summary
 
Fields inherited from interface com.atlassian.jira.task.TaskProgressSink
NULL_SINK
 
Constructor Summary
StepTaskProgressSink(long startProgress, long endProgress, long actions, TaskProgressSink sink)
          Create the Sink with the passed parameters.
 
Method Summary
 void makeProgress(long taskProgress, String currentSubTask, String message)
          This method can be called to indicate that progress is being made by a task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StepTaskProgressSink

public StepTaskProgressSink(long startProgress,
                            long endProgress,
                            long actions,
                            TaskProgressSink sink)
Create the Sink with the passed parameters.

Parameters:
startProgress - the start of the range.
endProgress - the end of the range.
actions - the number of actions to divide the range into.
sink - the sink actually used to publish the results.
Method Detail

makeProgress

public void makeProgress(long taskProgress,
                         String currentSubTask,
                         String message)
This method can be called to indicate that progress is being made by a task. In this case an progress is made by completeing a particular action.

Specified by:
makeProgress in interface TaskProgressSink
Parameters:
taskProgress - the current step.
currentSubTask - the name of the current sub task or null if there isnt one
message - an optional message about the progress or null


Copyright © 2002-2008 Atlassian. All Rights Reserved.