Interface RefCallback

All Known Implementing Classes:
AbstractRefCallback
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RefCallback
A callback for streaming refs.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    onEnd(RefSummary summary)
    Called after the final ref has been streamed.
    boolean
    onRef(Ref ref)
    Called to process a ref.
    default void
    Called before the first ref is streamed.
  • Method Details

    • onEnd

      default void onEnd(@Nonnull RefSummary summary) throws IOException
      Called after the final ref has been streamed.

      Note: If there were no refs, this method may be called immediately after onStart(RefContext) without any calls to onRef(Ref).

      Parameters:
      summary - summarizes the request and the streamed refs
      Throws:
      IOException - may be thrown by implementations which perform I/O.
    • onRef

      boolean onRef(@Nonnull Ref ref) throws IOException
      Called to process a ref.
      Parameters:
      ref - the ref to stream
      Returns:
      true if further refs should be streamed; otherwise, false to stop streaming
      Throws:
      IOException - may be thrown by implementations which perform I/O.
    • onStart

      default void onStart(@Nonnull RefContext context) throws IOException
      Called before the first ref is streamed.
      Parameters:
      context - provides details about the request for which refs are being streamed
      Throws:
      IOException - may be thrown by implementations which perform I/O.