Package io.jenkins.plugins.checks.api
Class ChecksPublisherFactory
java.lang.Object
io.jenkins.plugins.checks.api.ChecksPublisherFactory
- All Implemented Interfaces:
ExtensionPoint
A publisher API for consumers to publish checks.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<ChecksPublisher>createPublisher(Job<?, ?> job, TaskListener listener) protected Optional<ChecksPublisher>createPublisher(Run<?, ?> run, TaskListener listener) static ChecksPublisherfromJob(Job<?, ?> job, TaskListener listener) Returns a suitable publisher for the job.static ChecksPublisherfromRun(Run<?, ?> run, TaskListener listener) Returns a suitable publisher for the run.
-
Constructor Details
-
ChecksPublisherFactory
public ChecksPublisherFactory()
-
-
Method Details
-
createPublisher
Creates aChecksPublisheraccording to theSCMused by theRun.If you don't want to create publisher for the run, return
Optional.empty().- Parameters:
run- a Jenkins runlistener- a listener to the builds- Returns:
- the created
ChecksPublisher
-
createPublisher
Creates aChecksPublisheraccording to theSCMused by theJob.By default,it will return
Optional.empty()thus lead to aChecksPublisher.NullChecksPublisher.This method will be useful if you want create publisher for
Queue.Itemsince you can cast the belongedQueue.TasktoJob.- Parameters:
job- a Jenkins joblistener- a listener to the builds- Returns:
- the created
ChecksPublisher
-
fromRun
Returns a suitable publisher for the run.- Parameters:
run- a Jenkins runlistener- a listener for the builds- Returns:
- a publisher suitable for the job
-
fromJob
Returns a suitable publisher for the job.- Parameters:
job- a Jenkins joblistener- a listener for the builds- Returns:
- a publisher suitable for the job
-