- Common ways to obtain Queue$Item
private void myMethod () {Queue$Item q =
Hudson.getInstance().getQueue().getItem(this)
Queue.ItemList queueItemList;Queue.Task p;queueItemList.cancel(p)
MatrixConfiguration matrixConfiguration;matrixConfiguration.getQueueItem()
- Smart code suggestions by Codota
}
shouldScheduleItem |= action.shouldSchedule((new ArrayList<Action>(item.getAllActions()))); a.foldIntoExisting(item, p, actions); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "after folding {0}, {1} includes {2}", new Object[] {a, item, item.getAllActions()});
protected Item(Item item) { this(item.task, new ArrayList<Action>(item.getAllActions()), item.id, item.future, item.inQueueSince); }
shouldScheduleItem |= action.shouldSchedule((new ArrayList<Action>(item.getAllActions()))); a.foldIntoExisting(item, p, actions); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "after folding {0}, {1} includes {2}", new Object[] {a, item, item.getAllActions()});
/** * Cancel previous builds for specified PR id. */ private static boolean cancelQueuedBuildByBranchName(final String branch) { Queue queue = getJenkinsInstance().getQueue(); for (Queue.Item item : queue.getItems()) { Optional<Cause> cause = from(item.getAllActions()) .filter(instanceOf(CauseAction.class)) .transformAndConcat(new CausesFromAction()) .filter(instanceOf(GitHubBranchCause.class)) .firstMatch(new CauseHasBranch(branch)); if (cause.isPresent()) { queue.cancel(item); return true; } } return false; }