Class AbstractRepositoryHookRequest
java.lang.Object
com.atlassian.bitbucket.hook.repository.AbstractRepositoryHookRequest
- All Implemented Interfaces:
RepositoryHookRequest
- Direct Known Subclasses:
BranchHookRequest,FileEditHookRequest,SimpleMergeHookRequest,SimplePullRequestMergeHookRequest,SimpleRepositoryHookRequest,TagHookRequest
Base class for the various
RepositoryHookRequests. Plugins that want to invoke
pre-hooks or
post-hooks with a custom request type can use
this class as a base class to provide the common request attributes.- Since:
- 5.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classAbstractRepositoryHookRequest.AbstractBuilder<B extends AbstractRepositoryHookRequest.AbstractBuilder<B>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionRetrieves any additional context that was supplied to the request.booleanisDryRun()
-
Constructor Details
-
AbstractRepositoryHookRequest
-
-
Method Details
-
getContext
Description copied from interface:RepositoryHookRequestRetrieves any additional context that was supplied to the request. This context is intended to allow plugin developers to implement their own behavior around ref-changes. As a result, its contents are unspecified; they depend on the installed plugins.On
dry runs, the context will always be empty.- Specified by:
getContextin interfaceRepositoryHookRequest- Returns:
- additional context provided when the ref-change was requested, if any
-
getRefChanges
- Specified by:
getRefChangesin interfaceRepositoryHookRequest- Returns:
- the proposed ref changes. Can be
emptyfor some dry-run requests where the target hash is not yet known because the relevant commit hasn't been created yet. As an example, this is the case formerge requests. In these cases, the specialized request type should provide sufficient information about the proposed change. ForMergeHookRequest, this would beMergeHookRequest.getFromRef()andMergeHookRequest.getToRef().
-
getRepository
- Specified by:
getRepositoryin interfaceRepositoryHookRequest- Returns:
- the repository that's being updated
-
getScmHookDetails
- Specified by:
getScmHookDetailsin interfaceRepositoryHookRequest- Returns:
- SCM level hook details, if available. This will only be available when the hook is called synchronously as part of an SCM hook (such as pre-receive).
-
getTrigger
- Specified by:
getTriggerin interfaceRepositoryHookRequest- Returns:
- the trigger of the request. This allows hook to adapt their logic based on the trigger.
-
isDryRun
public boolean isDryRun()- Specified by:
isDryRunin interfaceRepositoryHookRequest- Returns:
trueif this hook is a dry-run request, otherwisefalse
-