use of jetbrains.buildServer.BuildAgent in project teamcity-rest by JetBrains.
the class Build method getDelayedByBuild.
@XmlElement(name = "delayedByBuild")
public Build getDelayedByBuild() {
return ValueWithDefault.decideDefault(myFields.isIncluded("delayedByBuild", false, false), () -> {
if (myQueuedBuild == null || myQueuedBuild.getBuildPromotion().isCompositeBuild()) {
return null;
}
BuildEstimates estimates = myQueuedBuild.getBuildEstimates();
if (estimates == null) {
return null;
}
BuildAgent agent = estimates.getAgent();
if (agent == null || !(agent instanceof SBuildAgent)) {
return null;
}
SRunningBuild delayer = ((SBuildAgent) agent).getRunningBuild();
if (delayer == null) {
return null;
}
return new Build(delayer, myFields.getNestedField("delayedByBuild"), myBeanContext);
});
}
use of jetbrains.buildServer.BuildAgent in project teamcity-rest by JetBrains.
the class Build method getPlannedAgent.
@XmlElement(name = "plannedAgent")
public Agent getPlannedAgent() {
return ValueWithDefault.decideDefault(myFields.isIncluded("plannedAgent", false, false), () -> {
if (myQueuedBuild == null || myQueuedBuild.getBuildPromotion().isCompositeBuild()) {
return null;
}
BuildEstimates estimates = myQueuedBuild.getBuildEstimates();
if (estimates == null) {
return null;
}
BuildAgent agent = estimates.getAgent();
if (agent == null || !(agent instanceof SBuildAgent)) {
return null;
}
return new Agent((SBuildAgent) agent, myFields.getNestedField("plannedAgent"), myBeanContext);
});
}
Aggregations