mirror of https://github.com/micromata/borgbackup-butler.git

Kai Reinhard
05.03.2019 67dd1243073e766178dd70dd2f45aa5bc77ec529
borgbutler-core/src/main/java/de/micromata/borgbutler/jobs/JobQueue.java
@@ -29,6 +29,22 @@
    }
    /**
     * Searches only for queued jobs (not done jobs).
     * @param uniqueJobNumber
     * @return The job if any job with the given unique job number is queued, otherwise null.
     */
    public AbstractJob<T> getQueuedJobByUniqueJobNumber(long uniqueJobNumber) {
        Iterator<AbstractJob<T>> it = queue.iterator();
        while (it.hasNext()) {
            AbstractJob<T> job = it.next();
            if (job.getUniqueJobNumber() == uniqueJobNumber) {
                return job;
            }
        }
        return null;
    }
    /**
     * Appends the job if not alread in the queue. Starts the execution if no execution thread is already running.
     *
     * @param job