Search in sources :

Example 21 with Item

use of hudson.model.Item in project blueocean-plugin by jenkinsci.

the class FavoriteContainerImpl method iterator.

@Override
public Iterator<BlueFavorite> iterator() {
    List<BlueFavorite> favorites = new ArrayList<>();
    Jenkins j = Jenkins.getInstance();
    for (final Item favorite : Favorites.getFavorites(user.user)) {
        if (favorite instanceof AbstractFolder) {
            continue;
        }
        BlueFavorite blueFavorite = FavoriteUtil.getFavorite(favorite);
        if (blueFavorite != null) {
            favorites.add(blueFavorite);
        }
    }
    return favorites.iterator();
}
Also used : Jenkins(jenkins.model.Jenkins) Item(hudson.model.Item) BlueFavorite(io.jenkins.blueocean.rest.model.BlueFavorite) AbstractFolder(com.cloudbees.hudson.plugins.folder.AbstractFolder) ArrayList(java.util.ArrayList)

Example 22 with Item

use of hudson.model.Item in project blueocean-plugin by jenkinsci.

the class PipelineContainerImpl method get.

@Override
public BluePipeline get(String name) {
    Item item;
    item = itemGroup.getItem(name);
    if (item == null) {
        throw new ServiceException.NotFoundException(String.format("Pipeline %s not found", name));
    }
    return BluePipelineFactory.getPipelineInstance(item, this);
}
Also used : TopLevelItem(hudson.model.TopLevelItem) Item(hudson.model.Item)

Aggregations

Item (hudson.model.Item)22 BluePipeline (io.jenkins.blueocean.rest.model.BluePipeline)5 ItemGroup (hudson.model.ItemGroup)4 Run (hudson.model.Run)4 TopLevelItem (hudson.model.TopLevelItem)4 MultiBranchProject (jenkins.branch.MultiBranchProject)4 Jenkins (jenkins.model.Jenkins)4 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 Nonnull (javax.annotation.Nonnull)3 StaplerRequest (org.kohsuke.stapler.StaplerRequest)3 Job (hudson.model.Job)2 ModelObject (hudson.model.ModelObject)2 ACL (hudson.security.ACL)2 CheckForNull (javax.annotation.CheckForNull)2 OrganizationFolder (jenkins.branch.OrganizationFolder)2 Authentication (org.acegisecurity.Authentication)2 JobChannelMessage (org.jenkinsci.plugins.pubsub.JobChannelMessage)2 Ancestor (org.kohsuke.stapler.Ancestor)2 AbstractFolder (com.cloudbees.hudson.plugins.folder.AbstractFolder)1