public abstract class GitSCMTelescope extends jenkins.scm.api.SCMFileSystem.Builder
AbstractGitSCMSource to examine a repository from a distance
without requiring a local checkout.| Modifier and Type | Class and Description |
|---|---|
static class |
GitSCMTelescope.ReferenceType
The potential types of reference supported by a
GitSCMTelescope. |
ExtensionPoint.LegacyInstancesAreScopedToHudson| Constructor and Description |
|---|
GitSCMTelescope() |
| Modifier and Type | Method and Description |
|---|---|
jenkins.scm.api.SCMFileSystem |
build(Item owner,
SCM scm,
jenkins.scm.api.SCMRevision rev) |
jenkins.scm.api.SCMFileSystem |
build(jenkins.scm.api.SCMSource source,
jenkins.scm.api.SCMHead head,
jenkins.scm.api.SCMRevision rev) |
protected abstract jenkins.scm.api.SCMFileSystem |
build(String remote,
com.cloudbees.plugins.credentials.common.StandardCredentials credentials,
jenkins.scm.api.SCMHead head,
jenkins.scm.api.SCMRevision rev)
Given a
SCM this should try to build a corresponding SCMFileSystem instance that
reflects the content at the specified SCMRevision. |
abstract String |
getDefaultTarget(String remote,
com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
Retrieves the default target of the specified repository.
|
jenkins.scm.api.SCMRevision |
getRevision(String remote,
com.cloudbees.plugins.credentials.common.StandardCredentials credentials,
jenkins.scm.api.SCMHead head)
Retrieves the current revision of the specified head.
|
abstract jenkins.scm.api.SCMRevision |
getRevision(String remote,
com.cloudbees.plugins.credentials.common.StandardCredentials credentials,
String refOrHash)
Retrieves the current revision of the specified reference or object hash.
|
Iterable<jenkins.scm.api.SCMRevision> |
getRevisions(String remote,
com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
Retrieves the current revisions of the specified repository.
|
abstract Iterable<jenkins.scm.api.SCMRevision> |
getRevisions(String remote,
com.cloudbees.plugins.credentials.common.StandardCredentials credentials,
Set<GitSCMTelescope.ReferenceType> referenceTypes)
Retrieves the current revisions of the specified repository.
|
long |
getTimestamp(String remote,
com.cloudbees.plugins.credentials.common.StandardCredentials credentials,
jenkins.scm.api.SCMHead head)
Retrieves the timestamp of the specified reference or object hash.
|
abstract long |
getTimestamp(String remote,
com.cloudbees.plugins.credentials.common.StandardCredentials credentials,
String refOrHash)
Retrieves the timestamp of the specified reference or object hash.
|
static GitSCMTelescope |
of(AbstractGitSCMSource source)
|
static GitSCMTelescope |
of(GitSCM source)
|
boolean |
supports(SCM source) |
boolean |
supports(jenkins.scm.api.SCMSource source) |
abstract boolean |
supports(String remote)
Checks if this
SCMFileSystem.Builder supports the repository at the supplied remote URL. |
abstract void |
validate(String remote,
com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
Checks if the supplied credentials are valid against the specified repository URL.
|
supports, supports, supportsDescriptor, supportsDescriptor@CheckForNull public static GitSCMTelescope of(@NonNull GitSCM source)
source - the GitSCM.GitSCMTelescope to use for the specified GitSCM or null@CheckForNull public static GitSCMTelescope of(@NonNull AbstractGitSCMSource source)
source - the AbstractGitSCMSource.GitSCMTelescope to use for the specified AbstractGitSCMSource or nullpublic abstract boolean supports(@NonNull
String remote)
SCMFileSystem.Builder supports the repository at the supplied remote URL.
NOTE: returning true mandates that build(Item, SCM, SCMRevision) and
build(SCMSource, SCMHead, SCMRevision) must return non-null when they are configured
with the corresponding repository URL.remote - the repository URL.true if and only if the remote URL is supported by this GitSCMTelescope.public abstract void validate(@NonNull
String remote,
@CheckForNull
com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
throws IOException,
InterruptedException
remote - the repository URL.credentials - the credentials or null to validate anonymous connection.IOException - if the operation failed due to an IO error or invalid credentials.InterruptedException - if the operation was interrupted.public final boolean supports(@NonNull
SCM source)
supports in class jenkins.scm.api.SCMFileSystem.Builderpublic final boolean supports(@NonNull
jenkins.scm.api.SCMSource source)
supports in class jenkins.scm.api.SCMFileSystem.Builderpublic final jenkins.scm.api.SCMFileSystem build(@NonNull jenkins.scm.api.SCMSource source, @NonNull jenkins.scm.api.SCMHead head, @CheckForNull jenkins.scm.api.SCMRevision rev) throws IOException, InterruptedException
build in class jenkins.scm.api.SCMFileSystem.BuilderIOExceptionInterruptedExceptionpublic final jenkins.scm.api.SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, jenkins.scm.api.SCMRevision rev) throws IOException, InterruptedException
build in class jenkins.scm.api.SCMFileSystem.BuilderIOExceptionInterruptedException@CheckForNull protected abstract jenkins.scm.api.SCMFileSystem build(@NonNull String remote, @CheckForNull com.cloudbees.plugins.credentials.common.StandardCredentials credentials, @NonNull jenkins.scm.api.SCMHead head, @CheckForNull jenkins.scm.api.SCMRevision rev) throws IOException, InterruptedException
SCM this should try to build a corresponding SCMFileSystem instance that
reflects the content at the specified SCMRevision. If the SCM is supported but not
for a fixed revision, best effort is acceptable as the most capable SCMFileSystem will be returned
to the caller.remote - the repository URLcredentials - the credentials or null for an anonymous connection.head - the specified SCMHeadrev - the specified SCMRevision.SCMFileSystem or null if this builder cannot create a SCMFileSystem for the specified repository URL.IOException - if the attempt to create a SCMFileSystem failed due to an IO error
(such as the remote system being unavailable)InterruptedException - if the attempt to create a SCMFileSystem was interrupted.public abstract long getTimestamp(@NonNull
String remote,
@CheckForNull
com.cloudbees.plugins.credentials.common.StandardCredentials credentials,
@NonNull
String refOrHash)
throws IOException,
InterruptedException
remote - the repository URL.credentials - the credentials or null for an anonymous connection.refOrHash - the reference or hash. If this is a reference then it will start with Constants.R_REFS
If this is a hash, it may be a full hash or a short hash.IOException - if the operation failed due to an IO error.InterruptedException - if the operation was interrupted.@CheckForNull public abstract jenkins.scm.api.SCMRevision getRevision(@NonNull String remote, @CheckForNull com.cloudbees.plugins.credentials.common.StandardCredentials credentials, @NonNull String refOrHash) throws IOException, InterruptedException
remote - the repository URL.credentials - the credentials or null for an anonymous connection.refOrHash - the reference or hash. If this is a reference then it will start with Constants.R_REFS
If this is a hash, it may be a full hash or a short hash.null if the reference or hash does not exist.IOException - if the operation failed due to an IO error.InterruptedException - if the operation was interrupted.public long getTimestamp(@NonNull
String remote,
@CheckForNull
com.cloudbees.plugins.credentials.common.StandardCredentials credentials,
@NonNull
jenkins.scm.api.SCMHead head)
throws IOException,
InterruptedException
remote - the repository URL.credentials - the credentials or null for an anonymous connection.head - the head.IOException - if the operation failed due to an IO error.InterruptedException - if the operation was interrupted.@CheckForNull public jenkins.scm.api.SCMRevision getRevision(@NonNull String remote, @CheckForNull com.cloudbees.plugins.credentials.common.StandardCredentials credentials, @NonNull jenkins.scm.api.SCMHead head) throws IOException, InterruptedException
remote - the repository URL.credentials - the credentials or null for an anonymous connection.head - the head.null if the head does not exist.IOException - if the operation failed due to an IO error.InterruptedException - if the operation was interrupted.public final Iterable<jenkins.scm.api.SCMRevision> getRevisions(@NonNull String remote, @CheckForNull com.cloudbees.plugins.credentials.common.StandardCredentials credentials) throws IOException, InterruptedException
remote - the repository URL.credentials - the credentials or null for an anonymous connection.IOException - if the operation failed due to an IO error.InterruptedException - if the operation was interrupted.public abstract Iterable<jenkins.scm.api.SCMRevision> getRevisions(@NonNull String remote, @CheckForNull com.cloudbees.plugins.credentials.common.StandardCredentials credentials, @NonNull Set<GitSCMTelescope.ReferenceType> referenceTypes) throws IOException, InterruptedException
remote - the repository URL.credentials - the credentials or null for an anonymous connection.referenceTypes - the types of reference to retrieve revisions of.IOException - if the operation failed due to an IO error.InterruptedException - if the operation was interrupted.public abstract String getDefaultTarget(@NonNull String remote, @CheckForNull com.cloudbees.plugins.credentials.common.StandardCredentials credentials) throws IOException, InterruptedException
remote - the repository URL.credentials - the credentials or null for an anonymous connection.IOException - if the operation failed due to an IO error.InterruptedException - if the operation was interrupted.Copyright © 2007–2020. All rights reserved.