本文整理了Java中hudson.model.Run.getExternalizableId
方法的一些代码示例,展示了Run.getExternalizableId
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Run.getExternalizableId
方法的具体详情如下:
包路径:hudson.model.Run
类名称:Run
方法名:getExternalizableId
[英]Produces an identifier for this run unique in the system.
[中]为该运行生成系统中唯一的标识符。
代码示例来源:origin: jenkinsci/jenkins
Replacer(Run<?, ?> r) {
id = r.getExternalizableId();
}
private Object readResolve() {
代码示例来源:origin: jenkinsci/jenkins
RunSaveableReference(Run<?,?> r) {
id = r.getExternalizableId();
}
@Override public Saveable get() {
代码示例来源:origin: jenkinsci/jenkins
@Override
public ParameterValue getDefaultParameterValue() {
if (runId != null) {
return createValue(runId);
}
Run<?,?> lastBuild = null;
// use getFilter() so we dont have to worry about null filter value.
switch (getFilter()) {
case COMPLETED:
lastBuild = getProject().getLastCompletedBuild();
break;
case SUCCESSFUL:
lastBuild = getProject().getLastSuccessfulBuild();
break;
case STABLE :
lastBuild = getProject().getLastStableBuild();
break;
default:
lastBuild = getProject().getLastBuild();
break;
}
if (lastBuild != null) {
return createValue(lastBuild.getExternalizableId());
} else {
return null;
}
}
代码示例来源:origin: io.jenkins.plugins/docker-slaves
PlaceholderTask(StepContext context, String label, Run<?,?> run) {
this.context = context;
this.label = label;
runId = run.getExternalizableId();
}
代码示例来源:origin: jenkinsci/docker-slaves-plugin
PlaceholderTask(StepContext context, String label, Run<?,?> run) {
this.context = context;
this.label = label;
runId = run.getExternalizableId();
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
Replacer(Run<?, ?> r) {
id = r.getExternalizableId();
}
private Object readResolve() {
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
RunSaveableReference(Run<?,?> r) {
id = r.getExternalizableId();
}
@Override public Saveable get() {
代码示例来源:origin: org.jenkins-ci.plugins/pipeline-stage-step
CanceledCause(Run<?,?> newerBuild) {
this.newerBuild = newerBuild.getExternalizableId();
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
public String superGetExternalizableId() {
return super.getExternalizableId();
}
代码示例来源:origin: org.jenkins-ci.plugins.workflow/workflow-durable-task-step
PlaceholderTask(StepContext context, String label) throws IOException, InterruptedException {
this.context = context;
this.label = label;
runId = context.get(Run.class).getExternalizableId();
}
代码示例来源:origin: jenkinsci/promoted-builds-plugin
@Override
public PromotedBuildParameterValue getDefaultParameterValue() {
final List builds = getBuilds();
if (builds.isEmpty()) {
return null;
}
return createValue(((Run) builds.get(0)).getExternalizableId());
}
代码示例来源:origin: jenkinsci/throttle-concurrent-builds-plugin
/**
* Get the list of categories for a given run by flow node, if that run/flow node combination is recorded for one or more categories.
*
* @param run the run
* @return a map (possibly empty) from {@link FlowNode#getId} to a list of category names (possibly empty)
*/
@Nonnull
static Map<String, List<String>> getCategoriesForRunByFlowNode(@Nonnull Run<?, ?> run) {
Map<String, List<String>> categoriesByNode = new HashMap<>();
final DescriptorImpl descriptor = fetchDescriptor();
for (ThrottleCategory cat : descriptor.getCategories()) {
Map<String,List<String>> runs = descriptor.getThrottledPipelinesForCategory(cat.getCategoryName());
List<String> nodeIds = runs.get(run.getExternalizableId());
if (nodeIds != null) {
for (String nodeId : nodeIds) {
List<String> categories = categoriesByNode.get(nodeId);
if (categories == null) {
categories = new ArrayList<>();
categoriesByNode.put(nodeId, categories);
}
categories.add(cat.getCategoryName());
}
}
}
return categoriesByNode;
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
@Override
public ParameterValue getDefaultParameterValue() {
Run<?,?> lastBuild = getProject().getLastBuild();
if (lastBuild != null) {
return createValue(lastBuild.getExternalizableId());
} else {
return null;
}
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
@Override
public ParameterValue getDefaultParameterValue() {
Run<?, ?> lastBuild = getProject().getLastBuild();
if (lastBuild != null) {
return createValue(lastBuild.getExternalizableId());
} else {
return null;
}
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
@Override
public String getExternalizableId() {
initPython();
if (pexec.isImplemented(81)) {
return (String) pexec.execPython("get_externalizable_id");
} else {
return super.getExternalizableId();
}
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
@Override
public ParameterValue getDefaultParameterValue() {
Run<?,?> lastBuild = getProject().getLastBuild();
if (lastBuild != null) {
return createValue(lastBuild.getExternalizableId());
} else {
return null;
}
}
代码示例来源:origin: hudson/hudson-2.x
@Override
public ParameterValue getDefaultParameterValue() {
Run<?,?> lastBuild = getProject().getLastBuild();
if (lastBuild != null) {
return createValue(lastBuild.getExternalizableId());
} else {
return null;
}
}
代码示例来源:origin: jenkinsci/pipeline-model-definition-plugin
public Queue.Item run(String stageName) {
if (stageName == null || stageName.equals("")) {
throw new IllegalStateException(Messages.RestartDeclarativePipelineAction_NullStageName());
}
if (!run.hasPermission(Item.BUILD) || !run.getParent().isBuildable()) {
throw new IllegalStateException(Messages.RestartDeclarativePipelineAction_ProjectNotBuildable(run.getParent().getFullName()));
}
if (run.isBuilding()) {
throw new IllegalStateException(Messages.RestartDeclarativePipelineAction_OriginRunIncomplete(run.getFullDisplayName()));
}
ExecutionModelAction execAction = run.getAction(ExecutionModelAction.class);
if (execAction == null) {
throw new IllegalStateException(Messages.RestartDeclarativePipelineAction_OriginWasNotDeclarative(run.getFullDisplayName()));
}
if (!getRestartableStages().contains(stageName)) {
throw new IllegalStateException(Messages.RestartDeclarativePipelineAction_StageNameNotPresent(stageName, run.getFullDisplayName()));
}
List<Action> actions = new ArrayList<>();
CpsFlowExecution execution = getExecution();
if (execution == null) {
throw new IllegalStateException(Messages.RestartDeclarativePipelineAction_OriginRunMissingExecution(run.getFullDisplayName()));
}
actions.add(new RestartFlowFactoryAction(run.getExternalizableId()));
actions.add(new CauseAction(new Cause.UserIdCause(), new RestartDeclarativePipelineCause(run, stageName)));
return ParameterizedJobMixIn.scheduleBuild2(run.getParent(), 0, actions.toArray(new Action[actions.size()]));
}
代码示例来源:origin: jenkinsci/ci-game-plugin
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
ScoreHistoryEntry entry = (ScoreHistoryEntry) source;
writer.startNode("score");
writer.setValue(String.valueOf(entry.getAwardedScore()));
writer.endNode();
writer.startNode("accountableRuns");
for (Run run : entry.awardingRuns) {
writer.startNode("run");
writer.setValue(run.getExternalizableId());
writer.endNode();
}
writer.endNode();
}
代码示例来源:origin: jenkinsci/throttle-concurrent-builds-plugin
@Override
public boolean start() throws Exception {
Run<?, ?> r = getContext().get(Run.class);
TaskListener listener = getContext().get(TaskListener.class);
FlowNode flowNode = getContext().get(FlowNode.class);
ThrottleJobProperty.DescriptorImpl descriptor = ThrottleJobProperty.fetchDescriptor();
String runId = null;
String flowNodeId = null;
if (r != null && flowNode != null) {
runId = r.getExternalizableId();
flowNodeId = flowNode.getId();
for (String category : validateCategories(descriptor, listener)) {
descriptor.addThrottledPipelineForCategory(runId, flowNodeId, category, listener);
}
}
getContext().newBodyInvoker()
.withCallback(new Callback(runId, flowNodeId, getCategories()))
.start();
return false;
}
内容来源于网络,如有侵权,请联系作者删除!