Class PreRepositoryHookContext
java.lang.Object
com.atlassian.bitbucket.hook.repository.RepositoryHookContext
com.atlassian.bitbucket.hook.repository.PreRepositoryHookContext
RepositoryHookContext
specialization that is provided to PreRepositoryHook
hooks- Since:
- 5.0
-
Constructor Summary
ModifierConstructorDescriptionprotected
PreRepositoryHookContext
(com.atlassian.bitbucket.setting.Settings settings) -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
registerCommitCallback
(PreRepositoryHookCommitCallback callback, RepositoryHookCommitFilter filter, RepositoryHookCommitFilter... moreFilters) Registers a callback to receive more information about commits added or removed.Methods inherited from class com.atlassian.bitbucket.hook.repository.RepositoryHookContext
getSettings
-
Constructor Details
-
PreRepositoryHookContext
protected PreRepositoryHookContext(@Nonnull com.atlassian.bitbucket.setting.Settings settings)
-
-
Method Details
-
registerCommitCallback
public abstract boolean registerCommitCallback(@Nonnull PreRepositoryHookCommitCallback callback, @Nonnull RepositoryHookCommitFilter filter, @Nullable RepositoryHookCommitFilter... moreFilters) Registers a callback to receive more information about commits added or removed. See the documentation onPreRepositoryHookCommitCallback
for details about when the callback methods are called.Note: hooks may only register callbacks during
PreRepositoryHook.preUpdate(PreRepositoryHookContext, RepositoryHookRequest)
. If a callback is registered at any other time,false
is returned and the callback is ignored.- Parameters:
callback
- the callbackfilter
- the type of commit details the callback is interested inmoreFilters
- other types of commit details the callback is interested in- Returns:
true
if the callback was successfully registered, otherwisefalse
. Iffalse
is returned here, the callback will not be called
-