StaticclearClears the singleton and resets it for re-initialization. Rejects all pending requests, unsubscribes shadow wildcard topics and request-response topics, then drops transport and in-memory state.
StaticgetReturns the current initialization generation. Increments on each initialize. Used by subscription channels to detect a logout→login reset and re-attach stale listeners.
StaticgetStaticgetNumber of registered nodes (for debugging). Returns 0 if not initialized.
StaticgetStaticinitializeInitializes the orchestrator with an MQTT transport. Must be called before any other method.
MQTT transport for publish/subscribe.
If already initialized. Call clear first if you truly need to re-init — a silent swap would leave stale in-memory subscriptions pointing at topics that were never subscribed on the new transport.
StaticisChecks if a node is registered. Returns false if the orchestrator has
not been initialized at all (safe read-only check, matches
getRegisteredNodeCount — the mutating methods throw instead).
The device/node identifier.
StaticregisterRegisters a node with the orchestrator. Must be called before subscribeToNode, getParams, getShadow, etc. On shadow rename: clears the old binding, then installs the new name (including shrinks to a shorter membership shadow).
The device/node identifier.
The named shadow (e.g. params-groupId-subgroupId).
StaticresetSoft-resets session-scoped state without dropping the singleton. Called
from ESPRMNeoUser.logout so the orchestrator is ready for the
next login without a public re-initialize step. Rejects pending requests,
clears shadow listeners, drops node registrations, and bumps
_generation so subscription channels detect the reset and
re-attach on next login. Keeps transport, initialized, and
_instance intact so getInstance() continues to work.
StaticsetPublishes parameters to the group control MQTT topic (fan-out to all
devices in the group or in one subgroup). Does not require a registered
node; only a connected MQTT transport (same credentials as unicast
setParams).
Primary group id.
Same payload shape as NodeMQTTOrchestrator.setParams.
OptionalsubgroupId: stringOmit for group-wide broadcast; set to target one subgroup.
StaticsetSets params via the RainMaker user params topic (unicast: single node).
The device/node identifier.
Parameter payload (often { <deviceId>: { <paramId>: value } }).
StaticsubscribeSubscribes to node param updates. Deduplicates MQTT subscriptions by shadow.
The device/node identifier.
Callback invoked when shadow update/accepted is received.
StaticunregisterUnregisters a node. Removes from nodeMap and cleans up listeners. Unsubscribes from shadow topic if no other nodes use it.
The device/node identifier.
StaticunsubscribeUnsubscribes a callback from a node.
In-memory listener removal happens even if MQTT is disconnected —
otherwise on reconnect the orchestrator would fan messages out to a stale
listener (per-disconnect leak). The network topic-unsubscribe inside
cleanupSubscriptionIfIdle is best-effort and tolerates a missing
connection.
The device/node identifier.
The callback to remove.
Staticupdate
NodeMQTTOrchestrator - Central MQTT orchestration layer for AWS IoT Device Shadow.
Design principles: