Class TerminalViewPage

java.lang.Object
org.apache.juneau.console.views.TerminalViewPage

public final class TerminalViewPage extends Object
One page of a terminal-view event stream: the envelope the events endpoint returns and the client polls.

The wire form is {contractVersion, events, next, more, terminal}. A page with no events still carries next.

  • Field Details

  • Method Details

    • of

      public static TerminalViewPage of(List<TerminalEvent> events, String next, boolean more, boolean terminal)
      Creates a page.
      Parameters:
      events - The events, in ascending seq. Copied defensively.
      next - The continuation token.
      more - Whether the source holds further events right now.
      terminal - Whether the source will never produce another event.
      Returns:
      A new page. Call validate() before sending it.
    • events

      Returns the events.
      Returns:
      An unmodifiable list.
    • next

      public String next()
      Returns the continuation token.
      Returns:
      The token.
    • more

      public boolean more()
      Returns whether the source holds further events right now.
      Returns:
      true if so.
    • terminal

      public boolean terminal()
      Returns whether the source will never produce another event.
      Returns:
      true if so.
    • validate

      Validates the page: ascending numbered events, the token grammar, and the size caps.
      Returns:
      This object.
      Throws:
      IllegalArgumentException - If the page is not valid.
    • toContractMap

      Returns the page in its wire form.
      Returns:
      An ordered map: contractVersion, events, next, more, terminal.