Package org.apache.juneau.console.views
Class TerminalViewEndpoints
java.lang.Object
org.apache.juneau.console.views.TerminalViewEndpoints
Static helpers that implement the terminal-view events endpoint.
TerminalViewMixin delegates to these; an application that wants its own path writes one @RestGet
method that calls events(Optional, RestRequest, RestResponse) and gets the same validation, cap and
headers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe page size cap of the bundled endpoint. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcheckRunId(String runId) Checks a mixinrunIdagainst^[A-Za-z0-9_-]{1,128}$.static voidevents(Optional<TerminalViewSource> source, RestRequest req, RestResponse res) Serves one page of the events endpoint (?after=) as JSON.
-
Field Details
-
MAX_ENDPOINT_PAGE_EVENTS
The page size cap of the bundled endpoint.- See Also:
-
-
Method Details
-
checkRunId
Checks a mixinrunIdagainst^[A-Za-z0-9_-]{1,128}$.- Parameters:
runId- The run id from the URL path.- Returns:
- The same id.
- Throws:
BadRequest- If the id does not match.
-
events
public static void events(Optional<TerminalViewSource> source, RestRequest req, RestResponse res) throws IOException Serves one page of the events endpoint (?after=) as JSON.Answers
404for an empty source,400for a malformedafter,410 Gonefor an unknown or stale token, and otherwise200withCache-Control: no-store.- Parameters:
source- The resolved source; empty answers404.req- The request.res- The response.- Throws:
IOException- If the response could not be written.
-