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
ConstructorsModifierConstructorDescriptionprotectedPreRepositoryHookContext(com.atlassian.bitbucket.setting.Settings settings) -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanregisterCommitCallback(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 onPreRepositoryHookCommitCallbackfor 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,falseis 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:
trueif the callback was successfully registered, otherwisefalse. Iffalseis returned here, the callback will not be called
-