SCMEvent.Dispatcher<E extends SCMEvent<?>>, SCMEvent.EventQueueMetrics, SCMEvent.Type
ORIGIN_UNKNOWN
Modifier | Constructor and Description |
---|---|
|
SCMHeadEvent(SCMEvent.Type type,
long timestamp,
P payload)
Deprecated.
|
|
SCMHeadEvent(SCMEvent.Type type,
long timestamp,
P payload,
String origin) |
|
SCMHeadEvent(SCMEvent.Type type,
P payload)
Deprecated.
|
|
SCMHeadEvent(SCMEvent.Type type,
P payload,
String origin) |
protected |
SCMHeadEvent(SCMHeadEvent<P> src) |
Modifier and Type | Method and Description |
---|---|
String |
descriptionFor(SCM scm)
Return a description of the event in the context of the supplied
SCM . |
String |
descriptionFor(SCMNavigator navigator)
Return a description of the event in the context of the supplied
SCMNavigator . |
String |
descriptionFor(SCMSource source)
Return a description of the event in the context of the supplied
SCMSource . |
<O extends SCMHeadObserver> |
filter(SCMSource source,
O delegate)
Wraps a
SCMHeadObserver such that the wrapped observer will only observe SCMHead instances
mentioned in this event. |
static void |
fireLater(SCMHeadEvent<?> event,
long delay,
TimeUnit delayUnits)
Fires the
SCMHeadEvent to all registered SCMEventListener instances after the specified delay. |
static void |
fireNow(SCMHeadEvent<?> event)
Fires the
SCMHeadEvent to all registered SCMEventListener instances. |
abstract String |
getSourceName()
Returns the name of the
SCMSource , such as a repository name within an organization; may be used as an
Item.getName() . |
abstract Map<SCMHead,SCMRevision> |
heads(SCMSource source)
|
abstract boolean |
isMatch(SCM scm)
Tests if this event applies to the supplied
SCM . |
abstract boolean |
isMatch(SCMNavigator navigator)
Tests if this event applies to the supplied
SCMNavigator . |
boolean |
isMatch(SCMSource source)
Tests if this event applies to the supplied
SCMSource . |
asCauses, closeExecutorService, description, equals, executorService, getDate, getEventProcessingMetrics, getOrigin, getPayload, getTimestamp, getType, hashCode, originOf, toString
@Deprecated public SCMHeadEvent(@NonNull SCMEvent.Type type, long timestamp, @NonNull P payload)
public SCMHeadEvent(@NonNull SCMEvent.Type type, long timestamp, @NonNull P payload, @CheckForNull String origin)
@Deprecated public SCMHeadEvent(@NonNull SCMEvent.Type type, @NonNull P payload)
public SCMHeadEvent(@NonNull SCMEvent.Type type, @NonNull P payload, @CheckForNull String origin)
protected SCMHeadEvent(@NonNull SCMHeadEvent<P> src)
public abstract boolean isMatch(@NonNull SCMNavigator navigator)
SCMNavigator
.navigator
- the SCMNavigator
.true
if and only if this event concerns the supplied SCMNavigator
.@CheckForNull public String descriptionFor(@NonNull SCMNavigator navigator)
SCMNavigator
.navigator
- the SCMNavigator
, the navigator must be isMatch(SCMNavigator)
.null
if no description can be provided.@NonNull public abstract String getSourceName()
SCMSource
, such as a repository name within an organization; may be used as an
Item.getName()
. Must be the same as the name that would be passed to
SCMSourceObserver.observe(String)
by any SCMNavigator
that isMatch(SCMNavigator)
.
NOTE: if and only if isMatch(SCMNavigator)
always returns false
then
the value returned here does not matter and a dummy value can be returned instead.
DO NOT TRUST THE RETURN VALUES. Data from events should only be used as a rumour that requires verification.
SCMSource
public boolean isMatch(@NonNull SCMSource source)
SCMSource
.@CheckForNull public String descriptionFor(SCMSource source)
SCMSource
.source
- the SCMSource
, the source must be isMatch(SCMSource)
.null
if no description can be provided.@NonNull public abstract Map<SCMHead,SCMRevision> heads(@NonNull SCMSource source)
SCMHead
for the supplied SCMSource
that this event corresponds to.
DO NOT TRUST THE RETURN VALUES. Data from events should only be used as a rumour that requires verification.
source
- the SCMSource
.SCMHead
(and optional SCMRevision
) that this event corresponds to when considered
from the point of view of the supplied SCMSource
. The map may be empty in the case where the event is
not relevant to the supplied SCMSource
public abstract boolean isMatch(@NonNull SCM scm)
SCM
. Implementations that return true
will trigger
polling for the matching jobs that have enabled the SCMTrigger
and have not disabled the post commit
hooks SCMTrigger.isIgnorePostCommitHooks()
.
NOTE: if you are implementing SCMHeadEvent
and you already have a separate code path
responsible for notifying SCMTrigger
then you should either remove that code path
or always return false
from this method. The recommendation is to consolidate on
SCMHeadEvent
based triggering as that minimizes the number of times the graph of all items needs to
be traversed by event listeners.
scm
- the SCM
.true
if and only if this event concerns the supplied SCM
.SCMTriggerListener
,
SCMTrigger.isIgnorePostCommitHooks()
@CheckForNull public String descriptionFor(SCM scm)
SCM
.scm
- the SCM
, the scm must be isMatch(SCM)
.null
if no description can be provided.public <O extends SCMHeadObserver> SCMHeadObserver.Wrapped<O> filter(@NonNull SCMSource source, O delegate)
SCMHeadObserver
such that the wrapped observer will only observe SCMHead
instances
mentioned in this event.O
- the type of delegate.source
- the SCMSource
.delegate
- the delegate.public static void fireNow(@NonNull SCMHeadEvent<?> event)
SCMHeadEvent
to all registered SCMEventListener
instances.event
- the event to fire.public static void fireLater(@NonNull SCMHeadEvent<?> event, long delay, TimeUnit delayUnits)
SCMHeadEvent
to all registered SCMEventListener
instances after the specified delay.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.Copyright © 2016–2022. All rights reserved.