Package jenkins.scm.api
Class SCMSourceEvent<P>
- java.lang.Object
-
- jenkins.scm.api.SCMEvent<P>
-
- jenkins.scm.api.SCMSourceEvent<P>
-
-
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
Constructors Modifier Constructor Description SCMSourceEvent(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
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
descriptionFor(SCMNavigator navigator)
Return a description of the event in the context of the suppliedSCMNavigator
.String
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
getSourceName()
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
isMatch(SCMSource source)
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, toString
-
-
-
-
Constructor Detail
-
SCMSourceEvent
@Deprecated public SCMSourceEvent(@NonNull SCMEvent.Type type, long timestamp, @NonNull P payload)
Deprecated.
-
SCMSourceEvent
public SCMSourceEvent(@NonNull SCMEvent.Type type, long timestamp, @NonNull P payload, @CheckForNull String origin)
-
SCMSourceEvent
@Deprecated public SCMSourceEvent(@NonNull SCMEvent.Type type, @NonNull P payload)
Deprecated.
-
SCMSourceEvent
public SCMSourceEvent(@NonNull SCMEvent.Type type, @NonNull P payload, @CheckForNull String origin)
-
SCMSourceEvent
protected SCMSourceEvent(@NonNull SCMSourceEvent<P> src)
-
-
Method Detail
-
isMatch
public abstract boolean isMatch(@NonNull SCMNavigator navigator)
Tests if this event applies to the suppliedSCMNavigator
.- Parameters:
navigator
- theSCMNavigator
.- Returns:
true
if and only if this event concerns the suppliedSCMNavigator
.
-
descriptionFor
@CheckForNull public String descriptionFor(SCMNavigator navigator)
Return a description of the event in the context of the suppliedSCMNavigator
.- Parameters:
navigator
- theSCMNavigator
, the navigator must beisMatch(SCMNavigator)
.- Returns:
- the description or
null
if no description can be provided. - Since:
- 2.1.1
-
isMatch
public abstract boolean isMatch(@NonNull SCMSource source)
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
@CheckForNull public String descriptionFor(SCMSource source)
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
@NonNull public abstract String 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
public static void fireNow(@NonNull SCMSourceEvent<?> event)
Fires theSCMSourceEvent
to all registeredSCMEventListener
instances.- Parameters:
event
- the event to fire.
-
fireLater
public static void fireLater(@NonNull SCMSourceEvent<?> event, long delay, TimeUnit delayUnits)
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.
-
-