public void incrementProgress(double increment) { status.setProgress(status.getProgress() + increment); statusUpdated(status); } public long getDuration() {
private void accept(IJobStatusVisitor visitor, String jobId) { if (visitor != null) { visitor.visitJobStatus(getJobStatus(jobId)); for (IJobStatus child : getChildren(jobId)) { accept(visitor, child.getJobId()); } } }
public void setProgress(double progress) { status.setProgress(progress); statusUpdated(status); } public void incrementProgress(double increment) {
/** * Checks whether the job was aborted or not (i.e. killed). That is, if * the job started and is no longer running, while it never * marked as finished. Remember that under normal conditions, a job * should always finish, whether it failed or not. An aborted progress * is usually the results of a job suite which got "killed" in the middle * of its execution (not having the chance to return properly). * @return <code>true</code> if job was started * @since 1.1 */ @Override public boolean isAborted() { return isStarted() && !isRunning() && duration.getEndTime() == null && !isCompleted(); }
/** * Checks whether the job ended before its time. This may or may not * be the result of an error. Prematurely ended jobs are eligible * for resuming. * @return <code>true</code> if job finished */ //TODO fix method typo (PrematurEly). @Override public boolean isPrematurlyEnded() { return duration.getEndTime() != null && !isCompleted(); } /**
public List<IJobStatus> getChildren(IJobStatus jobStatus) { return getChildren(jobStatus.getJobId()); } public List<IJobStatus> getChildren(String jobId) {
public long getDuration() { return status.getDuration().getDuration(); } public void setNote(String note) {
public void setNote(String note) { status.setNote(note); statusUpdated(status); }
/** * Gets the elapsed time in milliseconds between the start date of the * first elapsed time and the end of the last elapsed time. If there * are no previous elapsed time, this method has the same effect * as calling {@link #getDuration()}. * @return the total elapsed time */ public final long getTotalDuration() { return getDuration() + getResumedDuration(); }
private void flattenNode(JobStatusTreeNode node) { flattenNodes.put(node.jobStatus.getJobId(), node); for (JobStatusTreeNode childNode : node.children) { flattenNode(childNode); } }
@Override public boolean isStopped() { return stopRequested && !isRunning(); }
private JobSuiteStatusSnapshot( JobStatusTreeNode rootNode, ILogManager logManager) { this.logManager = logManager; this.rootNode = rootNode; flattenNode(rootNode); }
/** * Checks whether the job was started or not. This is not an indication * that a job is currently running. * @return <code>true</code> if job was started */ @Override public boolean isStarted() { return duration.getStartTime() != null; } /**
public double getProgress() { return status.getProgress(); } public void setProgress(double progress) {
@Override public void mapChanged(MapChangeEvent<String, List<String>> event) { statusUpdated(status); } });
public void accept(IJobStatusVisitor visitor) { jobSuiteStatusSnapshot.accept(visitor); }
@Override public boolean isStopping() { return stopRequested && isRunning(); }