hudson.model.Messages.Slave_InvalidConfig_Executors()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(158)

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

Messages.Slave_InvalidConfig_Executors介绍

[英]Invalid slave configuration for {0}. Invalid # of executors.
[中]{0}的从属配置无效。遗嘱执行人无效。

代码示例

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

throw new FormException(Messages.Slave_InvalidConfig_Executors(name), null);

代码示例来源: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

public Slave(String name, String nodeDescription, String remoteFS, int numExecutors,
         Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
    this.name = name;
    this.description = nodeDescription;
    this.numExecutors = numExecutors;
    this.mode = mode;
    this.remoteFS = Util.fixNull(remoteFS).trim();
    this.label = Util.fixNull(labelString).trim();
    this.launcher = launcher;
    this.retentionStrategy = retentionStrategy;
    getAssignedLabels();    // compute labels now
    
    this.nodeProperties.replaceBy(nodeProperties);

    if (name.equals(""))
      throw new FormException(Messages.Slave_InvalidConfig_NoName(), null);

//        if (remoteFS.equals(""))
//            throw new FormException(Messages.Slave_InvalidConfig_NoRemoteDir(name), null);

    if (this.numExecutors<=0)
      throw new FormException(Messages.Slave_InvalidConfig_Executors(name), null);
  }

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

public Slave(String name, String nodeDescription, String remoteFS, int numExecutors,
         Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
    this.name = name;
    this.description = nodeDescription;
    this.numExecutors = numExecutors;
    this.mode = mode;
    this.remoteFS = Util.fixNull(remoteFS).trim();
    this.label = Util.fixNull(labelString).trim();
    this.launcher = launcher;
    this.retentionStrategy = retentionStrategy;
    getAssignedLabels();    // compute labels now
    
    this.nodeProperties.replaceBy(nodeProperties);

    if (name.equals(""))
      throw new FormException(Messages.Slave_InvalidConfig_NoName(), null);

//        if (remoteFS.equals(""))
//            throw new FormException(Messages.Slave_InvalidConfig_NoRemoteDir(name), null);

    if (this.numExecutors<=0)
      throw new FormException(Messages.Slave_InvalidConfig_Executors(name), null);
  }

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

public Slave(String name, String nodeDescription, String remoteFS, int numExecutors,
         Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
    this.name = name;
    this.description = nodeDescription;
    this.numExecutors = numExecutors;
    this.mode = mode;
    this.remoteFS = Util.fixNull(remoteFS).trim();
    this.label = Util.fixNull(labelString).trim();
    this.launcher = launcher;
    this.retentionStrategy = retentionStrategy;
    getAssignedLabels();    // compute labels now
    
    this.nodeProperties.replaceBy(nodeProperties);

    if (name.equals(""))
      throw new FormException(Messages.Slave_InvalidConfig_NoName(), null);

//        if (remoteFS.equals(""))
//            throw new FormException(Messages.Slave_InvalidConfig_NoRemoteDir(name), null);

    if (this.numExecutors<=0)
      throw new FormException(Messages.Slave_InvalidConfig_Executors(name), null);
  }

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

public Slave(String name, String nodeDescription, String remoteFS, int numExecutors,
      Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
    this.name = name;
    this.description = nodeDescription;
    this.numExecutors = numExecutors;
    this.mode = mode;
    this.remoteFS = Util.fixNull(remoteFS).trim();
    this.label = Util.fixNull(labelString).trim();
    this.launcher = launcher;
    this.retentionStrategy = retentionStrategy;
    getAssignedLabels();    // compute labels now

    this.nodeProperties.replaceBy(nodeProperties);

    if (name.equals("")) {
      throw new FormException(Messages.Slave_InvalidConfig_NoName(), null);
    }

//        if (remoteFS.equals(""))
//            throw new FormException(Messages.Slave_InvalidConfig_NoRemoteDir(name), null);

    if (this.numExecutors <= 0) {
      throw new FormException(Messages.Slave_InvalidConfig_Executors(name), null);
    }
  }

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

throw new FormException(Messages.Slave_InvalidConfig_Executors(name), null);

相关文章

Messages类方法