本文整理汇总了Java中hudson.model.Queue.Task方法的典型用法代码示例。如果您正苦于以下问题:Java Queue.Task方法的具体用法?Java Queue.Task怎么用?Java Queue.Task使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hudson.model.Queue
的用法示例。
在下文中一共展示了Queue.Task方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isUpstreamBuildVisibleByDownstreamBuildAuth
import hudson.model.Queue; //导入方法依赖的package包/类
protected boolean isUpstreamBuildVisibleByDownstreamBuildAuth(@Nonnull WorkflowJob upstreamPipeline, @Nonnull Queue.Task downstreamPipeline) {
Authentication auth = Tasks.getAuthenticationOf(downstreamPipeline);
Authentication downstreamPipelineAuth;
if (auth.equals(ACL.SYSTEM) && !QueueItemAuthenticatorConfiguration.get().getAuthenticators().isEmpty()) {
downstreamPipelineAuth = Jenkins.ANONYMOUS; // cf. BuildTrigger
} else {
downstreamPipelineAuth = auth;
}
try (ACLContext _ = ACL.as(downstreamPipelineAuth)) {
WorkflowJob upstreamPipelineObtainedAsImpersonated = Jenkins.getInstance().getItemByFullName(upstreamPipeline.getFullName(), WorkflowJob.class);
boolean result = upstreamPipelineObtainedAsImpersonated != null;
LOGGER.log(Level.FINE, "isUpstreamBuildVisibleByDownstreamBuildAuth({0}, {1}): taskAuth: {2}, downstreamPipelineAuth: {3}, upstreamPipelineObtainedAsImpersonated:{4}, result: {5}",
new Object[]{upstreamPipeline, downstreamPipeline, auth, downstreamPipelineAuth, upstreamPipelineObtainedAsImpersonated, result});
return result;
}
}
示例2: taskCompleted
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void taskCompleted(Executor executor, Queue.Task task, long durationMS) {
LOG.debug("Computer {} taskCompleted", this);
// May take the slave offline and remove it, in which case getNode()
// above would return null and we'd not find our DockerSlave anymore.
super.taskCompleted(executor, task, durationMS);
}
示例3: taskCompleted
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void taskCompleted(Executor executor, Queue.Task task, long durationMS) {
LOGGER.log(Level.FINE, " Computer " + this + " taskCompleted");
// May take the agent offline and remove it, in which case getNode()
// above would return null and we'd not find our DockerSlave anymore.
super.taskCompleted(executor, task, durationMS);
}
示例4: map
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public MappingWorksheet.Mapping map(Queue.Task task, MappingWorksheet worksheet) {
LOG.log(FINER, "map({0}, {1}])", new Object[]{task.getFullDisplayName(), worksheet.works.size()});
if (task instanceof AbstractProject) {
return map((AbstractProject) task, worksheet);
} else {
return _fallback.map(task, worksheet);
}
}
示例5: shouldSchedule
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public boolean shouldSchedule(Queue.Task p, List<Action> actions) {
JenkinsMetricProviderImpl instance = instance();
if (instance != null && instance.jenkinsJobScheduleRate != null) {
instance.jenkinsJobScheduleRate.mark();
}
return true;
}
示例6: taskAccepted
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void taskAccepted(Executor executor, Queue.Task task) {
super.taskAccepted(executor, task);
LOGGER.log(Level.INFO, " Computer " + this + ": task accepted");
}
示例7: taskCompleted
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void taskCompleted(Executor executor, Queue.Task task, long durationMS) {
super.taskCompleted(executor, task, durationMS);
LOGGER.log(Level.INFO, " Computer " + this + ": task completed");
}
示例8: taskCompletedWithProblems
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void taskCompletedWithProblems(Executor executor, Queue.Task task, long durationMS, Throwable problems) {
super.taskCompletedWithProblems(executor, task, durationMS, problems);
LOGGER.log(Level.WARNING, " Computer " + this + " task completed with problems");
}
示例9: shouldSchedule
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public boolean shouldSchedule(Queue.Task p, List<Action> actions) {
if (p instanceof WorkflowJob && !isOpenShiftBuildCause(actions)) {
WorkflowJob wj = (WorkflowJob) p;
BuildConfigProjectProperty buildConfigProjectProperty = wj
.getProperty(BuildConfigProjectProperty.class);
if (buildConfigProjectProperty != null
&& StringUtils.isNotBlank(buildConfigProjectProperty
.getNamespace())
&& StringUtils.isNotBlank(buildConfigProjectProperty
.getName())) {
String namespace = buildConfigProjectProperty.getNamespace();
String jobURL = joinPaths(
getJenkinsURL(getAuthenticatedOpenShiftClient(),
namespace), wj.getUrl());
Build ret = getAuthenticatedOpenShiftClient()
.buildConfigs()
.inNamespace(namespace)
.withName(buildConfigProjectProperty.getName())
.instantiate(
new BuildRequestBuilder()
.withNewMetadata()
.withName(
buildConfigProjectProperty
.getName())
.and()
.addNewTriggeredBy()
.withMessage(
"Triggered by Jenkins job at "
+ jobURL).and().build());
ParametersAction params = dumpParams(actions);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("ParametersAction: " + params.toString());
}
if (params != null && ret != null)
BuildToActionMapper.addParameterAction(ret.getMetadata()
.getName(), params);
CauseAction cause = dumpCause(actions);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("get CauseAction: " + cause.getDisplayName());
for (Cause c : cause.getCauses()) {
LOGGER.fine("Cause: " + c.getShortDescription());
}
}
if (cause != null && ret != null)
BuildToActionMapper.addCauseAction(ret.getMetadata()
.getName(), cause);
return false;
}
}
return true;
}
示例10: taskAccepted
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void taskAccepted(Executor executor, Queue.Task task) {
super.taskAccepted(executor, task);
LOG.debug("Computer {} taskAccepted", this);
}
示例11: taskCompletedWithProblems
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void taskCompletedWithProblems(Executor executor, Queue.Task task, long durationMS, Throwable problems) {
LOG.debug("Computer {} taskCompletedWithProblems", this);
super.taskCompletedWithProblems(executor, task, durationMS, problems);
}
示例12: taskAccepted
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void taskAccepted(Executor executor, Queue.Task task) {
}
示例13: taskCompleted
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void taskCompleted(Executor executor, Queue.Task task, long durationMS) {
done(executor);
}
示例14: taskCompletedWithProblems
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void taskCompletedWithProblems(Executor executor, Queue.Task task, long durationMS, Throwable problems) {
done(executor);
}
示例15: taskAccepted
import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void taskAccepted(Executor executor, Queue.Task task) {
super.taskAccepted(executor, task);
LOGGER.fine(" Computer " + this + " taskAccepted");
}