Skip to content

Commit

Permalink
Added forgotten class
Browse files Browse the repository at this point in the history
  • Loading branch information
GuilhemSempere committed Aug 26, 2024
1 parent 6b227c3 commit 1209814
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/main/java/fr/cirad/manager/ImportProcess.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package fr.cirad.manager;

import fr.cirad.tools.ProgressIndicator;

public class ImportProcess extends AbstractProcess {
private ProgressIndicator progress;

public ImportProcess(ProgressIndicator progress, String module) {
this.progress = progress;
this.module = module;
this.status = ProcessStatus.IDLE;
}

@Override
public String getProcessID() {
return progress.getProcessId();
}

@Override
public ProcessStatus getStatus() {
return progress.isAborted() ? ProcessStatus.INTERRUPTED : (progress.isComplete() ? ProcessStatus.SUCCESS : progress.getError() != null ? ProcessStatus.ERROR : ProcessStatus.RUNNING);
}

@Override
public String getStatusMessage() {
return progress.isComplete() ? "Import complete" : progress.getProgressDescription();
}

@Override
public void abort() {
progress.abort();
this.status = ProcessStatus.INTERRUPTED;
this.statusMessage = "Import process aborted";
}

@Override
public String getLog() {
return null;
}

@Override
public String getAbortWarning() {
return null;
}
}

0 comments on commit 1209814

Please sign in to comment.