/** * Gets just the immediate children of {@link Jenkins} 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; }
/** @see Jenkins#getAsynchPeople */ public AsynchPeople(Jenkins parent) { this.parent = parent; items = parent.getItems(); unknown = User.getUnknown(); }
/** * Returns a read-only view of all {@link Job}s in this view. * * <p> * This method returns a separate copy each time to avoid * concurrent modification issue. */ public synchronized List<TopLevelItem> getItems() { return Jenkins.getInstance().getItems(); // List<TopLevelItem> items = new ArrayList<TopLevelItem>(jobNames.size()); // for (String name : jobNames) { // TopLevelItem item = Hudson.getInstance().getItem(name); // if(item!=null) // items.add(item); // } // return items; }
public People(Jenkins 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 doAutoCompleteUpstreamProjects(@QueryParameter String value) { AutoCompletionCandidates candidates = new AutoCompletionCandidates(); List<Job> jobs = Jenkins.getInstance().getItems(Job.class); for (Job job: jobs) { if (job.getFullName().startsWith(value)) { if (job.hasPermission(Item.READ)) { candidates.add(job.getFullName()); } } } return candidates; }
jobs = h.getItems();
protected String createUniqueProjectName() { return "test"+jenkins.getItems().size(); }
protected String createUniqueProjectName() { return "test"+ jenkins.getItems().size(); }
/** * Gets just the immediate children of {@link Jenkins} 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; }
/** @see Jenkins#getAsynchPeople */ public AsynchPeople(Jenkins parent) { this.parent = parent; items = parent.getItems(); unknown = User.getUnknown(); }
@Override @SuppressWarnings("unchecked") public List<AbstractProject<?,?>> getTopLevelJobs() { @SuppressWarnings("rawtypes") List items = Jenkins.getInstance().getItems(AbstractProject.class); return items; }
@Override public List getWorkDomain() { final List<Project<?, ?>> workDomain = new ArrayList<>(); for (final Project item : Jenkins.getInstance().getItems(Project.class)) { if (!getSonarRunnerBuilders(item).isEmpty()) { workDomain.add(item); } } return workDomain; }
@Override public List<AbstractProject<?, ?>> getWorkDomain() { final List<AbstractProject<?, ?>> workDomain = new ArrayList<>(); for (final AbstractProject item : Jenkins.getInstance().getItems(AbstractProject.class)) { if (getSonarPublisher(item) != null) { workDomain.add(item); } } return workDomain; }
public OrganizationContainer getOrganizationContainer(final String viewName) { final List<OrganizationContainer> containers = Jenkins.getInstance().getItems(OrganizationContainer.class); for (final OrganizationContainer container : containers) { if (container.getName().equalsIgnoreCase(viewName)) { return container; } } return null; }
@Override public void onLoaded(){ for(Item item : Jenkins.getInstance().getItems()){ DiskUsageUtil.addProperty(item); } } }
public People(Jenkins 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); }
private Folder createFolder() throws IOException { return r.jenkins.createProject(Folder.class, "folder" + r.jenkins.getItems().size()); }
public AutoCompletionCandidates doAutoCompleteUpstreamProjects(@QueryParameter String value) { AutoCompletionCandidates candidates = new AutoCompletionCandidates(); List<Job> jobs = Jenkins.getInstance().getItems(Job.class); for (Job job: jobs) { if (job.getFullName().startsWith(value)) { if (job.hasPermission(Item.READ)) { candidates.add(job.getFullName()); } } } return candidates; }
public AutoCompletionCandidates doAutoCompleteJobName(@QueryParameter String value) { AutoCompletionCandidates candidates = new AutoCompletionCandidates(); List<AbstractProject> jobs = JenkinsHelper.getInstance().getItems(AbstractProject.class); for (AbstractProject job: jobs) { if (job.getFullName().startsWith(value)) { if (job.hasPermission(Item.READ)) { candidates.add(job.getFullName()); } } } return candidates; }
@Before public void cleanOutAllItems() throws Exception { for (TopLevelItem i : j.getInstance().getItems()) { i.delete(); } }