com.atlassian.bitbucket.hook.repository.RepositoryHookCommitCallback |
Known Indirect Subclasses |
A callback to receive more information about commits added or removed in a RepositoryHookRequest. The callback will be called for each each relevant (ref, commit) pair:
added
refs, only new commits are
provided to onCommitAdded(CommitAddedDetails)
. For new refs that point
to existing commits, no commits are provided to the callback.
deleted
refs, only commits that are
removed from the repository (orphaned) are provided
onCommitRemoved(CommitRemovedDetails)
.
updated
refs, all commits that are
added or removed to that ref are provided to the callback.
onCommitAdded(CommitAddedDetails)
is called for both branch B and C.
The system will call onStart()
before the first commit details are provided to the callback to allow the
hook to initialize. Likewise, the system calls onEnd()
after the last commit details have been provided
to the callback. This can be because all commit details have been provided, the callback has returned false
from one of the callback methods to instruct the system that it's done processing commits, or - in the case of
pre-hooks
- because the request has been vetoed and no further commit processing will be
done.
If a RepositoryHookRequest is vetoed in
preUpdate(PreRepositoryHookContext, RepositoryHookRequest)
before commit details are
retrieved, callbacks will not be called at all; the onStart()
and onEnd()
methods will not be
called. However, if the onStart()
method is called, the system will also call the onEnd()
method
at the end of processing.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Callback method that is called after all commits have been offered to the callback.
| |||||||||||
Callback method that is called before the commits details are provided to
onCommitAdded(CommitAddedDetails) and onCommitRemoved(CommitRemovedDetails)
|
commitDetails | the commit details |
---|
true
if the callback wants to receive details about added and removed commits.
Otherwise false
. When this method returns false
, neither this method nor
onCommitRemoved(CommitRemovedDetails)
will be called with further commit details.
commitDetails | the commit details |
---|
true
if the callback wants to receive details about added and removed commits.
Otherwise false
. When this method returns false
, neither this method nor
onCommitAdded(CommitAddedDetails)
will be called with further commit details.
Callback method that is called after all commits have been offered to the callback. The callback can perform
any cleanup operations here. If onStart()
has been called, this method is guaranteed to be called
when the callback has finished commit processing.
Callback method that is called before the commits details are provided to
onCommitAdded(CommitAddedDetails)
and onCommitRemoved(CommitRemovedDetails)