Package com.atlassian.bitbucket.scm
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 TypeMethodDescriptioncom.atlassian.bitbucket.repository.Repository
void
Performs whatever logic is necessary to handle the request.boolean
isWrite()
void
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
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 throwIOException
to indicate failures related to reading input or writing output during processing.- Throws:
IOException
- if reading or writing fails during processingcom.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
Sends the provided error details to the client, using SCM- and RPC-specific techniques as necessary.- Parameters:
summary
- a brief summary of the errordetailMessage
- a more detailed explanation of the failure- Throws:
IOException
- if the error details cannot be written to the underlying output mechanism
-