/** * Is this node property one where it makes sense to permit it as a global node property. * * @return {@code true} if and only if the node property can be listed as a global node property. * @since 1.520 */ public boolean isApplicableAsGlobal() { // preserve legacy behaviour, even if brain-dead stupid, where applying to Jenkins was the discriminator // note that it would be a mistake to assume Jenkins.getInstance().getClass() == Jenkins.class // the groovy code tested against app.class, so we replicate that exact logic. return isApplicable(Jenkins.get().getClass()); } }
/** * @deprecated replaced by {@link Slave.SlaveDescriptor#nodePropertyDescriptors(Slave)} * @since 2.12 */ @Deprecated @Restricted(DoNotUse.class) @RestrictedSince("2.12") public static List<NodePropertyDescriptor> getNodePropertyDescriptors(Class<? extends Node> clazz) { List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>(); Collection<NodePropertyDescriptor> list = (Collection) Jenkins.getInstance().getDescriptorList(NodeProperty.class); for (NodePropertyDescriptor npd : list) { if (npd.isApplicable(clazz)) { result.add(npd); } } return result; }
/** * Returns the list of {@link NodePropertyDescriptor} appropriate to the supplied {@link Slave}. * * @param it the {@link Slave} or {@code null} to assume the slave is of type {@link #clazz}. * @return the filtered list * @since 2.12 */ @Nonnull @SuppressWarnings("unchecked") // used by Jelly EL only @Restricted(NoExternalUse.class) // used by Jelly EL only public final List<NodePropertyDescriptor> nodePropertyDescriptors(@CheckForNull Slave it) { List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>(); Collection<NodePropertyDescriptor> list = (Collection) Jenkins.getInstance().getDescriptorList(NodeProperty.class); for (NodePropertyDescriptor npd : it == null ? DescriptorVisibilityFilter.applyType(clazz, list) : DescriptorVisibilityFilter.apply(it, list)) { if (npd.isApplicable(clazz)) { result.add(npd); } } return result; }
/** * Is this node property one where it makes sense to permit it as a global node property. * * @return {@code true} if and only if the node property can be listed as a global node property. * @since 1.520 */ public boolean isApplicableAsGlobal() { // preserve legacy behaviour, even if brain-dead stupid, where applying to Jenkins was the discriminator // note that it would be a mistake to assume Jenkins.getInstance().getClass() == Jenkins.class // the groovy code tested against app.class, so we replicate that exact logic. return isApplicable(Jenkins.getInstance().getClass()); } }
public static List<NodePropertyDescriptor> getNodePropertyDescriptors(Class<? extends Node> clazz) { List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>(); Collection<NodePropertyDescriptor> list = (Collection) Hudson.getInstance().getDescriptorList( NodeProperty.class); for (NodePropertyDescriptor npd : list) { if (npd.isApplicable(clazz)) { result.add(npd); } } return result; }
public static List<NodePropertyDescriptor> getNodePropertyDescriptors(Class<? extends Node> clazz) { List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>(); Collection<NodePropertyDescriptor> list = (Collection) Hudson.getInstance().getDescriptorList(NodeProperty.class); for (NodePropertyDescriptor npd : list) { if (npd.isApplicable(clazz)) { result.add(npd); } } return result; } private static final Set<String> globalConfigIgnoredDescriptors = new HashSet<String>();
public static List<NodePropertyDescriptor> getNodePropertyDescriptors(Class<? extends Node> clazz) { List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>(); Collection<NodePropertyDescriptor> list = (Collection) Hudson.getInstance().getDescriptorList(NodeProperty.class); for (NodePropertyDescriptor npd : list) { if (npd.isApplicable(clazz)) { result.add(npd); } } return result; }
public static List<NodePropertyDescriptor> getNodePropertyDescriptors(Class<? extends Node> clazz) { List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>(); Collection<NodePropertyDescriptor> list = (Collection) Hudson.getInstance().getDescriptorList( NodeProperty.class); for (NodePropertyDescriptor npd : list) { if (npd.isApplicable(clazz)) { result.add(npd); } } return result; }
@SuppressWarnings("rawtypes") public static List<NodePropertyDescriptor> getNodePropertyDescriptors(Class<? extends Node> clazz) { List<NodePropertyDescriptor> result = new ArrayList<>(); Collection<NodePropertyDescriptor> list = (Collection) Jenkins.getInstance().getDescriptorList(NodeProperty.class); for (NodePropertyDescriptor npd : list) { if (npd.isApplicable(clazz)) { result.add(npd); } } return result; }
/** * Get a list of all {@link NodePropertyDescriptor}s we can use to define DockerSlave NodeProperties. */ public List<NodePropertyDescriptor> getNodePropertiesDescriptors() { // Copy/paste hudson.model.Slave.SlaveDescriptor.nodePropertyDescriptors marked as @Restricted for reasons I don't get List<NodePropertyDescriptor> result = new ArrayList<>(); Collection<NodePropertyDescriptor> list = (Collection) Jenkins.getInstance().getDescriptorList(NodeProperty.class); for (NodePropertyDescriptor npd : DescriptorVisibilityFilter.applyType(DockerTransientNode.class, list)) { if (npd.isApplicable(DockerTransientNode.class)) { result.add(npd); } } final Iterator<NodePropertyDescriptor> iterator = result.iterator(); while (iterator.hasNext()) { final NodePropertyDescriptor de = iterator.next(); // see https://issues.jenkins-ci.org/browse/JENKINS-47697 if ("org.jenkinsci.plugins.matrixauth.AuthorizationMatrixNodeProperty".equals(de.getKlass().toJavaClass().getName())) { iterator.remove(); } } return result; }
/** * @deprecated replaced by {@link Slave.SlaveDescriptor#nodePropertyDescriptors(Slave)} * @since 2.12 */ @Deprecated @Restricted(DoNotUse.class) @RestrictedSince("2.12") public static List<NodePropertyDescriptor> getNodePropertyDescriptors(Class<? extends Node> clazz) { List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>(); Collection<NodePropertyDescriptor> list = (Collection) Jenkins.getInstance().getDescriptorList(NodeProperty.class); for (NodePropertyDescriptor npd : list) { if (npd.isApplicable(clazz)) { result.add(npd); } } return result; }
/** * Returns the list of {@link NodePropertyDescriptor} appropriate to the supplied {@link Slave}. * * @param it the {@link Slave} or {@code null} to assume the slave is of type {@link #clazz}. * @return the filtered list * @since 2.12 */ @Nonnull @SuppressWarnings("unchecked") // used by Jelly EL only @Restricted(NoExternalUse.class) // used by Jelly EL only public final List<NodePropertyDescriptor> nodePropertyDescriptors(@CheckForNull Slave it) { List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>(); Collection<NodePropertyDescriptor> list = (Collection) Jenkins.getInstance().getDescriptorList(NodeProperty.class); for (NodePropertyDescriptor npd : it == null ? DescriptorVisibilityFilter.applyType(clazz, list) : DescriptorVisibilityFilter.apply(it, list)) { if (npd.isApplicable(clazz)) { result.add(npd); } } return result; }