Package com.atlassian.bitbucket.scm
Interface ScmProtocol
- All Known Subinterfaces:
HttpScmProtocol
,SshScmProtocol
@ThreadSafe
public interface ScmProtocol
An extension point for declaring an
Scm's
support for a protocol and for generating protocol-specific
clone URLs for repositories
of that kind
.
This extension point is not used to implement such a protocol, merely to indicate that it is supported.
Note: Implementations of this interface are required to be thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptiongetCloneUrl
(com.atlassian.bitbucket.repository.Repository repository, com.atlassian.bitbucket.user.ApplicationUser user) Retrieves the clone URL specific to this protocol for the suppliedrepository
and, if appropriate, tailored to thesupplied user
.getName()
default boolean
Determines if this protocol supports the specifiedSCM
.boolean
-
Method Details
-
getBaseUrl
- Returns:
- the base URL to use when formatting
clone URLs
, which must not benull
- Since:
- 5.0
-
getCloneUrl
@Nullable String getCloneUrl(@Nonnull com.atlassian.bitbucket.repository.Repository repository, @Nullable com.atlassian.bitbucket.user.ApplicationUser user) Retrieves the clone URL specific to this protocol for the suppliedrepository
and, if appropriate, tailored to thesupplied user
. Implementations must handle the case where there is no such user active.- Parameters:
repository
- the repository to calculate the clone URL againstuser
- the possibly null user to tailor the clone URL for if this is appropriate to the protocol- Returns:
- the calculated clone URL or null if this cannot be calculated for any reason
-
getName
- Returns:
- the name of the protocol e.g. "ssh" or "http". The name must be lowercase.
-
supports
Determines if this protocol supports the specifiedSCM
.- Parameters:
scm
- the scm- Returns:
- true if this protocol is supported for the supplied
Scm
or false otherwise
-
supports
- Parameters:
scmId
- theID
of the scm- Returns:
- true if this protocol is supported for the supplied SCM or false otherwise
- Since:
- 5.0
-