diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java index 12ebd87..33d2225 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java @@ -82,6 +82,7 @@ import org.gcube.data.analysis.tabulardata.service.exception.NoSuchTemplateExcep import org.gcube.data.analysis.tabulardata.service.impl.TabularDataServiceFactory; import org.gcube.data.analysis.tabulardata.service.operation.Job; import org.gcube.data.analysis.tabulardata.service.operation.Task; +import org.gcube.data.analysis.tabulardata.service.operation.TaskId; import org.gcube.data.analysis.tabulardata.service.tabular.HistoryStep; import org.gcube.data.analysis.tabulardata.service.tabular.HistoryStepId; import org.gcube.data.analysis.tabulardata.service.tabular.TabularResource; @@ -6711,7 +6712,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements logger.error("Error in getConnection(): No TableDescriptorMetadata found for table "+table); throw new TDGWTServiceException("Error in getConnection(): No TableDescriptorMetadata found for table "+table); } - if(tableDesc.getRefId()==0){ + if(tableDesc.getRefId()==0){ logger.error("Error refId=0 for Table:"+table.toString()); throw new TDGWTServiceException("Error refId=0 for Table:"+table.toString()); } @@ -6740,17 +6741,26 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements HttpSession session = this.getThreadLocalRequest().getSession(); SessionUtil.setTaskResubmitSession(session, taskResubmitSession); ASLSession aslSession = SessionUtil.getAslSession(session); - + logger.debug("StartTaskResubmit: "+taskResubmitSession); AuthorizationProvider.instance.set(new AuthorizationToken( aslSession.getUsername())); - //TabularDataService service = TabularDataServiceFactory.getService(); + TabularDataService service = TabularDataServiceFactory.getService(); - //TRId trId=taskResubmitSession.getTrId(); + if(taskResubmitSession==null){ + logger.error("TaskResubmitSession is null"); + throw new TDGWTServiceException("Error in resubmit task: TaskResubmitSession is null"); + } + if(taskResubmitSession.getTaskId()==null + || taskResubmitSession.getTaskId().isEmpty()){ + logger.error("Task Id is: "+taskResubmitSession.getTaskId()); + throw new TDGWTServiceException("Error in resubmit task, Task Id is: "+taskResubmitSession.getTaskId()); + } - //TabularResourceId serviceTR = new TabularResourceId(id); - //Task trTask = service.execute(invocation, serviceTR); - //logger.debug("Start Task on service: TaskId " + trTask.getId()); - //SessionUtil.setTaskResubmitTask(session, trTask); + TaskId taskId=new TaskId(taskResubmitSession.getTaskId()); + + Task trTask = service.resubmit(taskId); + logger.debug("Resubmit Task on service: TaskId " + trTask.getId()); + SessionUtil.setTaskResubmitTask(session, trTask); return; } catch (TDGWTSessionExpiredException e) {