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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionList<BluePipelineFactory> all()protected static ItemfindNextStep(ItemGroup context, Item target) Returns the immediate child of 'context' that is also the ancestor of 'target'abstract BluePipelinegetPipeline(Item item, Reachable parent, BlueOrganization organization) static BluePipelinegetPipelineInstance(Item item, Reachable parent) GivesBluePipelineinstance from the first pipeline found.static ResourceGiven a Job in Jenkins, map that to corresponding blue ocean API object, for example so that you can get its URL.abstract Resourceresolve(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 objectcontextthat 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 objectcontextthat is an ancestor oftarget. If thisBluePipelineFactoryunderstands how to mapcontexttoBluePipeline(as ingetPipeline(item,parent)!=null), then the resolve method should also apply the same logic to mapcontextand 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 toResourceorganization- The organization that the context and target are a child of- Returns:
- null if this implementation doesn't know how to map
contextto 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
GivesBluePipelineinstance from the first pipeline found.- Parameters:
item-Itemfor which corresponding BlueOcean API object needs to be found. Must implementTopLevelItemfor return to be not nullparent- ParentReachableobject- Returns:
BluePipelineif a map of item to BlueOcean API found, null otherwise.
-