public class JenkinsFacade extends Object implements Serializable
| Constructor and Description |
|---|
JenkinsFacade() |
| Modifier and Type | Method and Description |
|---|---|
String |
getAbsoluteUrl(String... urlElements)
Returns an absolute URL for the specified url elements: e.g., creates the sequence ${rootUrl}/element1/element2.
|
Set<String> |
getAllJobNames()
Returns the full names of all available jobs.
|
List<Job> |
getAllJobs()
Returns all available jobs.
|
Optional<Run<?,?>> |
getBuild(String id)
Gets a
build by the full ID. |
<T extends Describable<T>,D extends Descriptor<T>> |
getDescriptorsFor(Class<T> describableType)
Returns the discovered instances for the given descriptor type.
|
<T> List<T> |
getExtensionsFor(Class<T> extensionType)
Returns the discovered instances for the given extension type.
|
String |
getFullNameOf(Job<?,?> job)
Returns the full name of the specified job.
|
String |
getImagePath(BallColor color)
Returns the absolute URL for the specified ball icon.
|
String |
getImagePath(String icon)
Returns the absolute URL for the specified icon.
|
Optional<Job<?,?>> |
getJob(String name)
Gets a
Job by its full name. |
boolean |
hasPermission(Permission permission)
Checks if the current security principal has this permission.
|
boolean |
hasPermission(Permission permission,
Job<?,?> project)
Checks if the current security principal has this permission for the specified project.
|
boolean |
isPluginInstalled(String pluginId)
Returns whether the plugin with the specified ID (short name, artifact ID) is installed.
|
public <T> List<T> getExtensionsFor(Class<T> extensionType)
T - type of the extensionextensionType - The base type that represents the extension point. Normally ExtensionPoint subtype but that's not
a hard requirement.public <T extends Describable<T>,D extends Descriptor<T>> DescriptorExtensionList<T,D> getDescriptorsFor(Class<T> describableType)
T - type of the describableD - type of the descriptordescribableType - the base type that represents the descriptor of the describablepublic boolean hasPermission(Permission permission)
permission - the permission to check forfalse if the user doesn't have the permissionpublic boolean hasPermission(Permission permission, Job<?,?> project)
permission - the permission to check forproject - the project to check the permissions forfalse if the user doesn't have the permissionpublic Optional<Job<?,?>> getJob(String name)
Job by its full name. Full names are like path names, where each name of Item is combined
by '/'.name - the full name of the jobpublic Optional<Run<?,?>> getBuild(String id)
build by the full ID.id - the ID of the buildpublic String getImagePath(BallColor color)
color - the colorpublic String getImagePath(String icon)
icon - the icon URLpublic String getAbsoluteUrl(String... urlElements)
urlElements - the url elementspublic Set<String> getAllJobNames()
AbstractItem.getFullName().public String getFullNameOf(Job<?,?> job)
job - the job to get the name forpublic boolean isPluginInstalled(String pluginId)
pluginId - the ID of the plugintrue if the plugin is installed, false if notCopyright © 2016–2021. All rights reserved.