Class GitPullRequestRefsChangedEvent

java.lang.Object
java.util.EventObject
com.atlassian.bitbucket.event.ApplicationEvent
com.atlassian.bitbucket.scm.git.event.GitPullRequestRefsChangedEvent
All Implemented Interfaces:
Serializable

@AsynchronousPreferred public class GitPullRequestRefsChangedEvent extends com.atlassian.bitbucket.event.ApplicationEvent
The Git plugin creates and maintains refs for each pull request. When a pull request is rescoped (either the 'from' or the 'to' branch is updated) the pull request refs are not updated immediately. Often a merge operation will need to be performed to determine the new diff. Merges can be slow and for this reason, pull requests refs are updated asynchronously. When this happens a GitPullRequestRefsChangedEvent is raised.
See Also:
  • Constructor Details

    • GitPullRequestRefsChangedEvent

      public GitPullRequestRefsChangedEvent(@Nonnull Object source, @Nonnull com.atlassian.bitbucket.repository.Repository repository, long pullRequestId, @Nullable com.atlassian.bitbucket.repository.RefChange fromRefChange, @Nullable com.atlassian.bitbucket.repository.RefChange mergeRefChange)
      Since:
      9.0
  • Method Details

    • getFromRefChange

      @Nullable public com.atlassian.bitbucket.repository.RefChange getFromRefChange()
      Returns:
      the ref change describing how the /pull-requests/id/from ref has changed. null if the ref did not change
    • getMergeRefChange

      @Nullable public com.atlassian.bitbucket.repository.RefChange getMergeRefChange()
      Returns:
      the ref change describing how the /pull-requests/id/merge ref has changed. null if the ref did not change
    • getPullRequestId

      public long getPullRequestId()
      Returns:
      the ID of the pull request for which the ref(s) were updated
      Since:
      9.0
    • getRepository

      @Nonnull public com.atlassian.bitbucket.repository.Repository getRepository()
      Returns:
      the target repository of the pull request
    • hasFromRefChanged

      public boolean hasFromRefChanged()
      Returns:
      true if the /pull-requests/id/from ref has changed
    • hasMergeRefChanged

      public boolean hasMergeRefChanged()
      Returns:
      true if the /pull-requests/id/merge ref has changed