public interface

ScmRequest

com.atlassian.bitbucket.scm.ScmRequest
Known Indirect Subclasses

Class Overview

A read or write request targeting a Stash repository. Instances are pass through a series of validators managed by the ScmRequestCheckService to verify preconditions (e.g. permissions), before they are handled.

Summary

Public Methods
@Nonnull Repository getRepository()
void handleRequest()
Performs whatever logic is necessary to handle the request.
boolean isWrite()
void sendError(String summary, String detailMessage)
Sends the provided error details to the client, using SCM- and RPC-specific techniques as necessary.

Public Methods

@Nonnull public Repository getRepository ()

Returns
  • the repository that is the target of this action.

public void handleRequest ()

Performs whatever logic is necessary to handle the request. The exact operations performed are both SCM and RPC-specific, and left entirely to the implementor. Implementations may throw IOException to indicate failures related to reading input or writing output during processing.

Throws
IOException if reading or writing fails during processing
ResourceBusyException when the server is too busy to execute the request

public boolean isWrite ()

Returns
  • true if this is a write operation (e.g. a push to a repository) or false if it is a read-only operation (e.g. a pull or clone from a repository)

public void sendError (String summary, String detailMessage)

Sends the provided error details to the client, using SCM- and RPC-specific techniques as necessary.

Parameters
summary a brief summary of the error
detailMessage a more detailed explanation of the failure
Throws
IOException if the error details cannot be written to the underlying output mechanism