Interface ConsoleCommand
public interface ConsoleCommand
The command-and-control extension point: one operator action the console can
execute against the fleet. This is the command-side sibling of
ConsolePanel (which is read-only). An application registers commands
to give operators typed actions, dispatching a task into a space, triggering
a key rotation, invoking a capability, and the console renders a form from
fields() and executes execute(Map, CommandContext) on submit.
Every command runs under the console peer's own fabric identity: the
entries a command writes are signed and leased by the console peer, and the
CommandContext.operator() name travels as attribution. The HTTP layer
authenticates the operator (a bearer token) before any command runs; a
command implementation never sees an unauthenticated request. Under Spring
Boot, every ConsoleCommand bean is registered automatically.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA form field the console renders for a command's input.static final recordThe result of executing a command. -
Method Summary
Modifier and TypeMethodDescriptiondefault StringAn optional one-line description of what the command does.execute(Map<String, String> args, CommandContext ctx) Executes the command.default List<ConsoleCommand.Field> fields()The input fields the operator fills in, rendered as a form.id()The command's stable identifier, used in its execution URL.title()The command's title, shown on the UI.
-
Method Details
-
id
String id()The command's stable identifier, used in its execution URL. Lowercase words joined by dashes by convention, unique per console.- Returns:
- the identifier
-
title
-
description
An optional one-line description of what the command does.- Returns:
- the description, or the empty string
-
fields
The input fields the operator fills in, rendered as a form.- Returns:
- the fields, possibly empty for a no-argument command
-
execute
Executes the command. Runs on an authenticated request, under the console peer's identity.- Parameters:
args- the submitted field values, keyed byConsoleCommand.Field.name()ctx- the command context (operator, dispatch, cancel, broadcast, audit)- Returns:
- the outcome
-