/** * {@inheritDoc} * * <p> * Note that this method returns a read-only view of {@link Action}s. * {@link BuildStep}s and others who want to add a project action * should do so by implementing {@link BuildStep#getProjectActions(AbstractProject)}. * * @see TransientProjectActionFactory */ @SuppressWarnings("deprecation") @Override public List<Action> getActions() { // add all the transient actions, too List<Action> actions = new Vector<Action>(super.getActions()); actions.addAll(transientActions); // return the read only list to cause a failure on plugins who try to add an action here return Collections.unmodifiableList(actions); }
/** * Gets all the {@link Permalink}s defined for this job. * * @return never null */ public PermalinkList getPermalinks() { // TODO: shall we cache this? PermalinkList permalinks = new PermalinkList(Permalink.BUILTIN); for (PermalinkProjectAction ppa : getActions(PermalinkProjectAction.class)) { permalinks.addAll(ppa.getPermalinks()); } return permalinks; }
public <T extends Action> List<T> superGetActions(Class<T> type) { return super.getActions(type); }
public List<Action> superGetActions() { return super.getActions(); }
@Override public void addAction(Action a) { super.getActions().add(a); }
private TreeMap<String, String> mapToolIdsToNames(final List<Job<?, ?>> visibleJobs, final Function<ResultAction, String> namePrinter, final Predicate<JobAction> filter) { return visibleJobs.stream() .flatMap(job -> job.getActions(JobAction.class).stream().filter(filter)) .map(JobAction::getLatestAction) .filter(Optional::isPresent) .map(Optional::get) .collect(Collectors.toMap(ResultAction::getId, namePrinter, (r1, r2) -> r1, TreeMap::new)); }
/** * {@inheritDoc} * * <p> * Note that this method returns a read-only view of {@link Action}s. * {@link BuildStep}s and others who want to add a project action * should do so by implementing {@link BuildStep#getProjectActions(AbstractProject)}. * * @see TransientProjectActionFactory */ @Override public synchronized List<Action> getActions() { // add all the transient actions, too List<Action> actions = new Vector<Action>(super.getActions()); actions.addAll(transientActions); // return the read only list to cause a failure on plugins who try to add an action here return Collections.unmodifiableList(actions); }
/** * {@inheritDoc} * * <p> * Note that this method returns a read-only view of {@link Action}s. * {@link BuildStep}s and others who want to add a project action * should do so by implementing {@link BuildStep#getProjectActions(AbstractProject)}. * * @see TransientProjectActionFactory */ @SuppressWarnings("deprecation") @Override public List<Action> getActions() { // add all the transient actions, too List<Action> actions = new Vector<Action>(super.getActions()); actions.addAll(transientActions); // return the read only list to cause a failure on plugins who try to add an action here return Collections.unmodifiableList(actions); }
@Override public void replaceAction(Action a) { // CopyOnWriteArrayList does not support Iterator.remove, so need to do it this way: List<Action> old = new ArrayList<>(1); List<Action> current = super.getActions(); for (Action a2 : current) { if (a2.getClass() == a.getClass()) { old.add(a2); } } current.removeAll(old); addAction(a); }
private boolean isVisible(final Job<?, ?> job) { if (!hideCleanJobs) { return true; } return job.getActions(JobAction.class) .stream() .filter(createToolFilter(selectTools, tools)) .map(JobAction::getLatestAction) .filter(Optional::isPresent) .map(Optional::get).anyMatch(resultAction -> resultAction.getResult().getTotalSize() > 0); }
@SuppressWarnings("deprecation") @Override public Collection<? extends Action> getProjectActions() { Job<?,?> job = run.getParent(); if (/* getAction(Class) produces a StackOverflowError */!Util.filter(job.getActions(), TestResultProjectAction.class).isEmpty()) { // JENKINS-26077: someone like XUnitPublisher already added one return Collections.emptySet(); } return Collections.singleton(new TestResultProjectAction(job)); }
@Override public Collection<? extends Action> getProjectActions() { Job<?,?> job = run.getParent(); if (!Util.filter(job.getActions(), FitnesseProjectAction.class).isEmpty()) { return Collections.emptySet(); } List<Action> projectActions = new ArrayList<Action>(); projectActions.add(new FitnesseProjectAction(job)); projectActions.add(new FitnesseHistoryAction(job)); this.projectActions = projectActions; this.results.setOwner(run); return this.projectActions; }
/** * Returns a model with all available charsets. * * @return a model with all available charsets */ public ComboBoxModel doFillIdItems() { ComboBoxModel model = new ComboBoxModel(); Set<String> ids = Jenkins.getInstance() .getAllItems(Job.class) .stream() .flatMap(job -> job.getActions(JobAction.class).stream()) .map(JobAction::getId).collect(Collectors.toSet()); model.addAll(ids); return model; }
/** * Gets all the {@link Permalink}s defined for this job. * * @return never null */ public PermalinkList getPermalinks() { // TODO: shall we cache this? PermalinkList permalinks = new PermalinkList(Permalink.BUILTIN); for (PermalinkProjectAction ppa : getActions(PermalinkProjectAction.class)) { permalinks.addAll(ppa.getPermalinks()); } return permalinks; }
@Override public <T extends Action> List<T> getActions(Class<T> type) { initPython(); if (pexec.isImplemented(102)) { return (List) pexec.execPython("get_actions", type); } else { return super.getActions(type); } }
/** * Gets all the {@link Permalink}s defined for this job. * * @return never null */ public PermalinkList getPermalinks() { // TODO: shall we cache this? PermalinkList permalinks = new PermalinkList(Permalink.BUILTIN); for (Action a : getActions()) { if (a instanceof PermalinkProjectAction) { PermalinkProjectAction ppa = (PermalinkProjectAction) a; permalinks.addAll(ppa.getPermalinks()); } } return permalinks; }
/** * Gets all the {@link Permalink}s defined for this job. * * @return never null */ public PermalinkList getPermalinks() { // TODO: shall we cache this? PermalinkList permalinks = new PermalinkList(Permalink.BUILTIN); for (Action a : getActions()) { if (a instanceof PermalinkProjectAction) { PermalinkProjectAction ppa = (PermalinkProjectAction) a; permalinks.addAll(ppa.getPermalinks()); } } return permalinks; }
/** * Gets all the {@link Permalink}s defined for this job. * * @return never null */ public PermalinkList getPermalinks() { // TODO: shall we cache this? PermalinkList permalinks = new PermalinkList(Permalink.BUILTIN); for (Action a : getActions()) { if (a instanceof PermalinkProjectAction) { PermalinkProjectAction ppa = (PermalinkProjectAction) a; permalinks.addAll(ppa.getPermalinks()); } } return permalinks; }
/** * Gets all the {@link Permalink}s defined for this job. * * @return never null */ public PermalinkList getPermalinks() { // TODO: shall we cache this? PermalinkList permalinks = new PermalinkList(Permalink.BUILTIN); for (Action a : getActions()) { if (a instanceof PermalinkProjectAction) { PermalinkProjectAction ppa = (PermalinkProjectAction) a; permalinks.addAll(ppa.getPermalinks()); } } return permalinks; }
@Override @Exported public List<Action> getActions() { initPython(); if (pexec.isImplemented(101)) { return (List) pexec.execPython("get_actions"); } else { return super.getActions(); } }