Class OrganizationFactory
- java.lang.Object
-
- io.jenkins.blueocean.rest.factory.organization.OrganizationFactory
-
- All Implemented Interfaces:
ExtensionPoint
public abstract class OrganizationFactory extends Object implements ExtensionPoint
Maps BlueOcean organization andItemGroup
s.BlueOcean introduces a notion of "organization", which maps to
ItemGroup
in Jenkins in some application-defined way; for example you can map the whole Jenkins into one organization (default), or you can map organization to each of the top-level folder, ...For the rest of the BlueOcean code, the assumption is that some
ItemGroup
maps to an organization, which means every Item in it belongs to this organization.This is a singleton extension point. All but the highest ordinal implementation is ignored.
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description OrganizationFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract BlueOrganization
get(String name)
Looks up an organization by its name.BlueOrganization
getContainingOrg(Item i)
BlueOrganization
getContainingOrg(ItemGroup p)
Finds a nearest organization that contains the givenItemGroup
.BlueOrganization
getContainingOrg(Run r)
Deprecated.in 1.2static OrganizationFactory
getInstance()
static ModifiableTopLevelItemGroup
getItemGroup(BlueOrganization blueOrganization)
static ModifiableTopLevelItemGroup
getItemGroup(String org)
abstract Collection<BlueOrganization>
list()
Iterates over all the organizations.abstract BlueOrganization
of(ItemGroup group)
If given group is an org, return its representation, or null.
-
-
-
Method Detail
-
get
public abstract BlueOrganization get(String name)
Looks up an organization by its name.- Returns:
- null if the no such org exists.
-
list
public abstract Collection<BlueOrganization> list()
Iterates over all the organizations.
-
of
public abstract BlueOrganization of(ItemGroup group)
If given group is an org, return its representation, or null.
-
getContainingOrg
@CheckForNull public BlueOrganization getContainingOrg(ItemGroup p)
Finds a nearest organization that contains the givenItemGroup
.- Returns:
- null if the given object doesn't belong to any organization.
-
getContainingOrg
@CheckForNull @Deprecated public final BlueOrganization getContainingOrg(Run r)
Deprecated.in 1.2UsegetContainingOrg(Item)
instead.- Parameters:
r
- run- Returns:
- organization
-
getContainingOrg
@CheckForNull public final BlueOrganization getContainingOrg(Item i)
-
getInstance
@NonNull public static OrganizationFactory getInstance()
-
getItemGroup
@CheckForNull public static ModifiableTopLevelItemGroup getItemGroup(String org)
-
getItemGroup
@CheckForNull public static ModifiableTopLevelItemGroup getItemGroup(BlueOrganization blueOrganization)
-
-