Minor Updated
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@91830 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
16cc219be1
commit
0827cd34d3
|
@ -73,6 +73,7 @@ import org.gcube.portlets.user.td.gwtservice.server.storage.FilesStorage;
|
|||
import org.gcube.portlets.user.td.gwtservice.server.trservice.ColumnDataTypeMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationsId;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.trservice.TaskStateMap;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.AvailableCharsetList;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportMonitor;
|
||||
|
@ -91,7 +92,6 @@ import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportMonitor;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.task.State;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
|
||||
|
@ -1018,26 +1018,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
|
||||
|
||||
protected State matchTaskState(TaskStatus status) {
|
||||
switch (status) {
|
||||
case INITIALIZING:
|
||||
return State.INITIALIZING;
|
||||
case FAILED:
|
||||
return State.FAILED;
|
||||
case ABORTED:
|
||||
return State.ABORTED;
|
||||
case IN_PROGRESS:
|
||||
return State.IN_PROGRESS;
|
||||
case SUCCEDED:
|
||||
return State.SUCCEDED;
|
||||
case STOPPED:
|
||||
return State.STOPPED;
|
||||
case VALIDATING_RULES:
|
||||
return State.VALIDATING_RULES;
|
||||
default:
|
||||
return State.FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
@ -1071,7 +1052,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
+ task.getStatus());
|
||||
|
||||
importMonitor
|
||||
.setStatus(matchTaskState(task.getStatus()));
|
||||
.setStatus(TaskStateMap.map(task.getStatus()));
|
||||
|
||||
switch (importMonitor.getStatus()) {
|
||||
case SUCCEDED:
|
||||
|
@ -1458,7 +1439,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
logger.debug("Status: " + task.getStatus());
|
||||
|
||||
importMonitor
|
||||
.setStatus(matchTaskState(task.getStatus()));
|
||||
.setStatus(TaskStateMap.map(task.getStatus()));
|
||||
switch (importMonitor.getStatus()) {
|
||||
case FAILED:
|
||||
if (task.getResult() != null) {
|
||||
|
@ -2007,7 +1988,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
} else {
|
||||
logger.debug("Status: " + task.getStatus());
|
||||
|
||||
exportMonitor.setStatus(matchTaskState(task.getStatus()));
|
||||
exportMonitor.setStatus(TaskStateMap.map(task.getStatus()));
|
||||
switch (exportMonitor.getStatus()) {
|
||||
case FAILED:
|
||||
if (task.getResult() != null) {
|
||||
|
@ -2166,7 +2147,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
} else {
|
||||
logger.debug("Services TaskStatus: " + task.getStatus());
|
||||
|
||||
exportMonitor.setStatus(matchTaskState(task.getStatus()));
|
||||
exportMonitor.setStatus(TaskStateMap.map(task.getStatus()));
|
||||
switch (exportMonitor.getStatus()) {
|
||||
case FAILED:
|
||||
if (task.getResult() != null) {
|
||||
|
@ -2486,7 +2467,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
} else {
|
||||
logger.debug("Services TaskStatus: " + task.getStatus());
|
||||
|
||||
changeColumnTypeMonitor.setStatus(matchTaskState(task
|
||||
changeColumnTypeMonitor.setStatus(TaskStateMap.map(task
|
||||
.getStatus()));
|
||||
switch (changeColumnTypeMonitor.getStatus()) {
|
||||
case FAILED:
|
||||
|
@ -2617,7 +2598,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
} else {
|
||||
logger.debug("Services TaskStatus: " + task.getStatus());
|
||||
|
||||
deleteColumnMonitor.setStatus(matchTaskState(task
|
||||
deleteColumnMonitor.setStatus(TaskStateMap.map(task
|
||||
.getStatus()));
|
||||
switch (deleteColumnMonitor.getStatus()) {
|
||||
case FAILED:
|
||||
|
@ -2749,7 +2730,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
} else {
|
||||
logger.debug("Services TaskStatus: " + task.getStatus());
|
||||
|
||||
labelColumnMonitor.setStatus(matchTaskState(task
|
||||
labelColumnMonitor.setStatus(TaskStateMap.map(task
|
||||
.getStatus()));
|
||||
switch (labelColumnMonitor.getStatus()) {
|
||||
case FAILED:
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package org.gcube.portlets.user.td.gwtservice.server.trservice;
|
||||
|
||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.TaskStatus;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.task.State;
|
||||
|
||||
public class TaskStateMap {
|
||||
public static State map(TaskStatus status) {
|
||||
switch (status) {
|
||||
case INITIALIZING:
|
||||
return State.INITIALIZING;
|
||||
case FAILED:
|
||||
return State.FAILED;
|
||||
case ABORTED:
|
||||
return State.ABORTED;
|
||||
case IN_PROGRESS:
|
||||
return State.IN_PROGRESS;
|
||||
case SUCCEDED:
|
||||
return State.SUCCEDED;
|
||||
case STOPPED:
|
||||
return State.STOPPED;
|
||||
case VALIDATING_RULES:
|
||||
return State.VALIDATING_RULES;
|
||||
default:
|
||||
return State.FAILED;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue