@FunctionalInterface public interface CommitCallback
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.
AbstractCommitCallback
Modifier and Type | Method and Description |
---|---|
boolean |
onCommit(Commit commit)
Receives a fully-populated
commit for processing. |
default void |
onEnd(CommitSummary summary)
Called after the final
commit has been streamed. |
default void |
onStart(CommitContext context)
Called before the first
commit is streamed. |
boolean onCommit(@Nonnull Commit commit) throws IOException
commit
for processing.
This method will never be invoked before onStart(CommitContext)
, and if it is invoked
onEnd(CommitSummary)
is guaranteed to be invoked, whether the end happens because this
method returns false
or because the upstream sender runs out of commits.
commit
- the committrue
if more commits should be provided; otherwise false
to end streaming,
potentially leaving some number of commits unreadIOException
- for implementations which perform I/Odefault void onEnd(@Nonnull CommitSummary summary) throws IOException
commit
has been streamed.
Note: If there were no commits, this method may be called immediately after onStart(CommitContext)
without any calls to onCommit(Commit)
.
summary
- summarizes the request and the streamed commitsIOException
- for implementations which perform I/Odefault void onStart(@Nonnull CommitContext context) throws IOException
commit
is streamed.context
- provides details about the request for which commits are being streamedIOException
- for implementations which perform I/OCopyright © 2022 Atlassian. All rights reserved.