/** * @deprecated * Used only for mapping jobs to URL in a case-insensitive fashion. */ @Deprecated public TopLevelItem getJobCaseInsensitive(String name) { String match = Functions.toEmailSafeString(name); for(TopLevelItem item : getItems()) { if(Functions.toEmailSafeString(item.getName()).equalsIgnoreCase(match)) { return item; } } return null; }
/** * Gets just the immediate children of {@link Hudson} but of the given type. */ public <T> List<T> getItems(Class<T> type) { List<T> r = new ArrayList<T>(); for (TopLevelItem i : getItems()) { if (type.isInstance(i)) { r.add(type.cast(i)); } } return r; }
/** * Gets just the immediate children of {@link Hudson} but of the given type. */ public <T> List<T> getItems(Class<T> type) { List<T> r = new ArrayList<T>(); for (TopLevelItem i : getItems()) { if (type.isInstance(i)) { r.add(type.cast(i)); } } return r; }
/** * Gets just the immediate children of {@link Hudson} but of the given type. */ public <T> List<T> getItems(Class<T> type) { List<T> r = new ArrayList<T>(); for (TopLevelItem i : getItems()) { T t = LazyTopLevelItem.getIfInstanceOf(i, type); if (t != null) { r.add(t); } } return r; }
@Override public Collection<TopLevelItem> getItems() { List<TopLevelItem> items = new ArrayList<TopLevelItem>(); for (TopLevelItem item : Hudson.getInstance().getItems()) { if (item.hasPermission(Job.CONFIGURE)) { items.add(item); } } return Collections.unmodifiableList(items); }
@Override public Collection<TopLevelItem> getItems() { List<TopLevelItem> items = new ArrayList<TopLevelItem>(); for (TopLevelItem item : Hudson.getInstance().getItems()) { if (item.hasPermission(Job.CONFIGURE)) { items.add(item); } } return Collections.unmodifiableList(items); }
@Override public Collection<TopLevelItem> getItems() { List<TopLevelItem> items = new ArrayList<TopLevelItem>(); for (TopLevelItem item : Hudson.getInstance().getItems()) { if (item.hasPermission(Job.CONFIGURE)) { items.add(item); } } return Collections.unmodifiableList(items); }
public static Collection<MetaProject> list(final Filter filter) { List<MetaProject> projects = new ArrayList<MetaProject>(); for (Item item : Hudson.getInstance().getItems()) { if (item instanceof AbstractProject) { MetaProject project = new MetaProject((AbstractProject)item); if (filter == null || filter.accept(project)) { projects.add(project); } } } return projects; }
public static Collection<MetaProject> list(final Filter filter) { List<MetaProject> projects = new ArrayList<MetaProject>(); for (Item item : Hudson.getInstance().getItems()) { if (item instanceof AbstractProject) { MetaProject project = new MetaProject((AbstractProject) item); if (filter == null || filter.accept(project)) { projects.add(project); } } } return projects; }
public static Collection<MetaProject> list(final Filter filter) { List<MetaProject> projects = new ArrayList<MetaProject>(); for (Item item : Hudson.getInstance().getItems()) { if (item instanceof AbstractProject) { MetaProject project = new MetaProject((AbstractProject)item); if (filter == null || filter.accept(project)) { projects.add(project); } } } return projects; }
@Override public void onRenamed(Item item, String oldName, String newName) { List<MasterProject> projects = Hudson.getInstance().getItems(MasterProject.class); for (MasterProject project : projects) { project.onRenamed(item, oldName, newName); } } };
@Override public Set<String> getGroups() { Set<String> r = new HashSet<String>(); r.addAll(super.getGroups()); for (Job<?,?> j : Hudson.getInstance().getItems(Job.class)) { AuthorizationMatrixProperty amp = j.getProperty(AuthorizationMatrixProperty.class); if (amp != null) r.addAll(amp.getGroups()); } return r; }
@Override public Set<String> getGroups() { Set<String> r = new HashSet<String>(); r.addAll(super.getGroups()); for (Job<?,?> j : Hudson.getInstance().getItems(Job.class)) { AuthorizationMatrixProperty amp = j.getProperty(AuthorizationMatrixProperty.class); if (amp != null) r.addAll(amp.getGroups()); } return r; }
/** * Finds a {@link AbstractProject} that has the name closest to the given name. */ public static AbstractProject findNearest(String name) { List<AbstractProject> projects = Hudson.getInstance().getItems(AbstractProject.class); String[] names = new String[projects.size()]; for( int i=0; i<projects.size(); i++ ) names[i] = projects.get(i).getName(); String nearest = EditDistance.findNearest(name, names); return (AbstractProject)Hudson.getInstance().getItem(nearest); }
public People(Hudson parent) { this.parent = parent; // for Hudson, really load all users Map<User,UserInfo> users = getUserInfo(parent.getItems()); User unknown = User.getUnknown(); for (User u : User.getAll()) { if(u==unknown) continue; // skip the special 'unknown' user if(!users.containsKey(u)) users.put(u,new UserInfo(u,null,null)); } this.users = toList(users); }
/** * Returns projects that are tied on this node. */ @Exported public List<AbstractProject> getTiedJobs() { List<AbstractProject> r = new ArrayList<AbstractProject>(); for( AbstractProject p : Util.filter(Hudson.getInstance().getItems(),AbstractProject.class) ) { if(this.equals(p.getAssignedLabel())) r.add(p); } return r; }
public People(Hudson parent) { this.parent = parent; // for Hudson, really load all users Map<User,UserInfo> users = getUserInfo(parent.getItems()); User unknown = User.getUnknown(); for (User u : User.getAll()) { if(u==unknown) continue; // skip the special 'unknown' user if(!users.containsKey(u)) users.put(u,new UserInfo(u,null,null)); } this.users = toList(users); }
@Override protected void submit(StaplerRequest req, StaplerResponse res) throws IOException, ServletException, Descriptor.FormException { // Handle the job list jobNames.clear(); for (TopLevelItem item : Hudson.getInstance().getItems()) { if (req.getParameter(item.getName()) != null) { jobNames.add(item.getName()); } } super.submit(req, res); }
public People(Hudson parent) { this.parent = parent; // for Hudson, really load all users Map<User,UserInfo> users = getUserInfo(parent.getItems()); User unknown = User.getUnknown(); for (User u : User.getAll()) { if(u==unknown) continue; // skip the special 'unknown' user if(!users.containsKey(u)) users.put(u,new UserInfo(u,null,null)); } this.users = toList(users); }
public AutoCompletionCandidates doAutoCompleteChildProjects(@QueryParameter String value) { AutoCompletionCandidates candidates = new AutoCompletionCandidates(); List<Job> jobs = Hudson.getInstance().getItems(Job.class); for (Job job: jobs) { if (job.getFullName().startsWith(value)) { if (job.hasPermission(Item.READ)) { candidates.add(job.getFullName()); } } } return candidates; }