com.atlassian.core.util
Class ProgressMeter

java.lang.Object
  extended by com.atlassian.core.util.ProgressMeter

public class ProgressMeter
extends Object

A ProgressMeter class may be used to record progress of an on-going task while this progress is being monitored by another client. To support this use case the class is thread safe.


Constructor Summary
ProgressMeter()
           
 
Method Summary
 int getCurrentCount()
           
 int getPercentageComplete()
           
 String getStatus()
           
 int getTotal()
           
 boolean isCompletedSuccessfully()
          This method should only be called once you know the task is complete (which is discovered by calling getPercentageComplete().
 void setCompletedSuccessfully(boolean completedSuccessfully)
           
 void setCurrentCount(int currentCount)
           
 void setPercentage(int percentageComplete)
           
 void setPercentage(int count, int total)
          Use this method to set the completion %age to object 10 of 30 etc.
 void setStatus(String status)
           
 void setTotalObjects(int total)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressMeter

public ProgressMeter()
Method Detail

setPercentage

public void setPercentage(int count,
                          int total)
Use this method to set the completion %age to object 10 of 30 etc.

Parameters:
count - The current object count in progress
total - The total number of objects to be processed

setStatus

public void setStatus(String status)

getPercentageComplete

public int getPercentageComplete()
Returns:
the percentage completion. A value of 100 can be taken to indicate that progress is finished.

getStatus

public String getStatus()

setPercentage

public void setPercentage(int percentageComplete)

getCurrentCount

public int getCurrentCount()

setCurrentCount

public void setCurrentCount(int currentCount)

getTotal

public int getTotal()

setTotalObjects

public void setTotalObjects(int total)

isCompletedSuccessfully

public boolean isCompletedSuccessfully()
This method should only be called once you know the task is complete (which is discovered by calling getPercentageComplete().

Returns:
true if the task completed successfully; false if there was an error which prevented the task from completing.

setCompletedSuccessfully

public void setCompletedSuccessfully(boolean completedSuccessfully)


Copyright © 2015 Atlassian. All rights reserved.