public interface

PluginHookHandlerFactory

com.atlassian.bitbucket.scm.hook.PluginHookHandlerFactory

Summary

Public Methods
@Nullable HookHandler create(Repository repository, HookRequest hookRequest)
Creates the SCM specific handler for the SCM hook callback
@Nonnull Collection<RefChange> peelRefChanges(Repository repository, Collection<RefChange> refChanges)
Peels the from and to hashes on the provided RefChanges, ensuring they reference commits.

Public Methods

@Nullable public HookHandler create (Repository repository, HookRequest hookRequest)

Creates the SCM specific handler for the SCM hook callback

Parameters
repository the repository
hookRequest the hook request
Returns
  • the hook handler, if the SCM supports the requested hook

@Nonnull public Collection<RefChange> peelRefChanges (Repository repository, Collection<RefChange> refChanges)

Peels the from and to hashes on the provided RefChanges, ensuring they reference commits. For branches and lightweight tags, the resulting RefChanges are unchanged. For annotated tags, the hashes on the returned RefChange will be the ID of the commit that the tag references.

The default implementation returns the provided RefChanges unchanged, which may be appropriate for some SCMs.

Parameters
repository the repository
refChanges the ref changes to resolve
Returns
  • the resolved ref changes