@ThreadSafe public interface

ScmProtocol

com.atlassian.stash.scm.ScmProtocol
Known Indirect Subclasses

Class Overview

An extension point for declaring an Scm's support for a protocol and for generating protocol-specific clone URLs for Repository repositories of that kind.

This extension point is not used to implement such a protocol, merely to indicate to Stash that it is supported.

Note: Implementations of this interface are required to be thread-safe.

Summary

Public Methods
@Nullable String getCloneUrl(Repository repository, StashUser user)
Retrieves the clone URL specific to this protocol for the supplied repository and, if appropriate, tailored to the supplied user.
@Nonnull String getName()
boolean supports(Scm scm)
Determines if this protocol supports the supplied scm.

Public Methods

@Nullable public String getCloneUrl (Repository repository, StashUser user)

Retrieves the clone URL specific to this protocol for the supplied repository and, if appropriate, tailored to the supplied user. Implementations must handle the case where there is no such user active.

Parameters
repository the repository to calculate the clone URL against
user 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

@Nonnull public String getName ()

Returns
  • the name of the protocol e.g. "ssh" or "http". The name must be lowercase.

public boolean supports (Scm scm)

Determines if this protocol supports the supplied scm.

Parameters
scm the scm
Returns
  • true if this protocol is supported for the supplied Scm or false otherwise