Updated OperationMonitor

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@99338 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-08-28 18:12:50 +00:00
parent df392995e7
commit 17798de7f9
3 changed files with 86 additions and 12 deletions

View File

@ -11,13 +11,28 @@ import java.io.Serializable;
*
*/
public enum State implements Serializable{
INITIALIZING,
IN_PROGRESS,
VALIDATING_RULES,
GENERATING_VIEW,
STOPPED,
SUCCEDED,
ABORTED,
FAILED;
INITIALIZING("Initializing"),
IN_PROGRESS("In Progress"),
VALIDATING_RULES("Validating Rules"),
GENERATING_VIEW("Generating View"),
STOPPED("Stopped"),
SUCCEDED("Succeded"),
ABORTED("Aborted"),
FAILED("Failed");
/**
* @param text
*/
private State(final String id) {
this.id = id;
}
private final String id;
@Override
public String toString() {
return id;
}
}

View File

@ -2,11 +2,31 @@ package org.gcube.portlets.user.td.gwtservice.shared.task;
/**
*
* @author "Giancarlo Panichi"
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
* @author "Giancarlo Panichi" email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public enum WorkerState {
PENDING, INITIALIZING, VALIDATING_DATA, IN_PROGRESS, SUCCEDED, FAILED
PENDING("Pending"),
INITIALIZING("Initializing"),
VALIDATING_DATA("Validating Data"),
IN_PROGRESS("In Progress"),
SUCCEDED("Succeded"),
FAILED("Failed");
/**
* @param text
*/
private WorkerState(final String id) {
this.id = id;
}
private final String id;
@Override
public String toString() {
return id;
}
}

View File

@ -0,0 +1,39 @@
package org.gcube.portlets.user.td.gwtservice.shared.task;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class WorkerStateParser {
public static WorkerState parse(String state) {
if (WorkerState.PENDING.toString().compareTo(state) == 0) {
return WorkerState.PENDING;
} else {
if (WorkerState.INITIALIZING.toString().compareTo(state) == 0) {
return WorkerState.INITIALIZING;
} else {
if (WorkerState.VALIDATING_DATA.toString().compareTo(state) == 0) {
return WorkerState.VALIDATING_DATA;
} else {
if (WorkerState.IN_PROGRESS.toString().compareTo(state) == 0) {
return WorkerState.IN_PROGRESS;
} else {
if (WorkerState.SUCCEDED.toString().compareTo(state) == 0) {
return WorkerState.SUCCEDED;
} else {
if (WorkerState.FAILED.toString().compareTo(state) == 0) {
return WorkerState.FAILED;
} else {
return null;
}
}
}
}
}
}
}
}