Constructor.
Optional
metas: DatumStreamMetadata[]optional list of metadata to start with
Private
Readonly
#metaThe metadata.
Private
Readonly
#metaA map of stream ID to associated metadata.
Add metadata to the registry.
the metadata to add to the registry
this object
Get the metadata at a specific index, based on insertion order.
the index of the metadata to get
the metadata at the given index, or undefined
Get the first available metadata for a given object and source ID combination.
the object ID of the metadata to get
the source ID of the metadata to get
Optional
kind: DatumStreamTypeoptional kind to get; if not provided the first metadata to match the given objectId
and sourceId
will be returned
the associated metadata, or undefined
if none available
Get the metadta for a given stream ID.
the stream ID of the metadata to get
the associated metadata, or undefined
if none available
Get this object as a standard JSON encoded string value.
The returned JSON is an array of the toJsonEncoding() result of all metadata in the registry. An example result looks like this:
[
{
"streamId": "7714f762-2361-4ec2-98ab-7e96807b32a6",
"zone": "Pacific/Auckland",
"kind": "n",
"objectId": 123,
"sourceId": "/power/1",
"i": ["watts", "current", "voltage", "frequency"],
"a": ["wattHours"]
},
{
"streamId": "5514f762-2361-4ec2-98ab-7e96807b3255",
"zone": "America/New_York",
"kind": "n",
"objectId": 456,
"sourceId": "/irradiance/2",
"i": ["irradiance", "temperature"],
"a": ["irradianceHours"]
}
]
the JSON encoded string
Static
fromParse a JSON string into a DatumStreamMetadataRegistry instance.
The JSON must be encoded the same way toJsonEncoding() does.
the JSON to parse
the stream metadata registry instance, or undefined
if json
is not parsable as one
Static
fromCreate a registry instance from an array parsed from a JSON string of datum stream metadata objects.
The array must be structured in the same way toJsonEncoding() does.
the array data to parse
the stream metadata registry instance, or undefined
if data
is not a valid array
Generated using TypeDoc
A registry of datum stream metadata instances for object (node or location) and source ID combinations.
This registry acts like a map of (stream ID) -> metadata as well as (object ID, source ID) -> metadata.