Package jenkins.scm.impl
Class SingleSCMSource
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<SCMSource>
-
- jenkins.scm.api.SCMSource
-
- jenkins.scm.impl.SingleSCMSource
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<SCMSource>
public class SingleSCMSource extends SCMSource
A single fixed branch using a legacy SCM implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SingleSCMSource.DescriptorImpl
Our descriptor.-
Nested classes/interfaces inherited from class jenkins.scm.api.SCMSource
SCMSource.SourceByItem
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description SingleSCMSource(String name, SCM scm)
Our constructor.SingleSCMSource(String id, String name, SCM scm)
Deprecated.
-
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.String
getName()
SCM
getScm()
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.String
toString()
-
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, withId
-
-
-
-
Constructor Detail
-
SingleSCMSource
@DataBoundConstructor public SingleSCMSource(String name, SCM scm)
Our constructor.- Parameters:
name
- the name of the branch.scm
- the configuration.- Since:
- 2.2.0
-
SingleSCMSource
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @Deprecated public SingleSCMSource(String id, String name, SCM scm)
Deprecated.Legacy constructor.- Parameters:
id
- source id.name
- the name of the branch.scm
- the configuration.
-
-
Method Detail
-
getName
public String getName()
-
getScm
public SCM getScm()
-
retrieve
protected void retrieve(@CheckForNull SCMSourceCriteria criteria, @NonNull SCMHeadObserver observer, @CheckForNull SCMHeadEvent<?> event, @NonNull TaskListener listener) throws IOException, InterruptedException
Description copied from class:SCMSource
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.
-
-