@Override public void destroy(final String taskId) throws PipelineExecutorException { final TaskEntry entry = getTaskEntry(taskId); if (entry == null) { throw new PipelineExecutorException("No PipelineExecutorTask was found for taskId: " + taskId); } if (!entry.isAsync()) { throw new PipelineExecutorException("Destroy operation is not available for taskId: " + taskId + " running in SYNCHRONOUS mode"); } destroyFutureTask(taskId); removeTaskEntry(taskId); pipelineExecutorRegistry.deregister(taskId); }
@Override public void destroy(final String taskId) throws PipelineExecutorException { final TaskEntry entry = getTaskEntry(taskId); if (entry == null) { throw new PipelineExecutorException("No PipelineExecutorTask was found for taskId: " + taskId); } if (!entry.isAsync()) { throw new PipelineExecutorException("Destroy operation is not available for taskId: " + taskId + " running in SYNCHRONOUS mode"); } destroyFutureTask(taskId); removeTaskEntry(taskId); pipelineExecutorRegistry.deregister(taskId); }
@Override public void delete(final String taskId) throws PipelineExecutorException { final TaskEntry entry = getTaskEntry(taskId); if (entry != null) { throw new PipelineExecutorException("An active PipelineExecutorTask was found for taskId: " + taskId + " delete operation is only available for the following status set: " + deleteEnabledStatus); } final PipelineExecutorTrace trace = pipelineExecutorRegistry.getExecutorTrace(taskId); if (trace == null) { throw new PipelineExecutorException("No PipelineExecutorTask was found for taskId: " + taskId); } else { if (!deleteEnabledStatus.contains(trace.getTask().getPipelineStatus())) { throw new PipelineExecutorException("A PipelineExecutorTask in status: " + trace.getTask().getPipelineStatus().name() + " can not" + " be deleted. Delete operation is available for the following status set: " + deleteEnabledStatus); } else { pipelineExecutorRegistry.deregister(taskId); } } }
@Override public void delete(final String taskId) throws PipelineExecutorException { final TaskEntry entry = getTaskEntry(taskId); if (entry != null) { throw new PipelineExecutorException("An active PipelineExecutorTask was found for taskId: " + taskId + " delete operation is only available for the following status set: " + deleteEnabledStatus); } final PipelineExecutorTrace trace = pipelineExecutorRegistry.getExecutorTrace(taskId); if (trace == null) { throw new PipelineExecutorException("No PipelineExecutorTask was found for taskId: " + taskId); } else { if (!deleteEnabledStatus.contains(trace.getTask().getPipelineStatus())) { throw new PipelineExecutorException("A PipelineExecutorTask in status: " + trace.getTask().getPipelineStatus().name() + " can not" + " be deleted. Delete operation is available for the following status set: " + deleteEnabledStatus); } else { pipelineExecutorRegistry.deregister(taskId); } } }
@Override public void stop(final String taskId) throws PipelineExecutorException { final TaskEntry entry = getTaskEntry(taskId); if (entry == null) { throw new PipelineExecutorException("No PipelineExecutorTask was found for taskId: " + taskId); } if (!entry.isAsync()) { throw new PipelineExecutorException("Stop operation is not available for taskId: " + taskId + " running in SYNCHRONOUS mode"); } final PipelineExecutorTask.Status currentStatus = entry.getTask().getPipelineStatus(); if (!stopEnabledStatus.contains(currentStatus)) { throw new PipelineExecutorException("A PipelineExecutorTask in status: " + currentStatus.name() + " can not" + " be stopped. Stop operation is available for the following status set: " + stopEnabledStatus); } destroyFutureTask(taskId); removeTaskEntry(taskId); taskManagerHelper.setTaskInStoppedStatus(entry.getTask()); updateExecutorRegistry(entry.getTask()); }
@Override public void stop(final String taskId) throws PipelineExecutorException { final TaskEntry entry = getTaskEntry(taskId); if (entry == null) { throw new PipelineExecutorException("No PipelineExecutorTask was found for taskId: " + taskId); } if (!entry.isAsync()) { throw new PipelineExecutorException("Stop operation is not available for taskId: " + taskId + " running in SYNCHRONOUS mode"); } final PipelineExecutorTask.Status currentStatus = entry.getTask().getPipelineStatus(); if (!stopEnabledStatus.contains(currentStatus)) { throw new PipelineExecutorException("A PipelineExecutorTask in status: " + currentStatus.name() + " can not" + " be stopped. Stop operation is available for the following status set: " + stopEnabledStatus); } destroyFutureTask(taskId); removeTaskEntry(taskId); taskManagerHelper.setTaskInStoppedStatus(entry.getTask()); updateExecutorRegistry(entry.getTask()); }