Interface ScmRequest

All Known Subinterfaces:
HttpScmRequest, SshScmRequest
All Known Implementing Classes:
AbstractRepositoryScmRequest, AbstractScmRequest

public interface ScmRequest
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.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.atlassian.bitbucket.repository.Repository
     
    void
    Performs whatever logic is necessary to handle the request.
    boolean
     
    void
    sendError(String summary, String detailMessage)
    Sends the provided error details to the client, using SCM- and RPC-specific techniques as necessary.
  • Method Details

    • getRepository

      @Nonnull com.atlassian.bitbucket.repository.Repository getRepository()
      Returns:
      the repository that is the target of this action.
    • handleRequest

      void handleRequest() throws IOException
      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
      com.atlassian.bitbucket.ResourceBusyException - when the server is too busy to execute the request
    • isWrite

      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)
    • sendError

      void sendError(@Nonnull String summary, @Nonnull String detailMessage) throws IOException
      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