refs #521: Support Unscheduling of repetitive task on SmartExecutor

https://support.d4science.org/issues/521

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/vre-management/smart-executor-client@119023 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-09-25 09:21:07 +00:00
parent 9743b8b748
commit 4aea57793b
1 changed files with 23 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import org.gcube.vremanagement.executor.exception.LaunchException;
import org.gcube.vremanagement.executor.exception.PluginInstanceNotFoundException;
import org.gcube.vremanagement.executor.exception.PluginNotFoundException;
import org.gcube.vremanagement.executor.plugin.PluginState;
import org.quartz.SchedulerException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -56,6 +57,27 @@ public class DefaultSmartExecutorProxy implements SmartExecutorProxy {
}
}
/** {@inheritDoc} */
@Override
public boolean unSchedule(final String executionIdentifier)
throws SchedulerException {
Call<SmartExecutor, Boolean> call = new Call<SmartExecutor, Boolean>() {
@Override
public Boolean call(SmartExecutor endpoint) throws Exception {
logger.debug("Calling launch() function");
return endpoint.unSchedule(executionIdentifier);
}
};
try {
return proxyDelegate.make(call);
} catch (Exception e) {
logger.debug("Failed to call launch() function");
throw again(e).asServiceException();
}
}
/** {@inheritDoc} */
@Override
@ -144,4 +166,5 @@ public class DefaultSmartExecutorProxy implements SmartExecutorProxy {
throw again(e).asServiceException();
}
}
}