public class DisplayURLContext extends Object implements Closeable
| Modifier and Type | Method and Description |
|---|---|
String |
attribute(String name)
Gets the custom attribute value for the current URL generation..
|
DisplayURLContext |
attribute(String name,
String value)
Adds custom attributes to the context.
|
void |
close() |
Queue.Executable |
executable()
Gets the
Queue.Executable associated with the current URL generation (if any). |
DisplayURLContext |
executable(Queue.Executable executable)
Uses the supplied
Queue.Executable to fill in as much of the context as possible. |
Job<?,?> |
job()
Gets the
Job associated with the current URL generation (if any). |
DisplayURLContext |
job(Job<?,?> job)
Uses the supplied
Job to fill in as much of the context as possible. |
static DisplayURLContext |
open()
Opens a
DisplayURLContext for the current thread. |
PluginWrapper |
plugin()
Gets the best guess as to the
PluginWrapper requesting the current URL generation (if any). |
DisplayURLContext |
plugin(PluginWrapper plugin)
Overrides the inferred plugin tha is requesting the URL to be generated with the supplied plugin.
|
Run<?,?> |
run()
Gets the
Run associated with the current URL generation (if any). |
DisplayURLContext |
run(Run<?,?> run)
Uses the supplied
Run to fill in as much of the context as possible. |
Queue.Task |
task()
Gets the
Queue.Task associated with the current URL generation (if any). |
DisplayURLContext |
task(Queue.Task task)
Uses the supplied
Queue.Task to fill in as much of the context as possible. |
@NonNull public static DisplayURLContext open()
DisplayURLContext for the current thread.DisplayURLContext.@NonNull public DisplayURLContext task(@CheckForNull Queue.Task task)
Queue.Task to fill in as much of the context as possible. If the task implements Job then the job() will also be set. Prefer calling job(Job) if you know the task is a Job already.task - the task.this for method chaining.@NonNull public DisplayURLContext executable(@CheckForNull Queue.Executable executable)
Queue.Executable to fill in as much of the context as possible. The owning task of the
executable will be used to set the task(). If the task implements Run then the run()
and job() will also be set. Prefer calling run(Run) if you know the executable is a Run
already.executable - the executable.this for method chaining.@NonNull public DisplayURLContext job(@CheckForNull Job<?,?> job)
Job to fill in as much of the context as possible. If the job is also a Queue.Task then task() will also be set.job - the job.this for method chaining.@NonNull public DisplayURLContext run(@CheckForNull Run<?,?> run)
Run to fill in as much of the context as possible. The Run.getParent() will be
set to the job() and task() as appropriate. If the run is also a Queue.Executable then
executable() will also be set.run - the run.this for method chaining.@NonNull public DisplayURLContext plugin(@CheckForNull PluginWrapper plugin)
plugin - the plugin.this for method chaining.@NonNull public DisplayURLContext attribute(String name, String value)
name - the name of the attribute.value - the value of the attribute (may be null).this for method chaining.@CheckForNull public Queue.Task task()
Queue.Task associated with the current URL generation (if any).Queue.Task associated with the current URL generation or null if none.@CheckForNull public Queue.Executable executable()
Queue.Executable associated with the current URL generation (if any).Queue.Executable associated with the current URL generation or null if none.@CheckForNull public Job<?,?> job()
Job associated with the current URL generation (if any).Job associated with the current URL generation or null if none.@CheckForNull public Run<?,?> run()
Run associated with the current URL generation (if any).Run associated with the current URL generation or null if none.@CheckForNull public PluginWrapper plugin()
PluginWrapper requesting the current URL generation (if any).PluginWrapper most closely associated with the current URL generation or null if
initiated by Jenkins core.@CheckForNull public String attribute(String name)
name - the name of the attribute.null.public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2016–2019. All rights reserved.