com.atlassian.jira.task
Class ScalingTaskProgessSink

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

public class ScalingTaskProgessSink
extends Object
implements TaskProgressSink

Takes the "virtual progress" made and scales it into an "actual progress" for the contained sink. For example, this can take the progress range from virtual range [0, 100] and map it to the actual range [23, 47] on the contained sink.

Since:
v3.13

Field Summary
 
Fields inherited from interface com.atlassian.jira.task.TaskProgressSink
NULL_SINK
 
Constructor Summary
ScalingTaskProgessSink(long actualStart, long actualEnd, long virtualStart, long virtualEnd, TaskProgressSink delegateSink)
          Create the sink with the specified virtual and actual progress ranges.
ScalingTaskProgessSink(long actualStart, long actualEnd, TaskProgressSink delegateSink)
          Create the sink with the specified actual range.
 
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

ScalingTaskProgessSink

public ScalingTaskProgessSink(long actualStart,
                              long actualEnd,
                              long virtualStart,
                              long virtualEnd,
                              TaskProgressSink delegateSink)
Create the sink with the specified virtual and actual progress ranges.

Parameters:
actualStart - the start of the actual range inclusive.
actualEnd - the end of the actual range inclusive.
virtualStart - the start of the virtual range inclusive.
virtualEnd - the end of the virtual range inclusive.
delegateSink - the sink to actually report progress on.

ScalingTaskProgessSink

public ScalingTaskProgessSink(long actualStart,
                              long actualEnd,
                              TaskProgressSink delegateSink)
Create the sink with the specified actual range. The virtual range will be set to [0, 100].

Parameters:
actualStart - the start of the actual range inclusive.
actualEnd - the end of the actual range inclusive.
delegateSink - the sink to actually report progress on.
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.

Specified by:
makeProgress in interface TaskProgressSink
Parameters:
taskProgress - the current "virtual progress" for the task.
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-2009 Atlassian. All Rights Reserved.