Class PostRepositoryHookContext
java.lang.Object
com.atlassian.bitbucket.hook.repository.RepositoryHookContext
com.atlassian.bitbucket.hook.repository.PostRepositoryHookContext
RepositoryHookContext
specialization that is provided to PostRepositoryHook
hooks- Since:
- 5.0
-
Constructor Summary
ModifierConstructorDescriptionprotected
PostRepositoryHookContext
(com.atlassian.bitbucket.setting.Settings settings, boolean synchronous) -
Method Summary
Modifier and TypeMethodDescriptionboolean
abstract boolean
registerCommitCallback
(RepositoryHookCommitCallback 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
-
PostRepositoryHookContext
protected PostRepositoryHookContext(@Nonnull com.atlassian.bitbucket.setting.Settings settings, boolean synchronous)
-
-
Method Details
-
isSynchronous
public boolean isSynchronous()- Returns:
true
if the hook is invoked synchronously, for instance as part of apush
to the repository. Only hooks annotated withSynchronousPreferred
will be invoked synchronously.- See Also:
-
registerCommitCallback
public abstract boolean registerCommitCallback(@Nonnull RepositoryHookCommitCallback callback, @Nonnull RepositoryHookCommitFilter filter, @Nullable RepositoryHookCommitFilter... moreFilters) Registers a callback to receive more information about commits added or removed. See the documentation onRepositoryHookCommitCallback
for details about when the callback methods are called.- 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
-