private void stopJobById(final String jobId, final boolean forward) {
final JobImpl job = (JobImpl)this.getJobById(jobId);
if ( job != null && !this.configuration.isStoragePath(job.getResourcePath()) ) {
// get the queue configuration
final QueueInfo queueInfo = this.configuration.getQueueConfigurationManager().getQueueInfo(job.getTopic());
final AbstractJobQueue queue = (AbstractJobQueue)this.qManager.getQueue(queueInfo.queueName);
boolean stopped = false;
if ( queue != null ) {
stopped = queue.stopJob(job);
}
if ( forward && !stopped ) {
// mark the job as stopped
final JobHandler jh = new JobHandler(job,this.configuration);
jh.finished(JobState.STOPPED, true, -1);