Package com.atlassian.bitbucket.commit
Interface CommitCallback
- All Known Implementing Classes:
AbstractCommitCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Describes a callback for receiving a stream of
commits.
Note: Implementors are strongly encouraged to extend from AbstractCommitCallback. This interface
will change over time, and any class implementing it directly will be broken by such changes. Extending
from the abstract class will help prevent such breakages.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReceives a fully-populatedcommitfor processing.default voidonEnd(CommitSummary summary) Called after the finalcommithas been streamed.default voidonStart(CommitContext context) Called before the firstcommitis streamed.
-
Method Details
-
onCommit
Receives a fully-populatedcommitfor processing.This method will never be invoked before
onStart(CommitContext), and if it is invokedonEnd(CommitSummary)is guaranteed to be invoked, whether the end happens because this method returnsfalseor because the upstream sender runs out of commits.- Parameters:
commit- the commit- Returns:
trueif more commits should be provided; otherwisefalseto end streaming, potentially leaving some number of commits unread- Throws:
IOException- for implementations which perform I/O
-
onEnd
Called after the finalcommithas been streamed.Note: If there were no commits, this method may be called immediately after
onStart(CommitContext)without any calls toonCommit(Commit).- Parameters:
summary- summarizes the request and the streamed commits- Throws:
IOException- for implementations which perform I/O
-
onStart
Called before the firstcommitis streamed.- Parameters:
context- provides details about the request for which commits are being streamed- Throws:
IOException- for implementations which perform I/O
-