Class DisplayURLProvider
- java.lang.Object
-
- org.jenkinsci.plugins.displayurlapi.DisplayURLProvider
-
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
ClassicDisplayURLProvider
public abstract class DisplayURLProvider extends Object implements ExtensionPoint
Generates URLs for well known UI locations for use in notifications (e.g. mailer, HipChat, Slack, IRC, etc) Extensible to allow plugins to override common URLs (e.g. Blue Ocean or another future secondary UI)Implementations should generally extend
ClassicDisplayURLProvider
and delegate to it for unsupported builds instead of extending this class directly.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description DisplayURLProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExtensionList<DisplayURLProvider>
all()
Returns all theDisplayURLProvider
implementations.static DisplayURLProvider
get()
Returns theDisplayURLProvider
to use for generating links to be given to users.String
getArtifactsURL(Run<?,?> run)
Fully qualified URL for a page that displays artifacts for a Run.abstract String
getChangesURL(Run<?,?> run)
Fully qualified URL for a page that displays changes for a project.static DisplayURLProvider
getDefault()
Returns the singleton instance of theClassicDisplayURLProvider
extension.String
getDisplayName()
Display name of this provider e.g.abstract String
getJobURL(Job<?,?> job)
Fully qualified URL for a Jobs homeString
getName()
Name of provider to be used as an id.static DisplayURLProvider
getPreferredProvider()
Selects the provider that should be used to redirect users from the display URLs generated by the provider return byget()
to an actual page.String
getRoot()
Fully qualified URL for the Root display URLabstract String
getRunURL(Run<?,?> run)
Fully qualified URL for a Runabstract String
getTestsURL(Run<?,?> run)
Fully qualified URL for a page that displays tests for a Run.static PreferredProviderUserProperty
getUserPreferredProviderProperty()
-
-
-
Method Detail
-
get
public static DisplayURLProvider get()
Returns theDisplayURLProvider
to use for generating links to be given to users.- Returns:
- DisplayURLProvider
- See Also:
getPreferredProvider()
-
all
public static ExtensionList<DisplayURLProvider> all()
Returns all theDisplayURLProvider
implementations.- Returns:
- all the
DisplayURLProvider
implementations.
-
getDefault
public static DisplayURLProvider getDefault()
Returns the singleton instance of theClassicDisplayURLProvider
extension.
-
getRoot
@NonNull public String getRoot()
Fully qualified URL for the Root display URL
-
getDisplayName
@NonNull public String getDisplayName()
Display name of this provider e.g. "Jenkins Classic", "Blue Ocean", etc
-
getName
@NonNull public String getName()
Name of provider to be used as an id. Do not use i18n
-
getArtifactsURL
@NonNull public String getArtifactsURL(Run<?,?> run)
Fully qualified URL for a page that displays artifacts for a Run.
-
getChangesURL
@NonNull public abstract String getChangesURL(Run<?,?> run)
Fully qualified URL for a page that displays changes for a project.
-
getTestsURL
public abstract String getTestsURL(Run<?,?> run)
Fully qualified URL for a page that displays tests for a Run.
-
getJobURL
@NonNull public abstract String getJobURL(Job<?,?> job)
Fully qualified URL for a Jobs home
-
getPreferredProvider
@Nullable public static DisplayURLProvider getPreferredProvider()
Selects the provider that should be used to redirect users from the display URLs generated by the provider return byget()
to an actual page.Precedence is as follows, stopping at the first non-null value:
PreferredProviderUserProperty
DefaultDisplayURLProviderGlobalConfiguration
JENKINS_DISPLAYURL_PROVIDER_ENV
JENKINS_DISPLAYURL_PROVIDER_PROP
- The provider extension with the highest ordinal value that is not an instance of
ClassicDisplayURLProvider
ClassicDisplayURLProvider
- See Also:
get()
-
getUserPreferredProviderProperty
@Nullable public static PreferredProviderUserProperty getUserPreferredProviderProperty()
-
-