public interface

ScmStatus

com.atlassian.stash.scm.ScmStatus

Class Overview

Describes the current status of an Scm plugin.

SCMs which can change their status at runtime are encouraged to raise events when their status changes.

See Also

Summary

Public Methods
@Nullable KeyedMessage getMessage()
Retrieves a message describing the SCM's status.
boolean isAvailable()
Retrieves a flag indicating whether the SCM is available to process requests.

Public Methods

@Nullable public KeyedMessage getMessage ()

Retrieves a message describing the SCM's status.

When isAvailable() returns true, implementations of this method may return null. However, they are encouraged to return a message describing the SCM implementation instead. For example, they might return a message indicating the version of the SCM being used.

When isAvailable() returns false, implementations are this are required to return a non-null message describing the issue or issues affecting the SCM. The message should be as detailed and thorough as possible to aid administrators in resolving the issue.

Returns
  • a message describing the SCM's current status, which may be null if the SCM is available

public boolean isAvailable ()

Retrieves a flag indicating whether the SCM is available to process requests.

When true, the Scm is expected to support its full, normal functionality. This means, at a minimum, the command factory and other Scm methods must work correctly. If the plugin does not support command builders or pull requests, whether the SCM is available or not is not expected to be relevant.

When false, ScmService will prevent the system, or other plugins, from accessing the SCM, and the SCM's normal functionality is not expected to be usable. Note that plugins may directly access the SCM, bypassing the ScmService, and, when so doing, may not perform their own status checks. As a result, SCM implementations are encouraged to guard against such misuse internally, as the system cannot prevent it.

Returns
  • true if the SCM is available and functioning normally; otherwise, false if