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<hudson.model.Job> |
getAllJobs()
Returns all available jobs.
|
Optional<hudson.model.Run<?,?>> |
getBuild(String id)
Gets a
build by the full ID. |
<T extends hudson.model.Describable<T>,D extends hudson.model.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(hudson.model.Job<?,?> job)
Returns the full name of the specified job.
|
String |
getImagePath(hudson.model.BallColor color)
Returns the absolute URL for the specified ball icon.
|
String |
getImagePath(String icon)
Returns the absolute URL for the specified icon.
|
Optional<hudson.model.Job<?,?>> |
getJob(String name)
Gets a
Job by its full name. |
boolean |
hasPermission(hudson.security.Permission permission)
Checks if the current security principal has this permission.
|
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 hudson.model.Describable<T>,D extends hudson.model.Descriptor<T>> hudson.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(hudson.security.Permission permission)
permission - the permission to check forfalse if the user doesn't have the permissionpublic Optional<hudson.model.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<hudson.model.Run<?,?>> getBuild(String id)
build by the full ID.id - the ID of the buildpublic String getImagePath(hudson.model.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 List<hudson.model.Job> getAllJobs()
public String getFullNameOf(hudson.model.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–2019. All rights reserved.