本文整理了Java中hudson.model.Messages.ComputerSet_SlaveAlreadyExists()
方法的一些代码示例,展示了Messages.ComputerSet_SlaveAlreadyExists()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Messages.ComputerSet_SlaveAlreadyExists()
方法的具体详情如下:
包路径:hudson.model.Messages
类名称:Messages
方法名:ComputerSet_SlaveAlreadyExists
[英]Slave called ''{0}'' already exists
[中]名为“{0}”的从属服务器已存在
代码示例来源:origin: jenkinsci/jenkins
/**
* Makes sure that the given name is good as an agent 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();
Jenkins.checkGoodName(name);
if(Jenkins.getInstance().getNode(name)!=null)
throw new Failure(Messages.ComputerSet_SlaveAlreadyExists(name));
// looks good
return name;
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Accepts the update to the node configuration.
*/
@RequirePOST
public void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
checkPermission(CONFIGURE);
String proposedName = Util.fixEmptyAndTrim(req.getSubmittedForm().getString("name"));
Jenkins.checkGoodName(proposedName);
Node node = getNode();
if (node == null) {
throw new ServletException("No such node " + nodeName);
}
if ((!proposedName.equals(nodeName))
&& Jenkins.getActiveInstance().getNode(proposedName) != null) {
throw new FormException(Messages.ComputerSet_SlaveAlreadyExists(proposedName), "name");
}
String nExecutors = req.getSubmittedForm().getString("numExecutors");
if (StringUtils.isBlank(nExecutors) || Integer.parseInt(nExecutors)<=0) {
throw new FormException(Messages.Slave_InvalidConfig_Executors(nodeName), "numExecutors");
}
Node result = node.reconfigure(req, req.getSubmittedForm());
Jenkins.getInstance().getNodesObject().replaceNode(this.getNode(), result);
// take the user back to the agent top page.
rsp.sendRedirect2("../" + result.getNodeName() + '/');
}
代码示例来源: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.jenkins-ci.main/jenkins-core
/**
* Makes sure that the given name is good as an agent 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();
Jenkins.checkGoodName(name);
if(Jenkins.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;
}
代码示例来源:origin: org.eclipse.hudson/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.jenkins-ci.main/jenkins-core
/**
* Accepts the update to the node configuration.
*/
@RequirePOST
public void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
checkPermission(CONFIGURE);
String proposedName = Util.fixEmptyAndTrim(req.getSubmittedForm().getString("name"));
Jenkins.checkGoodName(proposedName);
Node node = getNode();
if (node == null) {
throw new ServletException("No such node " + nodeName);
}
if ((!proposedName.equals(nodeName))
&& Jenkins.getActiveInstance().getNode(proposedName) != null) {
throw new FormException(Messages.ComputerSet_SlaveAlreadyExists(proposedName), "name");
}
Node result = node.reconfigure(req, req.getSubmittedForm());
Jenkins.getInstance().getNodesObject().replaceNode(this.getNode(), result);
// take the user back to the agent top page.
rsp.sendRedirect2("../" + result.getNodeName() + '/');
}
内容来源于网络,如有侵权,请联系作者删除!