File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\jenkins\model\GlobalNodePropertiesConfiguration.java.html

1 package jenkins.model;
2
3 import hudson.Extension;
4 import hudson.slaves.NodeProperty;
5 import hudson.slaves.NodePropertyDescriptor;
6 import net.sf.json.JSONObject;
7 import org.kohsuke.stapler.StaplerRequest;
8
9 import java.io.IOException;
10
11 /**
12 * Include {@link NodePropertyDescriptor} configurations.
13 *
14 * @author Kohsuke Kawaguchi
15 */
16 @Extension(ordinal=110) // historically this was placed above GlobalPluginConfiguration
17 public class GlobalNodePropertiesConfiguration extends GlobalConfiguration {
18 @Override
19 public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
20 try {
21 Jenkins j = Jenkins.getInstance();
22 JSONObject np = json.getJSONObject("globalNodeProperties");
23 if (!np.isNullObject()) {
24 j.getGlobalNodeProperties().rebuild(req, np, NodeProperty.for_(j));
25 }
26 return true;
27 } catch (IOException e) {
28 throw new FormException(e,"globalNodeProperties");
29 }
30 }
31 }
32