Class DefaultPushGHEventSubscriber
- java.lang.Object
-
- org.jenkinsci.plugins.github.extension.GHEventsSubscriber
-
- org.jenkinsci.plugins.github.webhook.subscriber.DefaultPushGHEventSubscriber
-
- All Implemented Interfaces:
ExtensionPoint
@Extension public class DefaultPushGHEventSubscriber extends GHEventsSubscriber
By default this plugin interested in push events only when job usesGitHubPushTrigger
- Since:
- 1.12.0
- Author:
- lanwen (Merkushev Kirill)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description DefaultPushGHEventSubscriber()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<org.kohsuke.github.GHEvent>
events()
Should be not null.protected boolean
isApplicable(Item project)
This subscriber is applicable only for job with GHPush triggerprotected void
onEvent(GHSubscriberEvent event)
CallsGitHubPushTrigger
in all projects to handle this hook-
Methods inherited from class org.jenkinsci.plugins.github.extension.GHEventsSubscriber
all, extractEvents, isApplicable, isApplicableFor, isApplicableFor, isInterestedIn, onEvent, processEvent, processEvent
-
-
-
-
Method Detail
-
isApplicable
protected boolean isApplicable(Item project)
This subscriber is applicable only for job with GHPush trigger- Specified by:
isApplicable
in classGHEventsSubscriber
- Parameters:
project
- to check for trigger- Returns:
- true if project has
GitHubPushTrigger
-
events
protected Set<org.kohsuke.github.GHEvent> events()
Description copied from class:GHEventsSubscriber
Should be not null. Should return only events which this extension can parse inGHEventsSubscriber.onEvent(GHEvent, String)
Don't call it directly, useGHEventsSubscriber.extractEvents()
orGHEventsSubscriber.isInterestedIn(GHEvent)
static functions- Specified by:
events
in classGHEventsSubscriber
- Returns:
- set with only push event
-
onEvent
protected void onEvent(GHSubscriberEvent event)
CallsGitHubPushTrigger
in all projects to handle this hook- Overrides:
onEvent
in classGHEventsSubscriber
- Parameters:
event
- only PUSH event
-
-