From 3e412be8d5ca41b2e1af238807067b4cd9200869 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 21 May 2014 13:49:48 +0000 Subject: [PATCH] Minor Update git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@95901 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../gwtservice/server/TDGWTServiceImpl.java | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) 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) {