Package org.apache.juneau.console.views
Class TerminalViewPage
java.lang.Object
org.apache.juneau.console.views.TerminalViewPage
One page of a terminal-view event stream: the envelope the events endpoint returns and the client polls.
The wire form is
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe contract version carried by every page.static final intThe maximum serialized size of the events in one page.static final intThe maximum number of events in one page. -
Method Summary
Modifier and TypeMethodDescriptionevents()Returns the events.booleanmore()Returns whether the source holds further events right now.next()Returns the continuation token.static TerminalViewPageof(List<TerminalEvent> events, String next, boolean more, boolean terminal) Creates a page.booleanterminal()Returns whether the source will never produce another event.Returns the page in its wire form.validate()Validates the page: ascending numbered events, the token grammar, and the size caps.
-
Field Details
-
CONTRACT_VERSION
The contract version carried by every page.- See Also:
-
MAX_PAGE_EVENTS
The maximum number of events in one page.- See Also:
-
MAX_PAGE_CHARS
The maximum serialized size of the events in one page.- See Also:
-
-
Method Details
-
of
public static TerminalViewPage of(List<TerminalEvent> events, String next, boolean more, boolean terminal) Creates a page.- Parameters:
events- The events, in ascendingseq . 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
Returns the continuation token.- Returns:
- The token.
-
more
Returns whether the source holds further events right now.- Returns:
true if so.
-
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 .
-