hudson.model.Hudson.getLabel()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中hudson.model.Hudson.getLabel()方法的一些代码示例,展示了Hudson.getLabel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hudson.getLabel()方法的具体详情如下:
包路径:hudson.model.Hudson
类名称:Hudson
方法名:getLabel

Hudson.getLabel介绍

[英]Gets the label that exists on this system by the name.
[中]按名称获取此系统上存在的标签。

代码示例

代码示例来源:origin: hudson/hudson-2.x

/**
 * Obtains a label by its {@linkplain #getName() name}.
 */
public static Label get(String l) {
  return Hudson.getInstance().getLabel(l);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Obtains a label by its {@linkplain #getName() name}.
 */
public static Label get(String l) {
  return Hudson.getInstance().getLabel(l);
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Obtains a label by its {@linkplain #getName() name}.
 */
public static Label get(String l) {
  return Hudson.getInstance().getLabel(l);
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Obtains a label by its {@linkplain #getName() name}.
 */
public static Label get(String l) {
  return Hudson.getInstance().getLabel(l);
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Checks whether this installer can be applied to a given node.
 * (By default, just checks the label.)
 */
public boolean appliesTo(Node node) {
  Label l = Hudson.getInstance().getLabel(label);
  return l == null || l.contains(node);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Checks whether this installer can be applied to a given node.
 * (By default, just checks the label.)
 */
public boolean appliesTo(Node node) {
  Label l = Hudson.getInstance().getLabel(label);
  return l == null || l.contains(node);
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Checks whether this installer can be applied to a given node. (By
 * default, just checks the label.)
 */
public boolean appliesTo(Node node) {
  Label l = Hudson.getInstance().getLabel(label);
  return l == null || l.contains(node);
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Checks whether this installer can be applied to a given node.
 * (By default, just checks the label.)
 */
public boolean appliesTo(Node node) {
  Label l = Hudson.getInstance().getLabel(label);
  return l == null || l.contains(node);
}

代码示例来源:origin: org.hudsonci.plugins/parameterized-trigger

public Collection<Node> getNodes() {
  return Hudson.getInstance().getLabel("asrt").getNodes();
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public Object unmarshal(HierarchicalStreamReader reader, final UnmarshallingContext context) {
    return Hudson.getInstance().getLabel(reader.getValue());
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Gets the {@link Label}s where the builds will be run.
 *
 * @return never null
 */
public Set<Label> getLabels() {
  Set<Label> r = new HashSet<Label>();
  for (Combination c : getAxes().subList(LabelAxis.class).list()) {
    r.add(Hudson.getInstance().getLabel(Util.join(c.values(), "&&")));
  }
  return r;
}

代码示例来源:origin: org.jenkins-ci.lib/xtrigger-lib

private List<Node> getPollingNodeListRequiredNoWS(XTriggerLog log) {
  AbstractProject project = (AbstractProject) job;
  //The specified trigger node must be considered first
  if (triggerLabel != null) {
    log.info(String.format("Looking for a node to the restricted label %s.", triggerLabel));
    if ("master".equalsIgnoreCase(triggerLabel)) {
      log.info("Restrict on master label. Polling on master.");
      return Arrays.asList(getMasterNode());
    }
    Label targetLabel = Hudson.getInstance().getLabel(triggerLabel);
    return getNodesLabel(project, targetLabel);
  }
  return candidatePollingNode(log);
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Gets the {@link Label}s where the builds will be run.
 * @return never null
 */
public Set<Label> getLabels() {
  Set<Label> r = new HashSet<Label>();
  for (Combination c : getAxes().subList(LabelAxis.class).list())
    r.add(Hudson.getInstance().getLabel(Util.join(c.values(),"&&")));
  return r;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Gets the {@link Label}s where the builds will be run.
 * @return never null
 */
public Set<Label> getLabels() {
  Set<Label> r = new HashSet<Label>();
  for (Combination c : getAxes().subList(LabelAxis.class).list())
    r.add(Hudson.getInstance().getLabel(Util.join(c.values(),"&&")));
  return r;
}

代码示例来源:origin: hudson/hudson-2.x

public FormValidation doCheckAssignedLabelString(@QueryParameter String value) {
  if (Util.fixEmpty(value)==null)
    return FormValidation.ok(); // nothing typed yet
  try {
    Label.parseExpression(value);
  } catch (ANTLRException e) {
    return FormValidation.error(e,
        Messages.AbstractProject_AssignedLabelString_InvalidBooleanExpression(e.getMessage()));
  }
  // TODO: if there's an atom in the expression that is empty, report it
  if (Hudson.getInstance().getLabel(value).isEmpty())
    return FormValidation.warning(Messages.AbstractProject_AssignedLabelString_NoMatch());
  return FormValidation.ok();
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Gets the {@link Label}s where the builds will be run.
 * @return never null
 */
public Set<Label> getLabels() {
  Set<Label> r = new HashSet<Label>();
  for (Combination c : getAxes().subList(LabelAxis.class).list())
    r.add(Hudson.getInstance().getLabel(Util.join(c.values(),"&&")));
  return r;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

@Override
public Label getAssignedLabel() {
  // combine all the label axes by &&.
  String expr = Util.join(combination.values(getParent().getAxes().subList(LabelAxis.class)), "&&");
  return Hudson.getInstance().getLabel(Util.fixEmpty(expr));
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

@Override
public Label getAssignedLabel() {
  // combine all the label axes by &&.
  String expr = Util.join(combination.values(getParent().getAxes().subList(LabelAxis.class)), "&&");
  return Hudson.getInstance().getLabel(Util.fixEmpty(expr));
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

@Override
public Label getAssignedLabel() {
  // combine all the label axes by &&.
  String expr = Util.join(combination.values(getParent().getAxes().subList(LabelAxis.class)), "&&");
  return Hudson.getInstance().getLabel(Util.fixEmpty(expr));
}

代码示例来源:origin: hudson/hudson-2.x

@Override
public Label getAssignedLabel() {
  // combine all the label axes by &&.
  String expr = Util.join(combination.values(getParent().getAxes().subList(LabelAxis.class)), "&&");
  return Hudson.getInstance().getLabel(Util.fixEmpty(expr));
}

相关文章

微信公众号

最新文章

更多

Hudson类方法