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 class
AbstractRepositoryHookRequest.AbstractBuilder<B extends AbstractRepositoryHookRequest.AbstractBuilder<B>>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves any additional context that was supplied to the request.boolean
isDryRun()
-
Constructor Details
-
AbstractRepositoryHookRequest
-
-
Method Details
-
getContext
Description copied from interface:RepositoryHookRequest
Retrieves 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:
getContext
in interfaceRepositoryHookRequest
- Returns:
- additional context provided when the ref-change was requested, if any
-
getRefChanges
- Specified by:
getRefChanges
in interfaceRepositoryHookRequest
- Returns:
- the proposed ref changes. Can be
empty
for 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:
getRepository
in interfaceRepositoryHookRequest
- Returns:
- the repository that's being updated
-
getScmHookDetails
- Specified by:
getScmHookDetails
in 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:
getTrigger
in interfaceRepositoryHookRequest
- Returns:
- the trigger of the request. This allows hook to adapt their logic based on the trigger.
-
isDryRun
public boolean isDryRun()- Specified by:
isDryRun
in interfaceRepositoryHookRequest
- Returns:
true
if this hook is a dry-run request, otherwisefalse
-