Package jenkins.scm.impl
Class NullSCMSource
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<SCMSource>
-
- jenkins.scm.api.SCMSource
-
- jenkins.scm.impl.NullSCMSource
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<SCMSource>
public class NullSCMSource extends SCMSource
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jenkins.scm.api.SCMSource
SCMSource.SourceByItem
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static String
ID
The "magic" id of theNullSCMSource
.
-
Constructor Summary
Constructors Constructor Description NullSCMSource()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SCM
build(SCMHead head, SCMRevision revision)
Builds aSCM
instance for the specified head and revision, no validation of the head is performed, a revision for a different head or source will be treated as equivalent to anull
revision.protected void
retrieve(SCMSourceCriteria criteria, SCMHeadObserver observer, SCMHeadEvent<?> event, TaskListener listener)
SPI: Fetches the latest heads and corresponding revisions that are originating from the supplied event.-
Methods inherited from class jenkins.scm.api.SCMSource
afterSave, build, canProbe, checkInterrupt, createProbe, defaultListener, equals, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetchActions, fetchActions, fetchActions, fetchRevisions, fetchRevisions, fromSCMFileSystem, getCategories, getCriteria, getDescriptor, getId, getOwner, getPronoun, getTraits, getTrustedRevision, hashCode, hasId, isCategoryEnabled, newProbe, parentHeads, parentRevisions, retrieve, retrieve, retrieve, retrieve, retrieve, retrieve, retrieve, retrieveActions, retrieveActions, retrieveActions, retrieveRevisions, retrieveRevisions, setId, setOwner, setTraits, toString, withId
-
-
-
-
Field Detail
-
ID
public static final String ID
The "magic" id of theNullSCMSource
.
-
-
Method Detail
-
retrieve
protected void retrieve(@CheckForNull SCMSourceCriteria criteria, @NonNull SCMHeadObserver observer, @CheckForNull SCMHeadEvent<?> event, @NonNull TaskListener listener) throws IOException, InterruptedException
SPI: Fetches the latest heads and corresponding revisions that are originating from the supplied event. If the supplied event is one that the implementer trusts, then the implementer may be able to optimize retrieval to minimize round trips. Implementers are free to cache intermediary results but the call must always check the validity of any intermediary caches.It is vitally important that implementations must periodically call
SCMSource.checkInterrupt()
otherwise it will be impossible for users to interrupt the operation.The default implementation wraps the
SCMHeadObserver
usingSCMHeadEvent.filter(SCMSource, SCMHeadObserver)
and delegates toSCMSource.retrieve(SCMSourceCriteria, SCMHeadObserver, TaskListener)
- Specified by:
retrieve
in classSCMSource
- Parameters:
criteria
- the criteria to use, if non-null
them implementations mustfilter allSCMHead
instances against theSCMSourceCriteria.isHead(SCMSourceCriteria.Probe, TaskListener)
before passing through to theSCMHeadObserver
.observer
- an observer of interim results, if the event is non-null
then the observer will already have been filtered withSCMHeadEvent.filter(SCMSource, SCMHeadObserver)
.event
- the (optional) event from which the operation should be scoped.listener
- the task listener.- Throws:
IOException
- if an error occurs while performing the operation.InterruptedException
- if any thread has interrupted the current thread.
-
build
@NonNull public SCM build(@NonNull SCMHead head, @CheckForNull SCMRevision revision)
Builds aSCM
instance for the specified head and revision, no validation of the head is performed, a revision for a different head or source will be treated as equivalent to anull
revision.
-
-