@SuppressWarnings("deprecation") // JENKINS-51584 protected Item(Item item) { // do not use item.getAllActions() here as this will persist actions from a TransientActionFactory this(item.task, new ArrayList<Action>(item.getActions()), item.id, item.future, item.inQueueSince); }
/** * Gets a human-readable message about the parameters of this item * @return String */ @Exported public String getParams() { StringBuilder s = new StringBuilder(); for (ParametersAction pa : getActions(ParametersAction.class)) { for (ParameterValue p : pa.getParameters()) { s.append('\n').append(p.getShortDescription()); } } return s.toString(); }
/** * Test if the specified {@link SubTask} needs to be run on a node with a particular label. * <p> * This method takes {@link LabelAssignmentAction} into account, the first * non-null assignment will be returned. * Otherwise falls back to {@link SubTask#getAssignedLabel()} * @param st {@link SubTask} to be checked. * @return Required {@link Label}. Otherwise null, indicating it can run on anywhere. */ public @CheckForNull Label getAssignedLabelFor(@Nonnull SubTask st) { for (LabelAssignmentAction laa : getActions(LabelAssignmentAction.class)) { Label l = laa.getAssignedLabel(st); if (l!=null) return l; } return st.getAssignedLabel(); }
/** * Test if the specified {@link SubTask} needs to be run on a node with a particular label. * <p> * This method takes {@link LabelAssignmentAction} into account, the first * non-null assignment will be returned. * Otherwise falls back to {@link SubTask#getAssignedLabel()} * @param st {@link SubTask} to be checked. * @return Required {@link Label}. Otherwise null, indicating it can run on anywhere. */ public @CheckForNull Label getAssignedLabelFor(@Nonnull SubTask st) { for (LabelAssignmentAction laa : getActions(LabelAssignmentAction.class)) { Label l = laa.getAssignedLabel(st); if (l!=null) return l; } return st.getAssignedLabel(); }
protected Item(Item item) { this(item.task, item.getActions(), item.id, item.future); }
/** * If this task needs to be run on a node with a particular label, * return that {@link Label}. Otherwise null, indicating * it can run on anywhere. * * <p> * This code takes {@link LabelAssignmentAction} into account, then fall back to {@link SubTask#getAssignedLabel()} */ public Label getAssignedLabel() { for (LabelAssignmentAction laa : getActions(LabelAssignmentAction.class)) { Label l = laa.getAssignedLabel(task); if (l!=null) return l; } return task.getAssignedLabel(); }
protected Item(Item item) { this(item.task, item.getActions(), item.id, item.future, item.inQueueSince); }
/** * Gets a human-readable message about the parameters of this item * @return String */ @Exported public String getParams() { StringBuilder s = new StringBuilder(); for (ParametersAction pa : getActions(ParametersAction.class)) { for (ParameterValue p : pa.getParameters()) { s.append('\n').append(p.getShortDescription()); } } return s.toString(); }
protected Item(Item item) { this(item.task, item.getActions(), item.id, item.future); }
protected Item(Item item) { this(item.task, item.getActions(), item.id, item.future); }
public void foldIntoExisting(hudson.model.Queue.Item item, Task owner, List<Action> otherActions) { CauseAction existing = item.getAction(CauseAction.class); if (existing!=null) { existing.causes.addAll(this.causes); return; } // no CauseAction found, so add a copy of this one item.getActions().add(new CauseAction(this)); }
public void foldIntoExisting(Queue.Item item, Task owner, List<Action> otherActions) { RevisionParameterAction existing = item.getAction(RevisionParameterAction.class); if (existing!=null) { existing.mergeRevisions(this.revisions); return; } // no RevisionParameterAction found, so add a copy of this one item.getActions().add(new RevisionParameterAction(this)); }
public void foldIntoExisting(hudson.model.Queue.Item item, Task owner, List<Action> otherActions) { CauseAction existing = item.getAction(CauseAction.class); if (existing!=null) { existing.causes.addAll(this.causes); return; } // no CauseAction found, so add a copy of this one item.getActions().add(new CauseAction(this)); }
public void foldIntoExisting(hudson.model.Queue.Item item, Task owner, List<Action> otherActions) { CauseAction existing = item.getAction(CauseAction.class); if (existing != null) { existing.causes.addAll(this.causes); return; } // no CauseAction found, so add a copy of this one item.getActions().add(new CauseAction(this)); }
public Label getAssignedLabel() { for (LabelAssignmentAction laa : getActions(LabelAssignmentAction.class)) { Label l = laa.getAssignedLabel(task); if (l != null) { return l; } } return task.getAssignedLabel(); }
public void foldIntoExisting(Queue.Item item, Task owner, List<Action> otherActions) { RevisionParameterAction existing = item.getAction(RevisionParameterAction.class); if (existing!=null) { existing.mergeRevisions(this.revisions); return; } // no RevisionParameterAction found, so add a copy of this one item.getActions().add(new RevisionParameterAction(this)); }
public void foldIntoExisting(hudson.model.Queue.Item item, Task owner, List<Action> otherActions) { CauseAction existing = item.getAction(CauseAction.class); if (existing!=null) { existing.causes.addAll(this.causes); return; } // no CauseAction found, so add a copy of this one item.getActions().add(new CauseAction(this)); }
public void foldIntoExisting(Queue.Item item, Task owner, List<Action> otherActions) { RevisionParameterAction existing = item.getAction(RevisionParameterAction.class); if (existing!=null) { existing.mergeRevisions(this.revisions); return; } // no RevisionParameterAction found, so add a copy of this one item.getActions().add(new RevisionParameterAction(this)); }
for (Item item : liveGetItems(p)) { boolean shouldScheduleItem = false; for (QueueAction action : item.getActions(QueueAction.class)) { shouldScheduleItem |= action.shouldSchedule(actions);
/** * If this task needs to be run on a node with a particular label, * return that {@link Label}. Otherwise null, indicating * it can run on anywhere. * * <p> * This code takes {@link LabelAssignmentAction} into account, then fall back to {@link SubTask#getAssignedLabel()} */ @CheckForNull public Label getAssignedLabel() { for (LabelAssignmentAction laa : getActions(LabelAssignmentAction.class)) { Label l = laa.getAssignedLabel(task); if (l!=null) return l; } return task.getAssignedLabel(); }