com.atlassian.bitbucket.hook.repository.RepositoryHookService |
Handles the aggregation of hooks and their enabled status. Settings for these hooks are handled elsewhere.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new
SettingsBuilder which can be used to create a Settings instance. | |||||||||||
Delete the hook configuration specified in the request.
| |||||||||||
Disable the hook specified in the request.
| |||||||||||
Enable and apply settings for the hook specified in the request.
| |||||||||||
Returns a supplier of an avatar for this hook, either one specified in the module or a default.
| |||||||||||
Find an effective installed hook with the specified key enabled status for this scope.
| |||||||||||
Gets the effective settings for the hook specified in the request.
| |||||||||||
Migrates settings between the specified hook keys.
| |||||||||||
Calls all registered and enabled
repository-hook modules (PostRepositoryHook ) | |||||||||||
Calls all registered and enabled
repository-hook modules (PreRepositoryHook ) | |||||||||||
Searches for
repository hooks that match the provided request . | |||||||||||
Sets the settings for the hook specified in the request.
|
Create a new SettingsBuilder
which can be used to create a Settings
instance.
Delete the hook configuration specified in the request.
request | describes the hook for which the configuration should be deleted |
---|
ArgumentValidationException | if the provided request is for any Scope other than
REPOSITORY
|
---|
Disable the hook specified in the request.
request | describing the hook to be disabled |
---|
RepositoryHook
Enable and apply settings for the hook specified in the request.
request | details for enabling a repository hook |
---|
RepositoryHook
FormValidationException | when settings are invalid, leaving the existing version unchanged |
---|---|
ArgumentValidationException | if the settings to be saved are too large, the current limit is 32KB once serialized. |
Returns a supplier of an avatar for this hook, either one specified in the module or a default.
hookKey | the hook key with the desired avatar |
---|
Find an effective installed hook with the specified key enabled status for this scope.
An effective hook is a hook that is either:
Repository hooks
can be configured at
project scope
or
repository scope
scope | the scope to load the hook from |
---|---|
hookKey | the hook to lookup |
RepositoryHook
if found. Otherwise null
.Gets the effective settings for the hook specified in the request.
request | details to get the settings for the specified hook |
---|
null
if no settings are stored.Migrates settings between the specified hook keys.
Hook keys are based on the combination of the plugin's key and the <repository-hook/>
's key
attribute. Changing either key will result in a new hook key, and the "loss" of all existing settings
in all repositories (because they remain associated with the old key).
When calling this method, the <repository-hook/>
for the specified oldHookKey
must no longer
be installed, and the <repository-hook/>
for the new key must be present.
Calling this method requires ADMIN
permission.
Apps may need to use the SecurityService
to apply that permission.
oldHookKey | the hook's old key |
---|---|
newHookKey | the hook's new key |
ArgumentValidationException | if the old hook is still installed, or the new hook is not installed |
---|
Calls all registered and enabled repository-hook
modules (PostRepositoryHook
)
request | describes the ref changes that have been applied |
---|
Calls all registered and enabled repository-hook
modules (PreRepositoryHook
)
request | describes the ref changes that are about to be made |
---|
repository-hook
modulesSearches for repository hooks
that match the provided request
.
request | a request object describing the repository hooks to return |
---|---|
pageRequest | paging options |
RepositoryHook
s matching the supplied typeSets the settings for the hook specified in the request.
request | describing the update settings request |
---|
FormValidationException | when settings are invalid, leaving the existing version unchanged |
---|---|
ArgumentValidationException | if the settings to be saved are too large, the current limit is 32KB once serialized. |