public abstract class ChecksPublisherFactory extends Object implements ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson| Constructor and Description |
|---|
ChecksPublisherFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected Optional<ChecksPublisher> |
createPublisher(Job<?,?> job,
TaskListener listener)
|
protected Optional<ChecksPublisher> |
createPublisher(Run<?,?> run,
TaskListener listener)
|
static ChecksPublisher |
fromJob(Job<?,?> job,
TaskListener listener)
Returns a suitable publisher for the job.
|
static ChecksPublisher |
fromRun(Run<?,?> run,
TaskListener listener)
Returns a suitable publisher for the run.
|
protected Optional<ChecksPublisher> createPublisher(Run<?,?> run, TaskListener listener)
ChecksPublisher according to the SCM used by the Run.
If you don't want to create publisher for the run, return Optional.empty().
run - a Jenkins runlistener - a listener to the buildsChecksPublisherprotected Optional<ChecksPublisher> createPublisher(Job<?,?> job, TaskListener listener)
ChecksPublisher according to the SCM used by the Job.
By default,it will return Optional.empty() thus lead to a ChecksPublisher.NullChecksPublisher.
This method will be useful if you want create publisher for Queue.Item since you can cast
the belonged Queue.Task to Job.
job - a Jenkins joblistener - a listener to the buildsChecksPublisherpublic static ChecksPublisher fromRun(Run<?,?> run, TaskListener listener)
run - a Jenkins runlistener - a listener for the buildspublic static ChecksPublisher fromJob(Job<?,?> job, TaskListener listener)
job - a Jenkins joblistener - a listener for the buildsCopyright © 2016–2021. All rights reserved.