本文整理了Java中hudson.model.Job.getActions()
方法的一些代码示例,展示了Job.getActions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getActions()
方法的具体详情如下:
包路径:hudson.model.Job
类名称:Job
方法名:getActions
暂无
代码示例来源:origin: jenkinsci/jenkins
/**
* {@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);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* 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;
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
public <T extends Action> List<T> superGetActions(Class<T> type) {
return super.getActions(type);
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
public List<Action> superGetActions() {
return super.getActions();
}
代码示例来源:origin: org.jenkins-ci.plugins.workflow/workflow-job
@Override
public void addAction(Action a) {
super.getActions().add(a);
}
代码示例来源:origin: jenkinsci/warnings-ng-plugin
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));
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* {@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);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* {@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);
}
代码示例来源:origin: org.jenkins-ci.plugins.workflow/workflow-job
@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);
}
代码示例来源:origin: jenkinsci/warnings-ng-plugin
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);
}
代码示例来源:origin: jenkinsci/junit-plugin
@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));
}
代码示例来源:origin: jenkinsci/fitnesse-plugin
@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;
}
代码示例来源:origin: jenkinsci/warnings-ng-plugin
/**
* 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;
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* 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;
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
@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);
}
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* 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;
}
代码示例来源:origin: hudson/hudson-2.x
/**
* 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;
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* 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;
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* 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;
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
@Override
@Exported
public List<Action> getActions() {
initPython();
if (pexec.isImplemented(101)) {
return (List) pexec.execPython("get_actions");
} else {
return super.getActions();
}
}
内容来源于网络,如有侵权,请联系作者删除!