Node

@Serializable
data class Node(val id: String, val parent: String, val host: String, val type: KrillApp, val state: NodeState = NodeState.NONE, val meta: NodeMetaData, val timestamp: Long = 0)(source)

A single node in a Krill swarm.

Constructors

Link copied to clipboard
constructor(id: String, parent: String, host: String, type: KrillApp, state: NodeState = NodeState.NONE, meta: NodeMetaData, timestamp: Long = 0)

Properties

Link copied to clipboard

UUID of the server hosting this node.

Link copied to clipboard
val id: String

Stable per-node UUID, unique within host.

Link copied to clipboard

Polymorphic metadata payload; the concrete subtype matches type.

Link copied to clipboard

UUID of the parent node — for top-level nodes, equals their own id.

Link copied to clipboard

Lifecycle / status — see NodeState. Defaults to NONE.

Link copied to clipboard

Producer-supplied epoch millis used for ordering and snapshot keys.

Link copied to clipboard

Type discriminator — selects the concrete shape of meta.

Functions

Link copied to clipboard

Renders a debug-friendly one-liner of the node — used in log lines to give the timestamp / type / display name / state in a compact form.

Link copied to clipboard
fun Node.https(): Url

Returns the canonical https://<resolvedHost>:<port> Url for a server node. Throws IllegalArgumentException with a diagnostic message when meta is not a ServerMetaData — prefer calling this only on nodes whose type is KrillApp.Server.

Link copied to clipboard

Returns this node's address pair — (nodeId, hostId) — as a NodeIdentity suitable for use inside SourceMetaData source / target lists.

Link copied to clipboard

true when this node's value is inherently boolean / digital. Delegates to NodeMetaData.isDigital.

Link copied to clipboard
fun Node.key(): String

Renders the node as a "<timestamp>:<id>" key. Used as a stable cache / comparison key in places where (timestamp, id) tuples need to be compared by value rather than by structural equality of the full node.

Link copied to clipboard

Returns the human-readable display name for the node. Delegates to NodeMetaData.displayName; when that returns empty, falls back to the node's KrillApp type string (the desired behaviour for MenuCommand entries and any subtype with no dedicated name field).

Link copied to clipboard

For a DataPoint whose DataType is COLOR, returns the snapshot value parsed as a packed ARGB Long (0xFFRRGGBB). For any other node type or an unparseable value, returns opaque black (0xFF000000) so callers can unconditionally render the result without null-checking.