Interface ChangeCallback
- All Known Implementing Classes:
AbstractChangeCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
changes.
Implementations of this callback performing internal paging may return false from onChange(Change)
to indicate no more changes are desired. Such implementations are encouraged to also implement the
PagedCallback interface to allow the system to optimise output
handling, where possible, based on the page being requested.
Note: Implementors are strongly encouraged to extend from AbstractChangeCallback. 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 TypeMethodDescriptionbooleanProvides achangeto the callback for processing.default voidonEnd(ChangeSummary summary) Called after the finalchangehas been streamed.default voidonStart(ChangeContext context) Called before the firstchangeis streamed.
-
Method Details
-
onChange
Provides achangeto the callback for processing.If the callback is performing internal paging, it may signal the end of the page by returning
falsehere. When doing so,onEnd(ChangeSummary)will never receivetruefor truncation.- Parameters:
change- the change to process- Returns:
trueif additional changes should be provided; otherwise,falseif the callback has received as many changes as desired- Throws:
IOException- may be thrown by implementations which perform I/O
-
onEnd
Called after the finalchangehas been streamed.Note: If there were no changes, this method may be called immediately after
onStart(ChangeContext)without any calls toonChange(Change).- Parameters:
summary- summarizes the request and the streamed changes- Throws:
IOException- may be thrown by implementations which perform I/O.
-
onStart
Called before the firstchangeis streamed.- Parameters:
context- provides details about the request for which changes are being streamed- Throws:
IOException- may be thrown by implementations which perform I/O.
-