[JENKINS-18381] Provide a mechanism to differentiate between node

properties that are applicable to the master node only and node properties
that can be applied to all nodes
This commit is contained in:
Stephen Connolly committed 2013-06-18 10:54:12 +01:00
1 parent 2c8da0b8c8
commit 48e8010231
4 files changed
+35 -1

No files matched your search

+16
View File
@@ -796,6 +796,22 @@ public class Functions {
return result;
}
/**
* Returns those node properties which can be configured as global node properties.
*
* @since 1.520
*/
public static List<NodePropertyDescriptor> getGlobalNodePropertyDescriptors() {
List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>();
Collection<NodePropertyDescriptor> list = (Collection) Jenkins.getInstance().getDescriptorList(NodeProperty.class);
for (NodePropertyDescriptor npd : list) {
if (npd.isApplicableAsGlobal()) {
result.add(npd);
}
}
return result;
}
/**
* Gets all the descriptors sorted by their inheritance tree of {@link Describable}
* so that descriptors of similar types come nearby.