本文整理了Java中hudson.model.Node.getDisplayName()
方法的一些代码示例,展示了Node.getDisplayName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getDisplayName()
方法的具体详情如下:
包路径:hudson.model.Node
类名称:Node
方法名:getDisplayName
暂无
代码示例来源:origin: jenkinsci/jenkins
private static void fireOnRollback(final NodeProvisioner.PlannedNode plannedNode, final Node newNode,
final Throwable cause) {
for (CloudProvisioningListener cl : CloudProvisioningListener.all()) {
try {
cl.onRollback(plannedNode, newNode, cause);
} catch (Error e) {
throw e;
} catch (Throwable e) {
LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while "
+ "processing onRollback() listener call in " + cl + " for agent "
+ newNode.getDisplayName(), e);
}
}
}
代码示例来源:origin: jenkinsci/jenkins
private static void fireOnCommit(final NodeProvisioner.PlannedNode plannedNode, final Node newNode) {
for (CloudProvisioningListener cl : CloudProvisioningListener.all()) {
try {
cl.onCommit(plannedNode, newNode);
} catch (Error e) {
throw e;
} catch (Throwable e) {
LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while "
+ "processing onCommit() listener call in " + cl + " for agent "
+ newNode.getDisplayName(), e);
}
}
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public String getShortDescription() {
Computer computer = node.toComputer();
String name = computer != null ? computer.getDisplayName() : node.getDisplayName();
return Messages.Node_BecauseNodeIsNotAcceptingTasks(name);
}
代码示例来源:origin: jenkinsci/jenkins
public static String encodeTo(Node node) {
Computer c = node.toComputer();
if (c != null) {
return encodeTo("/" + c.getUrl(), node.getDisplayName());
}
String nodePath = node == Jenkins.getInstance() ? "(master)" : node.getNodeName();
return encodeTo("/computer/" + nodePath, node.getDisplayName());
}
代码示例来源:origin: jenkinsci/jenkins
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException {
FilePath dir = preferredLocation(tool, node);
if (dir.installIfNecessaryFrom(new URL(url), log, "Unpacking " + url + " to " + dir + " on " + node.getDisplayName())) {
dir.act(new ChmodRecAPlusX());
}
if (subdir == null) {
return dir;
} else {
return dir.child(subdir);
}
}
代码示例来源:origin: jenkinsci/jenkins
public String getShortDescription() {
String name = (node.toComputer() != null) ? node.toComputer().getDisplayName() : node.getDisplayName();
return Messages.Queue_NodeOffline(name);
}
代码示例来源:origin: jenkinsci/jenkins
public String getShortDescription() {
String name = (node.toComputer() != null) ? node.toComputer().getDisplayName() : node.getDisplayName();
return Messages.Queue_WaitingForNextAvailableExecutorOn(name);
}
代码示例来源:origin: jenkinsci/jenkins
public String getToolHome(Node node, ToolInstallation tool, TaskListener log) throws IOException, InterruptedException {
if (node.getRootPath() == null) {
log.error(node.getDisplayName() + " is offline; cannot locate " + tool.getName());
return null;
installer.getDescriptor().getDisplayName(),
tool.getName(),
node.getDisplayName()));
代码示例来源:origin: jenkinsci/jenkins
check = shouldBeDeleted(item, ws, node);
} catch (IOException x) {
Functions.printStackTrace(x, listener.error("Failed to check " + node.getDisplayName()));
continue;
} catch (InterruptedException x) {
Functions.printStackTrace(x, listener.error("Failed to check " + node.getDisplayName()));
continue;
listener.getLogger().println("Deleting " + ws + " on " + node.getDisplayName());
try {
ws.deleteRecursive();
WorkspaceList.tempDir(ws).deleteRecursive();
} catch (IOException x) {
Functions.printStackTrace(x, listener.error("Failed to delete " + ws + " on " + node.getDisplayName()));
} catch (InterruptedException x) {
Functions.printStackTrace(x, listener.error("Failed to delete " + ws + " on " + node.getDisplayName()));
代码示例来源:origin: jenkinsci/jenkins
/**
* Convenience method to find a location to install a tool.
* @param tool the tool being installed
* @param node the computer on which to install the tool
* @return {@link ToolInstallation#getHome} if specified, else a path within the local
* Jenkins work area named according to {@link ToolInstallation#getName}
* @since 1.310
*/
protected final FilePath preferredLocation(ToolInstallation tool, Node node) {
if (node == null) {
throw new IllegalArgumentException("must pass non-null node");
}
String home = Util.fixEmptyAndTrim(tool.getHome());
if (home == null) {
home = sanitize(tool.getDescriptor().getId()) + File.separatorChar + sanitize(tool.getName());
}
FilePath root = node.getRootPath();
if (root == null) {
throw new IllegalArgumentException("Node " + node.getDisplayName() + " seems to be offline");
}
return root.child("tools").child(home);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Adds a node
*
* @since 1.513
*/
public ContextMenu add(Node n) {
Computer c = n.toComputer();
return add(new MenuItem()
.withDisplayName(n.getDisplayName())
.withStockIcon((c==null) ? "computer.png" : c.getIcon())
.withContextRelativeUrl(n.getSearchUrl()));
}
代码示例来源:origin: jenkinsci/jenkins
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException {
FilePath expected = preferredLocation(tool, node);
Installable inst = getInstallable();
if(inst==null) {
log.getLogger().println("Invalid tool ID "+id);
return expected;
}
if (inst instanceof NodeSpecific) {
inst = (Installable) ((NodeSpecific) inst).forNode(node, log);
}
if(isUpToDate(expected,inst))
return expected;
if(expected.installIfNecessaryFrom(new URL(inst.url), log, "Unpacking " + inst.url + " to " + expected + " on " + node.getDisplayName())) {
expected.child(".timestamp").delete(); // we don't use the timestamp
FilePath base = findPullUpDirectory(expected);
if(base!=null && base!=expected)
base.moveAllChildrenTo(expected);
// leave a record for the next up-to-date check
expected.child(".installedFrom").write(inst.url,"UTF-8");
expected.act(new ZipExtractionInstaller.ChmodRecAPlusX());
}
return expected;
}
代码示例来源:origin: jenkinsci/jenkins
Label l = item.getAssignedLabel();
if(l!=null && !l.contains(this))
return CauseOfBlockage.fromMessage(Messages._Node_LabelMissing(getDisplayName(), l)); // the task needs to be executed on label that this node doesn't have.
|| Jenkins.getInstance().getMode() == Mode.EXCLUSIVE)
)) {
return CauseOfBlockage.fromMessage(Messages._Node_BecauseNodeIsReserved(getDisplayName())); // this node is reserved for tasks that are tied to it
if (!(SKIP_BUILD_CHECK_ON_FLYWEIGHTS && item.task instanceof Queue.FlyweightTask) && !hasPermission(identity, Computer.BUILD)) {
return CauseOfBlockage.fromMessage(Messages._Node_LackingBuildPermission(identity.getName(), getDisplayName()));
代码示例来源:origin: jenkinsci/jenkins
@Override protected void calculate(Run<?,?> build, JSONObject element) {
BallColor iconColor = build.getIconColor();
element.put("iconColorOrdinal", iconColor.ordinal());
element.put("iconColorDescription", iconColor.getDescription());
element.put("buildStatusUrl", build.getBuildStatusUrl());
element.put("number", build.getNumber());
element.put("displayName", build.getDisplayName());
element.put("duration", build.getDuration());
element.put("durationString", build.getDurationString());
if (build instanceof AbstractBuild) {
AbstractBuild<?,?> b = (AbstractBuild) build;
Node n = b.getBuiltOn();
if (n == null) {
String ns = b.getBuiltOnStr();
if (ns != null && !ns.isEmpty()) {
element.put("builtOnStr", ns);
}
} else if (n != Jenkins.getInstance()) {
element.put("builtOn", n.getNodeName());
element.put("builtOnStr", n.getDisplayName());
} else {
element.put("builtOnStr", hudson.model.Messages.Hudson_Computer_DisplayName());
}
}
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
@Override
public String getShortDescription() {
return Messages.Queue_NodeOffline(node.getDisplayName());
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
public static String encodeTo(Node node) {
Computer c = node.toComputer();
if (c != null) {
return encodeTo("/" + c.getUrl(), node.getDisplayName());
}
String nodePath = node == Jenkins.getInstance() ? "(master)" : node.getNodeName();
return encodeTo("/computer/" + nodePath, node.getDisplayName());
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Override
public String getShortDescription() {
Computer computer = node.toComputer();
String name = computer != null ? computer.getDisplayName() : node.getDisplayName();
return Messages.Node_BecauseNodeIsNotAcceptingTasks(name);
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
@Override
public String getDisplayName() {
initPython();
if (pexec.isImplemented(0)) {
return (String) pexec.execPython("get_display_name");
} else {
return super.getDisplayName();
}
}
代码示例来源:origin: hudson/hudson-2.x
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException {
FilePath dir = preferredLocation(tool, node);
if (dir.installIfNecessaryFrom(new URL(url), log, "Unpacking " + url + " to " + dir + " on " + node.getDisplayName())) {
dir.act(new ChmodRecAPlusX());
}
if (subdir == null) {
return dir;
} else {
return dir.child(subdir);
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Adds a node
*
* @since 1.513
*/
public ContextMenu add(Node n) {
Computer c = n.toComputer();
return add(new MenuItem()
.withDisplayName(n.getDisplayName())
.withStockIcon((c==null) ? "computer.png" : c.getIcon())
.withContextRelativeUrl(n.getSearchUrl()));
}
内容来源于网络,如有侵权,请联系作者删除!