refs #521: Support Unscheduling of repetitive task on SmartExecutor

https://support.d4science.org/issues/521
Added unschedule API

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/vre-management/smart-executor@119013 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-09-24 08:39:19 +00:00
parent f2a8767cda
commit 8e97a0b67f
1 changed files with 12 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import org.gcube.vremanagement.executor.exception.PluginNotFoundException;
import org.gcube.vremanagement.executor.persistence.SmartExecutorPersistenceConnector;
import org.gcube.vremanagement.executor.plugin.PluginState;
import org.gcube.vremanagement.executor.scheduler.SmartExecutorScheduler;
import org.quartz.SchedulerException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -45,6 +46,14 @@ public class SmartExecutorImpl implements SmartExecutor {
return uuid.toString();
}
/**{@inheritDoc}*/
@Override
public void unSchedule(String executionIdentifier) throws SchedulerException {
SmartExecutorScheduler smartExecutorScheduler = SmartExecutorInitalizator.getSmartExecutorScheduler();
UUID uuid = UUID.fromString(executionIdentifier);
smartExecutorScheduler.stop(uuid);
}
/**{@inheritDoc}*/
@Override
@Deprecated
@ -94,4 +103,6 @@ public class SmartExecutorImpl implements SmartExecutor {
throw new PluginInstanceNotFoundException();
}
}
}