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.
| |||||||||||
This method is deprecated.
in 5.2 for removal in 6.0. Use
disable(DisableRepositoryHookRequest) instead.
| |||||||||||
This method is deprecated.
in 5.2 for removal in 6.0. Use
enable(EnableRepositoryHookRequest) instead.
| |||||||||||
Enable and apply settings for the hook specified in the request.
| |||||||||||
This method is deprecated.
in 5.2 for removal in 6.0. Use
enable(EnableRepositoryHookRequest) instead.
| |||||||||||
This method is deprecated.
in 5.2 for removal in 6.0. Use
search(RepositoryHookSearchRequest, PageRequest) instead.
| |||||||||||
This method is deprecated.
in 5.2 for removal in 6.0. Use
search(RepositoryHookSearchRequest, PageRequest) instead.
| |||||||||||
Returns a supplier of an avatar for this hook, either one specified in the module or a default.
| |||||||||||
This method is deprecated.
in 5.2 for removal in 6.0. Use
getByKey(Scope, String) instead.
| |||||||||||
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.
| |||||||||||
This method is deprecated.
in 5.2 for removal in 6.0. Use
getSettings(GetRepositoryHookSettingsRequest) instead.
| |||||||||||
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 . | |||||||||||
This method is deprecated.
in 5.2 for removal in 6.0. Use
setSettings(SetRepositoryHookSettingsRequest) instead.
| |||||||||||
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
This method is deprecated.
in 5.2 for removal in 6.0. Use disable(DisableRepositoryHookRequest)
instead.
Disable the hook identified by the supplied key for the specified repository.
repository | the repository this hook is being disabled on |
---|---|
hookKey | the hook to be disabled |
RepositoryHook
This method is deprecated.
in 5.2 for removal in 6.0. Use enable(EnableRepositoryHookRequest)
instead.
Enable the hook identified by the supplied key for the specified repository and apply the new settings.
This is a convenient method which performs enable(Repository, String)
and setSettings(Repository, String, Settings)
in the same transaction
repository | the repository this hook is being enabled on |
---|---|
hookKey | the hook to be enabled |
settings | the new settings. |
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. |
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. |
This method is deprecated.
in 5.2 for removal in 6.0. Use enable(EnableRepositoryHookRequest)
instead.
Enable the hook identified by the supplied key for the specified repository.
repository | the repository this hook is being enabled on |
---|---|
hookKey | the hook to be enabled |
RepositoryHook
This method is deprecated.
in 5.2 for removal in 6.0. Use search(RepositoryHookSearchRequest, PageRequest)
instead.
Find all installed hooks of the specified repository with their enabled status.
repository | the repository to load the hook from |
---|---|
pageRequest | paging options |
RepositoryHook
s matching the supplied type
This method is deprecated.
in 5.2 for removal in 6.0. Use search(RepositoryHookSearchRequest, PageRequest)
instead.
Find all installed hooks of the specified RepositoryHookType
with enabled status for this repository
repository | the repository to load the hook from |
---|---|
type | the type of hooks to be looked for |
pageRequest | paging options |
RepositoryHook
s matching the supplied typeReturns 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 |
---|
This method is deprecated.
in 5.2 for removal in 6.0. Use getByKey(Scope, String)
instead.
Find an installed hook with the specified key enabled status for this repository
repository | the repository to load the hook from |
---|---|
hookKey | the hook to lookup |
RepositoryHook
if found. Otherwise null
.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.
This method is deprecated.
in 5.2 for removal in 6.0. Use getSettings(GetRepositoryHookSettingsRequest)
instead.
Gets the settings for the specified hook and repository.
repository | the repository the settings apply to. |
---|---|
hookKey | the complete module key of the hook which the settings are associated with. |
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 type
This method is deprecated.
in 5.2 for removal in 6.0. Use setSettings(SetRepositoryHookSettingsRequest)
instead.
Sets the settings for the specified hook and repository.
repository | the repository the settings apply to. |
---|---|
hookKey | the complete module key of the hook which the settings are associated with. |
settings | the new settings to save |
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. |
Sets 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. |