NodeDescriptor class

The public description of a node: identity, advertised capabilities, labels, free-form metadata, agent version and liveness status.

This is what a node announces on registration and what discovery queries return. Immutable; use copyWith to derive updated descriptors.

Constructors

NodeDescriptor({required NodeId id, Set<String> capabilities = const {}, Map<String, String> labels = const {}, Map<String, String> metadata = const {}, Map<String, dynamic> attributes = const {}, String agentVersion = 'unknown', NodeStatus status = NodeStatus.unknown})
Creates a descriptor. Collections are copied into unmodifiable views.
NodeDescriptor.fromJson(Map<String, dynamic> json)
Parses a descriptor from a JSON map.
factory

Properties

agentVersion → String
The node agent's version string.
final
attributes → Map<String, dynamic>
Structured, JSON-typed application data the node advertises (e.g. a nested service catalogue, an organisation id, a public key).
final
capabilities → Set<String>
Capability tokens the node advertises (e.g. transcode, gpu).
final
hashCode → int
The hash code for this object.
no setterinherited
id → NodeId
The node's id.
final
labels → Map<String, String>
Key/value labels used for discovery filtering (e.g. region=eu).
final
metadata → Map<String, String>
Additional free-form metadata (not used for filtering).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status → NodeStatus
The node's liveness status (maintained hub-side).
final

Methods

copyWith({Set<String>? capabilities, Map<String, String>? labels, Map<String, String>? metadata, Map<String, dynamic>? attributes, String? agentVersion, NodeStatus? status}) → NodeDescriptor
Returns a copy with the given fields replaced.
hasCapability(String capability) → bool
Whether the node advertises capability.
matchesLabels(Map<String, String> filter) → bool
Whether the node's labels contain every entry in filter.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serialises the descriptor to a JSON map.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited