Class BluePipelineFactory
java.lang.Object
io.jenkins.blueocean.rest.factory.BluePipelineFactory
- All Implemented Interfaces:
ExtensionPoint
Factory that gives instance of
BluePipeline
It's useful for example in cases where a plugin that has custom project and they want to serve
extra meta-data thru BluePipeline, would provide implementation of their BluePipeline and and implementation
of BluePipelineFactory.- Author:
- Vivek Pandey
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionList<BluePipelineFactory>
all()
protected static Item
findNextStep
(ItemGroup context, Item target) Returns the immediate child of 'context' that is also the ancestor of 'target'abstract BluePipeline
getPipeline
(Item item, Reachable parent, BlueOrganization organization) static BluePipeline
getPipelineInstance
(Item item, Reachable parent) GivesBluePipeline
instance from the first pipeline found.static Resource
Given a Job in Jenkins, map that to corresponding blue ocean API object, for example so that you can get its URL.abstract Resource
resolve
(Item context, Reachable parent, Item target, BlueOrganization organization) Finds a blue ocean API model object that pairs up with the giventarget
, by looking at the intermediate core model objectcontext
that is an ancestor oftarget
.
-
Constructor Details
-
BluePipelineFactory
public BluePipelineFactory()
-
-
Method Details
-
getPipeline
public abstract BluePipeline getPipeline(Item item, Reachable parent, BlueOrganization organization) - Parameters:
item
- to convert into a pipelineparent
- of the itemorganization
- the item is a child of- Returns:
- resolved pipeline or null
-
resolve
public abstract Resource resolve(Item context, Reachable parent, Item target, BlueOrganization organization) Finds a blue ocean API model object that pairs up with the giventarget
, by looking at the intermediate core model objectcontext
that is an ancestor oftarget
. If thisBluePipelineFactory
understands how to mapcontext
toBluePipeline
(as ingetPipeline(item,parent)!=null
), then the resolve method should also apply the same logic to mapcontext
and then recursively resolvetarget
.- Parameters:
context
- This is always an ancestor of target (including target==context)parent
- The parent object of the blue ocean API model object that pairs up with the 'context' parametertarget
- The core model object that we are trying to map toResource
organization
- The organization that the context and target are a child of- Returns:
- null if this implementation doesn't know how to map
context
to a blue ocean API model object. Otherwise return the BO API model object that pairs up withtarget
-
all
-
resolve
Given a Job in Jenkins, map that to corresponding blue ocean API object, for example so that you can get its URL. -
findNextStep
Returns the immediate child of 'context' that is also the ancestor of 'target' -
getPipelineInstance
GivesBluePipeline
instance from the first pipeline found.- Parameters:
item
-Item
for which corresponding BlueOcean API object needs to be found. Must implementTopLevelItem
for return to be not nullparent
- ParentReachable
object- Returns:
BluePipeline
if a map of item to BlueOcean API found, null otherwise.
-