Package jenkins.scm.api
Class SCMSourceEvent<P>
java.lang.Object
jenkins.scm.api.SCMEvent<P>
jenkins.scm.api.SCMSourceEvent<P>
- Type Parameters:
P- the (provider specific) payload.
Base class for events relating to
SCMSource instances.- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from class jenkins.scm.api.SCMEvent
SCMEvent.Dispatcher<E extends SCMEvent<?>>, SCMEvent.EventQueueMetrics, SCMEvent.Type -
Field Summary
Fields inherited from class jenkins.scm.api.SCMEvent
ORIGIN_UNKNOWN -
Constructor Summary
ConstructorsModifierConstructorDescriptionSCMSourceEvent(SCMEvent.Type type, long timestamp, P payload) Deprecated.SCMSourceEvent(SCMEvent.Type type, long timestamp, P payload, String origin) SCMSourceEvent(SCMEvent.Type type, P payload) Deprecated.SCMSourceEvent(SCMEvent.Type type, P payload, String origin) protectedSCMSourceEvent(SCMSourceEvent<P> src) -
Method Summary
Modifier and TypeMethodDescriptiondescriptionFor(SCMNavigator navigator) Return a description of the event in the context of the suppliedSCMNavigator.descriptionFor(SCMSource source) Return a description of the event in the context of the suppliedSCMSource.static voidfireLater(SCMSourceEvent<?> event, long delay, TimeUnit delayUnits) Fires theSCMSourceEventto all registeredSCMEventListenerinstances after the specified delay.static voidfireNow(SCMSourceEvent<?> event) Fires theSCMSourceEventto all registeredSCMEventListenerinstances.abstract StringReturns the name of theSCMSource, such as a repository name within an organization; may be used as anItem.getName().abstract booleanisMatch(SCMNavigator navigator) Tests if this event applies to the suppliedSCMNavigator.abstract booleanTests if this event applies to the suppliedSCMSource.Methods inherited from class jenkins.scm.api.SCMEvent
asCauses, closeExecutorService, description, equals, executorService, getDate, getEventProcessingMetrics, getOrigin, getPayload, getTimestamp, getType, hashCode, originOf, originOf, toString
-
Constructor Details
-
SCMSourceEvent
Deprecated. -
SCMSourceEvent
public SCMSourceEvent(@NonNull SCMEvent.Type type, long timestamp, @NonNull P payload, @CheckForNull String origin) -
SCMSourceEvent
Deprecated. -
SCMSourceEvent
-
SCMSourceEvent
-
-
Method Details
-
isMatch
Tests if this event applies to the suppliedSCMSource. (Calling this method for aSCMEvent.Type.CREATEDlogically could returntrueif there has been out of order or delayed delivery of events)- Parameters:
source- theSCMSource, the source must beisMatch(SCMSource).- Returns:
trueif and only if this event concerns the suppliedSCMSource.
-
descriptionFor
Return a description of the event in the context of the suppliedSCMSource.- Parameters:
source- theSCMSource.- Returns:
- the description or
nullif no description can be provided. - Since:
- 2.1.1
-
getSourceName
Returns the name of theSCMSource, such as a repository name within an organization; may be used as anItem.getName(). Must be the same as the name that would be passed toSCMSourceObserver.observe(String)by anySCMNavigatorthatisMatch(SCMNavigator).DO NOT TRUST THE RETURN VALUES. Data from events should only be used as a rumour that requires verification.
- Returns:
- the name of the
SCMSource
-
fireNow
Fires theSCMSourceEventto all registeredSCMEventListenerinstances.- Parameters:
event- the event to fire.
-
fireLater
Fires theSCMSourceEventto all registeredSCMEventListenerinstances after the specified delay.- Parameters:
event- the event to fire.delay- how long to wait before firing the event.delayUnits- the units of time in which the delay is expressed.