Package com.bluersw

Class AgentParameterDefinition.DescriptorImpl

All Implemented Interfaces:
Saveable, Loadable, OnMaster
Enclosing class:
AgentParameterDefinition

@Symbol("agentParameter") @Extension public static class AgentParameterDefinition.DescriptorImpl extends ParameterDefinition.ParameterDescriptor
参数描述类,实现了与UI交互的方法。(The parameter description class implements the method of interacting with the UI.)
  • Constructor Details

    • DescriptorImpl

      public DescriptorImpl()
  • Method Details

    • doCheckName

      public FormValidation doCheckName(@QueryParameter String name)
      验证用户输入的参数名称是否合法,注意一定是“doCheck”+“要检查的参数名称”形式为方法名称。(Verify that the parameter name entered by the user is legal. Note that it must be in the form of "doCheck" + "parameter name to be checked" as the method name.)
      Parameters:
      name - 要检查的Name内容。(Name content to check.)
      Returns:
      检查是否通过,如果没有通过返回错误信息。(Check if it passes, and return an error message if it fails.)
    • getDisplayName

      @NonNull public String getDisplayName()
      在项目配置界面显示此构建参数的名称
      Overrides:
      getDisplayName in class ParameterDefinition.ParameterDescriptor
      Returns:
      "Agent Server Parameter"
    • newInstance

      public ParameterDefinition newInstance(@Nullable org.kohsuke.stapler.StaplerRequest2 req, @NonNull net.sf.json.JSONObject formData)
      Overrides:
      newInstance in class Descriptor<ParameterDefinition>
    • doSetDefaultValue

      public String doSetDefaultValue(@AncestorInPath Job<?,?> job, @QueryParameter String name, @QueryParameter String value) throws IOException
      客户端选择Agent服务器时JS脚本调用的服务器端方法,作用是更新此参数的默认值,以便于方便用户下次项目构建时不需要再次选择Agent服务器。方法名一定是"do"+"方法名"。(When the client selects the agent server, the server-side method called by the JS script is to update the default value of this parameter, so that the user does not need to select the agent server again when the project is built next time.The method name must be "do" + "method name".)
      Parameters:
      job - 当前项目的构建任务。(The build task of the current project.)
      name - Agent Server Parameter的名称。(The name of the agent Server Parameter.)
      value - 用户选择的Agent服务器的名称。(The name of the agent server selected by the user.)
      Returns:
      操作结果说明。(Explanation of operation result.)
      Throws:
      IOException
    • doFillValueItems

      public ListBoxModel doFillValueItems(@AncestorInPath Job<?,?> job, @QueryParameter String name)
      在项目构建页面设置参数时调用,将所有可以用于构建的服务器名称,绑定到下拉菜单中让用户选择,方法名称必须是"doFill"+要绑定数据的页面元素field属性值+"Items"。(Called when setting parameters on the project construction page, bind all server names that can be used for construction to the drop-down menu for the user to choose, the method name must be "doFill" + field attribute value of the page element to be bound data + "Items ".)
      Parameters:
      job - 当前项目的构建任务。(The build task of the current project.)
      name - Agent Server Parameter的名称。(The name of the Agent Server Parameter.)
      Returns:
      Agent名称列表是Select元素,返回此元素的内容。(The agent name list is the Select element, and returns the content of this element.)