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

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

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

Hudson.getNode介绍

[英]Gets the slave node of the give name, hooked under this Hudson.
[中]

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Gets the agent of the give name, hooked under this Hudson.
 *
 * @deprecated
 *      Use {@link #getNode(String)}. Since 1.252.
 */
@Deprecated
public Slave getSlave(String name) {
  Node n = getNode(name);
  if (n instanceof Slave)
    return (Slave)n;
  return null;
}

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

/**
 * Gets the slave node of the give name, hooked under this Hudson.
 *
 * @deprecated Use {@link #getNode(String)}. Since 1.252.
 */
public Slave getSlave(String name) {
  Node n = getNode(name);
  if (n instanceof Slave) {
    return (Slave) n;
  }
  return null;
}

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

/**
 * Gets the slave node of the give name, hooked under this Hudson.
 *
 * @deprecated
 *      Use {@link #getNode(String)}. Since 1.252.
 */
public Slave getSlave(String name) {
  Node n = getNode(name);
  if (n instanceof Slave) {
    return (Slave) n;
  }
  return null;
}

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

/**
 * Gets the slave node of the give name, hooked under this Hudson.
 *
 * @deprecated
 *      Use {@link #getNode(String)}. Since 1.252.
 */
public Slave getSlave(String name) {
  Node n = getNode(name);
  if (n instanceof Slave) {
    return (Slave) n;
  }
  return null;
}

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

/**
 * Gets the slave node of the give name, hooked under this Hudson.
 *
 * @deprecated
 *      Use {@link #getNode(String)}. Since 1.252.
 */
public Slave getSlave(String name) {
  Node n = getNode(name);
  if (n instanceof Slave) {
    return (Slave) n;
  }
  return null;
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Gets the agent of the give name, hooked under this Hudson.
 *
 * @deprecated
 *      Use {@link #getNode(String)}. Since 1.252.
 */
@Deprecated
public Slave getSlave(String name) {
  Node n = getNode(name);
  if (n instanceof Slave)
    return (Slave)n;
  return null;
}

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

/**
 * @see hudson.model.AbstractBuild#getBuiltOn()
 * @since 1.394
 */
public Node getBuiltOn() {
  if(builtOn==null || builtOn.equals(""))
    return Hudson.getInstance();
  else
    return Hudson.getInstance().getNode(builtOn);
}

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

/**
 * Returns the {@link Node} that this computer represents.
 *
 * @return
 *      null if the configuration has changed and the node is removed, yet the corresponding {@link Computer}
 *      is not yet gone.
 */
public Node getNode() {
  if(nodeName==null)
    return Hudson.getInstance();
  return Hudson.getInstance().getNode(nodeName);
}

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

/**
 * Returns a {@link Slave} on which this build was done.
 *
 * @return
 *      null, for example if the slave that this build run no longer exists.
 */
public Node getBuiltOn() {
  if (builtOn==null || builtOn.equals(""))
    return Hudson.getInstance();
  else
    return Hudson.getInstance().getNode(builtOn);
}

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

/**
 * Returns a {@link Slave} on which this build was done.
 *
 * @return
 *      null, for example if the slave that this build run no longer exists.
 */
public Node getBuiltOn() {
  if (builtOn==null || builtOn.equals(""))
    return Hudson.getInstance();
  else
    return Hudson.getInstance().getNode(builtOn);
}

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

/**
 * Returns a {@link Slave} on which this build was done.
 *
 * @return
 *      null, for example if the slave that this build run no longer exists.
 */
public Node getBuiltOn() {
  if (builtOn==null || builtOn.equals(""))
    return Hudson.getInstance();
  else
    return Hudson.getInstance().getNode(builtOn);
}

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

/**
 * Returns a {@link Slave} on which this build was done.
 *
 * @return null, for example if the slave that this build run no longer
 * exists.
 */
public Node getBuiltOn() {
  if (builtOn == null || builtOn.equals("")) {
    return Hudson.getInstance();
  } else {
    return Hudson.getInstance().getNode(builtOn);
  }
}

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

/**
 * Returns the {@link Node} that this computer represents.
 *
 * @return null if the configuration has changed and the node is removed,
 * yet the corresponding {@link Computer} is not yet gone.
 */
public Node getNode() {
  if (nodeName == null) {
    return Hudson.getInstance();
  }
  return Hudson.getInstance().getNode(nodeName);
}

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

/**
 * Returns the {@link Node} that this computer represents.
 *
 * @return
 *      null if the configuration has changed and the node is removed, yet the corresponding {@link Computer}
 *      is not yet gone.
 */
public Node getNode() {
  if(nodeName==null)
    return Hudson.getInstance();
  return Hudson.getInstance().getNode(nodeName);
}

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

/**
 * Returns the {@link Node} that this computer represents.
 *
 * @return
 *      null if the configuration has changed and the node is removed, yet the corresponding {@link Computer}
 *      is not yet gone.
 */
public Node getNode() {
  if(nodeName==null)
    return Hudson.getInstance();
  return Hudson.getInstance().getNode(nodeName);
}

代码示例来源:origin: openshift/jenkins-cloud-plugin

protected void cancelBuild(String builderName, String label) {
  LOGGER.info("Cancelling build");
  try {
    Node existingNode = Hudson.getInstance().getNode(builderName);
    if (existingNode != null && existingNode instanceof OpenShiftSlave) {
      ((OpenShiftSlave) existingNode).terminate();
    }
    Queue.Item item = getItem(builderName, label);
    cancelItem(item, builderName, label);
  } catch (Exception e) {
    LOGGER.log(Level.SEVERE,
        "Exception caught trying to terminate slave", e);
  }
}

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

public Node findNode(final String nodeName) {
  log.debug("findNode(\"{}\")", nodeName);
  checkNodeName(nodeName);
  Node node;
  // Provide the master node, if the name is ""
  if ("".equals(nodeName)) {
    node = getHudson();
  } else {
    node = getHudson().getNode(nodeName);
  }
  if (node != null) {
    this.security.checkPermission(node, Permission.READ);
  }
  return node;
}

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

/**
 * Makes sure that the given name is good as a slave name.
 * @return trimmed name if valid; throws ParseException if not
 */
public String checkName(String name) throws Failure {
  if(name==null)
    throw new Failure("Query parameter 'name' is required");
  name = name.trim();
  Hudson.checkGoodName(name);
  if(Hudson.getInstance().getNode(name)!=null)
    throw new Failure(Messages.ComputerSet_SlaveAlreadyExists(name));
  // looks good
  return name;
}

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

/**
 * Makes sure that the given name is good as a slave name.
 * @return trimmed name if valid; throws ParseException if not
 */
public String checkName(String name) throws Failure {
  if(name==null)
    throw new Failure("Query parameter 'name' is required");
  name = name.trim();
  Hudson.checkGoodName(name);
  if(Hudson.getInstance().getNode(name)!=null)
    throw new Failure(Messages.ComputerSet_SlaveAlreadyExists(name));
  // looks good
  return name;
}

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

/**
 * Makes sure that the given name is good as a slave name.
 * @return trimmed name if valid; throws ParseException if not
 */
public String checkName(String name) throws Failure {
  if(name==null)
    throw new Failure("Query parameter 'name' is required");
  name = name.trim();
  Hudson.checkGoodName(name);
  if(Hudson.getInstance().getNode(name)!=null)
    throw new Failure(Messages.ComputerSet_SlaveAlreadyExists(name));
  // looks good
  return name;
}

相关文章

Hudson类方法