Class TerminalDef
java.lang.Object
org.apache.juneau.terminal.region.TerminalDef
The options of a
terminal card: where its bytes and (optionally) its step events come from.
Example:
TerminalDef
- Since:
- 10.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe bytes endpoint path.static final longThe tail the card replays on its first load whentailBytesis not set: 2 MiB.The terminal-view events endpoint path, ornull for no steps.final StringThe card id.Whether the card lets the user type into the job; needsinputId.The terminal id sent as the payloadidof aterm.inputframe.The keysfromMap(String, Map)accepts, intoMap()order.static final intThe largestterminal.scrollback, in lines.static final longThe largesttailBytes: 1 GiB.The poll interval; clamped toTerminalViewChecks.MIN_REFRESH_MS.The most bytes replayed on the first load.The xterm options passed to the client terminal, limited toTERMINAL_KEYS;null for none.The keys theterminaloption map accepts, intoMap()order; they match the client-side xterm allowlist.The card header title. -
Method Summary
Modifier and TypeMethodDescriptionstatic TerminalDefCreates a declaration.static TerminalDefstatic TerminalDefCreates a declaration from a parsed map (the console-ui card body).input(boolean value) refreshMs(long value) tailBytes(long value) toMap()Returns the set options inKEYSorder, withrefreshMsclamped.validate()Validates this declaration (fail-closed).
-
Field Details
-
KEYS
The keysfromMap(String, Map)accepts, intoMap()order. -
TERMINAL_KEYS
The keys theterminaloption map accepts, intoMap()order; they match the client-side xterm allowlist. -
MAX_SCROLLBACK
The largestterminal.scrollback, in lines.- See Also:
-
DEFAULT_TAIL_BYTES
The tail the card replays on its first load whentailBytesis not set: 2 MiB.- See Also:
-
MAX_TAIL_BYTES
The largesttailBytes: 1 GiB.- See Also:
-
id
The card id. -
bytesUrl
The bytes endpoint path. -
eventsUrl
The terminal-view events endpoint path, ornull for no steps. -
refreshMs
The poll interval; clamped toTerminalViewChecks.MIN_REFRESH_MS. -
title
The card header title. -
tailBytes
The most bytes replayed on the first load. -
input
Whether the card lets the user type into the job; needsinputId. -
inputId
The terminal id sent as the payloadidof aterm.inputframe. -
terminal
The xterm options passed to the client terminal, limited toTERMINAL_KEYS;null for none.
-
-
Method Details
-
create
Creates a declaration.- Parameters:
id- The card id.- Returns:
- A new declaration.
-
forMixin
- Parameters:
id- The card id.mountPath- The resource mount path, for example"/runs".terminalId- The terminal id; must match[A-Za-z0-9_-]{1,128}.- Returns:
- A new declaration.
-
fromMap
Creates a declaration from a parsed map (the console-ui card body).- Parameters:
id- The card id.map- Theterminalobject; keys must be a subset ofKEYS.- Returns:
- A new declaration (not yet validated).
-
bytesUrl
- Parameters:
value- The bytes endpoint path. @return This object.
-
eventsUrl
- Parameters:
value- The terminal-view events endpoint path. @return This object.
-
refreshMs
- Parameters:
value- The poll interval; clamped toTerminalViewChecks.MIN_REFRESH_MS. @return This object.
-
title
- Parameters:
value- The card header title. @return This object.
-
tailBytes
- Parameters:
value- The most bytes replayed on the first load, 1..1073741824L. @return This object.
-
input
- Parameters:
value- Whether the card lets the user type into the job. @return This object.
-
inputId
- Parameters:
value- The terminal id sent as theterm.inputpayloadid. @return This object.
-
terminal
- Parameters:
value- The xterm options, a map ofconvertEol(boolean),scrollback(integer 0..1000000) andfontFamily(non-empty string); checked byvalidate().- Returns:
- This object.
-
validate
Validates this declaration (fail-closed).- Returns:
- This object.
- Throws:
IllegalArgumentException- If a rule is broken.
-
toMap
Returns the set options inKEYSorder, withrefreshMsclamped.- Returns:
- A new ordered map.
- Throws:
IllegalArgumentException- If theterminaloptions are invalid.
-