Interface TerminalMixin
- All Known Implementing Classes:
JobsRest
public interface TerminalMixin
Mixin interface that serves the terminal bytes and raw endpoints, plus this module's own JS and CSS.
The one abstract method is the application's resolver, which is where authorization lives: an unknown id and a
forbidden id both answer 404. Ids match ^[A-Za-z0-9_-]{1,128}$; anything else answers 400
before the resolver runs. The mixin adds no auth of its own; the host resource's guards apply.
Step events are not served here: pair the terminal with TerminalViewMixin over the same id.
Example:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe URL path template of the bytes endpoint.static final StringThe URL path of the terminal stylesheet.static final StringThe URL path of the terminal runtime.static final StringThe URL path template of the raw download.static final StringThe URL path prefix of the terminal endpoints (relative to the host mount).static final StringTheWebJarResolverasset id of the xterm.js stylesheet.static final StringTheWebJarResolverasset id of the xterm.js UMD bundle. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringterminalAssetUrl(RestRequest req, String path) The absolute URL of a terminal asset; the toolkit pack resolver for theterminalpack.default voidterminalBytes(String id, RestRequest req, RestResponse res) [GET /juneau-terminal/{id}/bytes] — raw bytes from an offset.default voidterminalRaw(String id, RestRequest req, RestResponse res) [GET /juneau-terminal/{id}/raw] — the whole log as an attachment.default HttpResource[GET /juneau-terminal.js] — the terminal runtime.terminalSource(String id, RestRequest req) Resolves the source for a terminal id, applying the application's own access rules.default HttpResource[GET /juneau-terminal.css] — the terminal stylesheet.
-
Field Details
-
TERMINAL_PREFIX
The URL path prefix of the terminal endpoints (relative to the host mount).- See Also:
-
BYTES_PATH
The URL path template of the bytes endpoint.- See Also:
-
RAW_PATH
The URL path template of the raw download.- See Also:
-
JS_PATH
The URL path of the terminal runtime.- See Also:
-
CSS_PATH
The URL path of the terminal stylesheet.- See Also:
-
XTERM_JS_ASSET
TheWebJarResolverasset id of the xterm.js UMD bundle.- See Also:
-
XTERM_CSS_ASSET
TheWebJarResolverasset id of the xterm.js stylesheet.- See Also:
-
-
Method Details
-
terminalSource
Resolves the source for a terminal id, applying the application's own access rules.- Parameters:
id- The id from the URL path (already checked against the grammar).req- The in-flight request.- Returns:
- The source, or empty when the id is unknown or the caller may not read it.
-
terminalBytes
default void terminalBytes(@Path("id") String id, RestRequest req, RestResponse res) throws IOException [GET /juneau-terminal/{id}/bytes] — raw bytes from an offset.- Parameters:
id- The terminal id.req- The request.res- The response.- Throws:
IOException- If the response could not be written.
-
terminalRaw
default void terminalRaw(@Path("id") String id, RestRequest req, RestResponse res) throws IOException [GET /juneau-terminal/{id}/raw] — the whole log as an attachment.- Parameters:
id- The terminal id.req- The request.res- The response.- Throws:
IOException- If the response could not be written.
-
terminalScript
[GET /juneau-terminal.js] — the terminal runtime.- Returns:
- The script.
-
terminalStylesheet
[GET /juneau-terminal.css] — the terminal stylesheet.- Returns:
- The stylesheet.
-
terminalAssetUrl
The absolute URL of a terminal asset; the toolkit pack resolver for theterminalpack.
-