VTN-side entity coercion and notification payload construction.
Leverages clj-oa3's openadr3.entities for raw→coerced entity coercion. Provides additional helpers for building outbound notification payloads (the reverse direction: coerced/stored objects → wire-format notifications).
VTN-side entity coercion and notification payload construction. Leverages clj-oa3's openadr3.entities for raw→coerced entity coercion. Provides additional helpers for building outbound notification payloads (the reverse direction: coerced/stored objects → wire-format notifications).
Coerce a raw camelCase API map to a namespaced entity. Dispatches on :objectType ("PROGRAM", "EVENT", etc.).
Coerce a raw camelCase API map to a namespaced entity.
Dispatches on :objectType ("PROGRAM", "EVENT", etc.).(coerce-stored stored-object)Coerce a stored storage-canon object into a namespaced entity for VTN internal logic. Bridges from the VTN's ZDT/Duration shape to clj-oa3's string-bearing input form before delegating to entities/coerce.
Coerce a stored storage-canon object into a namespaced entity for VTN internal logic. Bridges from the VTN's ZDT/Duration shape to clj-oa3's string-bearing input form before delegating to entities/coerce.
(coerce-stored-events events)Coerce a sequence of stored event maps.
Coerce a sequence of stored event maps.
(coerce-stored-programs programs)Coerce a sequence of stored program maps.
Coerce a sequence of stored program maps.
(coerce-stored-subscriptions subscriptions)Coerce a sequence of stored subscription maps.
Coerce a sequence of stored subscription maps.
(notification-payload object-type operation object)Build a wire-format notification map suitable for MQTT publishing.
Takes: object-type — string, e.g. "PROGRAM", "EVENT" operation — string, e.g. "CREATE", "UPDATE", "DELETE" object — the storage-canon entity (ZDT-bearing)
Returns a map matching the OpenADR notification schema: {:objectType "PROGRAM" :operation "CREATE" :object {... entity with ZDT/Duration fields ...}}
ZDTs and Durations are serialised to canonical UTC Z / ISO 8601 by the JSONWriter protocol extension when the payload is JSON-encoded for the wire.
Build a wire-format notification map suitable for MQTT publishing.
Takes:
object-type — string, e.g. "PROGRAM", "EVENT"
operation — string, e.g. "CREATE", "UPDATE", "DELETE"
object — the storage-canon entity (ZDT-bearing)
Returns a map matching the OpenADR notification schema:
{:objectType "PROGRAM"
:operation "CREATE"
:object {... entity with ZDT/Duration fields ...}}
ZDTs and Durations are serialised to canonical UTC Z / ISO 8601 by the
JSONWriter protocol extension when the payload is JSON-encoded for the
wire.Malli schema for an outbound notification (wire format, camelCase).
Malli schema for an outbound notification (wire format, camelCase).
Valid OpenADR object types for notifications.
Valid OpenADR object types for notifications.
Valid OpenADR notification operations.
Valid OpenADR notification operations.
(validate-entity! entity)Validate a stored entity against its storage-canon schema. Throws ex-info with :type :validation-error and Malli explanation on failure. Returns the entity unchanged on success.
Validate a stored entity against its storage-canon schema. Throws ex-info with :type :validation-error and Malli explanation on failure. Returns the entity unchanged on success.
(validate-notification-payload payload)Validate an outbound notification payload. Returns nil on success, Malli explanation on failure.
Validate an outbound notification payload. Returns nil on success, Malli explanation on failure.
Malli schema for a stored event (storage canon, keyword keys, ZDT/Duration in time fields). GSI fields: programID (programID-index, programID-eventStart-index), intervalPeriod.start → eventStart (objectType-eventStart-index, programID-eventStart-index).
Malli schema for a stored event (storage canon, keyword keys, ZDT/Duration in time fields). GSI fields: programID (programID-index, programID-eventStart-index), intervalPeriod.start → eventStart (objectType-eventStart-index, programID-eventStart-index).
Malli schema for a stored program (storage canon, keyword keys, ZDT datetimes). GSI fields: programName (programName-index SK).
Malli schema for a stored program (storage canon, keyword keys, ZDT datetimes). GSI fields: programName (programName-index SK).
Malli schema for a stored subscription (storage canon, keyword keys). GSI fields: clientName (query filter), programID (programID-index).
Malli schema for a stored subscription (storage canon, keyword keys). GSI fields: clientName (query filter), programID (programID-index).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |