ReversionProgressStep.java revision bdb5a2eb7bfd1b7c4532654ab6d98f90e6ccd043
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Portions Copyright 2007 Sun Microsystems, Inc.
*/
/**
* Steps during the reversion process.
*/
enum ReversionProgressStep implements ProgressStep {
20, true),
100, false),
null, 100, false),
100, false);
private Message summaryMsg;
private Message logMsgVerbose;
private int progress;
private boolean logWithPoints;
this.summaryMsg = summaryMsg;
this.logMsgVerbose = logMsgVerbose;
this.logWithPoints = logWithPoints;
}
/**
* Return the summary message for the step.
*
* @return the summary message for the step.
*/
public Message getSummaryMessage() {
return summaryMsg;
}
/**
* Return the log message for the step.
* @param isVerbose whether we are running in verbose mode or not.
*
* @return the log message for the step.
*/
if (isVerbose)
{
msg = logMsgVerbose;
}
else
{
}
return msg;
}
/**
* Return whether we must add points to the log message or not.
* @param isVerbose whether we are running in verbose mode or not.
*
* @return <CODE>true</CODE> if we must add points to the log message and
* <CODE>false</CODE> otherwise.
*/
public boolean logRequiresPoints(boolean isVerbose) {
boolean returnValue;
if (logWithPoints)
{
if (isVerbose)
{
}
else
{
returnValue = true;
}
}
else
{
returnValue = false;
}
return returnValue;
}
/**
* Gets the amount of progress to show in the progress meter for this step.
* @return int representing progress
*/
public int getProgress() {
return this.progress;
}
/**
* {@inheritDoc}
*/
public boolean isLast() {
return this == FINISHED ||
this == FINISHED_WITH_ERRORS ||
this == FINISHED_WITH_WARNINGS ||
this == FINISHED_CANCELED;
}
/**
* {@inheritDoc}
*/
public boolean isError() {
return this == FINISHED_WITH_ERRORS;
}
}