FileDocCategorySizeDatePackage
OperationProgress.javaAPI DocGlassfish v2 API4159Fri May 04 22:33:18 BST 2007com.sun.enterprise.admin.common

OperationProgress

public class OperationProgress extends Object implements Serializable
A class that denotes the Progress of an operation carried out earlier.

Fields Summary
public static final long
serialVersionUID
private boolean
mIsFinished
private String
mMessage
private int
mPercentage
Constructors Summary
public OperationProgress()

	
	 
	
		mIsFinished = false;
		mPercentage = 0;
		mMessage	= "STARTED"; //i18n ?
	
public OperationProgress(int percentage, String message)
Creates new OperationProgress

		if (percentage < 0 || percentage > 100)
		{
			throw new IllegalArgumentException();
		}
		if (percentage == 100)
		{
			mIsFinished = true;
		}
		mPercentage = percentage;
		mMessage	= message;
    
Methods Summary
public java.lang.StringgetMessage()

		return ( mMessage );
	
public intgetPercentage()
Returns the percentage indicating amount of work done.

return
int x such that 0 <= x <= 100.

		return ( mPercentage );
	
public booleanisFinished()
Returns a boolean indicating whether the work is finished.

		return ( mIsFinished );
	
public voidsetIsFinished(boolean finished)
Sets the state to finished or unfinished. If the parameter is true, the internal state of the Object will be modified to show the percentage as 100.

param
boolean representing whether work is done.

		mIsFinished = finished;
		if (finished)
		{
			setPercentage(100);
		}
	
public voidsetPercentage(int percentage)
Sets the percentage to given value. The value may not be greater than 100 or less than 0. If the value is 100, the internal state of this Object will be set to finished.

param
percentage integer representing the percentage of work done.

		if (percentage < 0 || percentage > 100)
		{
			throw new IllegalArgumentException();
		}
		mPercentage = percentage;
		if (percentage == 100)
		{
			mIsFinished = true;
		}