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
ModifierConstructorDescriptionSCMSourceEvent
(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) protected
SCMSourceEvent
(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 void
fireLater
(SCMSourceEvent<?> event, long delay, TimeUnit delayUnits) Fires theSCMSourceEvent
to all registeredSCMEventListener
instances after the specified delay.static void
fireNow
(SCMSourceEvent<?> event) Fires theSCMSourceEvent
to all registeredSCMEventListener
instances.abstract String
Returns the name of theSCMSource
, such as a repository name within an organization; may be used as anItem.getName()
.abstract boolean
isMatch
(SCMNavigator navigator) Tests if this event applies to the suppliedSCMNavigator
.abstract boolean
Tests 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.CREATED
logically could returntrue
if there has been out of order or delayed delivery of events)- Parameters:
source
- theSCMSource
, the source must beisMatch(SCMSource)
.- Returns:
true
if 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
null
if 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 anySCMNavigator
thatisMatch(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 theSCMSourceEvent
to all registeredSCMEventListener
instances.- Parameters:
event
- the event to fire.
-
fireLater
Fires theSCMSourceEvent
to all registeredSCMEventListener
instances 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.