public interface

RepositoryRefsChangedEvent

com.atlassian.bitbucket.event.repository.RepositoryRefsChangedEvent
Known Indirect Subclasses

Class Overview

Interface for events that are published when changes are made to a repository.

RepositoryRefsChangedEvent listeners will be notified when any sub-events are published. As a result, listening for this event is the best way to be aware of repository changes.

Summary

Public Methods
@Nonnull Collection<RefChange> getRefChanges()
Retrieves a collection of the changed refs.
@Nonnull Repository getRepository()
Retrieves the repository in which refs were changed.
@Nullable ApplicationUser getUser()
Retrieves the user who triggered the ref changes, if available.

Public Methods

@Nonnull public Collection<RefChange> getRefChanges ()

Retrieves a collection of the changed refs.

Note: While the returned collection will never be null, it may be empty. For example, a remotely merged pull request will have an empty set of changes.

Returns
  • a collection containing 0 or more changed refs

@Nonnull public Repository getRepository ()

Retrieves the repository in which refs were changed. All of the changed refs for a single event will always be in the same repository.

Returns
  • the repository containing the changed refs

@Nullable public ApplicationUser getUser ()

Retrieves the user who triggered the ref changes, if available.

In most contexts, the user will be set. However, some changes may happen in contexts where no context user is available. For example, custom plugins may perform automated processing outside of a user context and raise change events based on the processing performed. Callers are encouraged to check for and handle the case where there is no user available.

Returns
  • the triggering user, or null if the change happened due to background processing or in another context where no user is available