Constructor
new DatumStreamMetadata(streamId, zone, kind, objectId, sourceId, iNames, aNames, sNames)
Constructor.
Name | Type | Description |
---|---|---|
streamId | string | the stream ID |
zone | string | the time zone ID |
kind | DatumStreamType | the stream type |
objectId | number | the node or location ID |
sourceId | string | the source ID |
iNames | Array.<string> | the instantaneous property name array |
aNames | Array.<string> | the accumulating property name array |
sNames | Array.<string> | the status property name array |
Members
accumulatingLength :number
The accumulating property names array length.
- number
accumulatingNames :Array.<String>
The accumulating property names array.
- Array.<String>
instantaneousLength :number
The instantaneous property names array length.
- number
instantaneousNames :Array.<String>
The instantaneous property names array.
- Array.<String>
kind :DatumStreamType
The stream type.
locationId :number
The stream object ID (if the kind
is Location
), otherewise undefined
.
- number
nodeId :number
The stream object ID (if the kind
is Node
), otherwise undefined
.
- number
objectId :number
The stream objece (node or location) ID.
- number
propertyNames :Array.<string>
Get all stream property names, in order of instantaneous, accumulating, and status.
- Array.<string>
propertyNamesLength :number
The total number of instantaneous, accumulating, and status property names.
- number
sourceId :string
The stream source ID.
- string
statusLength :number
The status property names array length.
- number
statusNames :Array.<String>
The status property names array.
- Array.<String>
streamId :string
The stream ID, for example 7714f762-2361-4ec2-98ab-7e96807b32a6
.
- string
timeZoneId :string
The stream time zone ID, for example Pacific/Auckland
.
- string
Methods
propertyNamesForType(samplesType) → {Array.<string>}
Get the property names for a given samples type.
Name | Type | Description |
---|---|---|
samplesType | DatumSamplesType | the type of property names to return; |
the property names for the given type, or null
if none available
- Type:
- Array.<string>
toJsonEncoding() → {string}
Get this object as a standard JSON encoded string value.
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"]
}
the JSON encoded string
- Type:
- string
(static) fromJsonEncoding(json) → {module:domain~DatumStreamMetadata}
Parse a JSON string into a module:domain~DatumStreamMetadata instance.
The JSON must be encoded the same way module:domain~DatumStreamMetadata#toJsonEncoding does.
Name | Type | Description |
---|---|---|
json | string | the JSON to parse |
the stream metadata instance
(static) fromJsonObject(obj) → {module:domain~DatumStreamMetadata}
Create a metadata instance from an object parsed from a JSON string.
The object must have been parsed from JSON that was encoded the same way module:domain~DatumStreamMetadata#toJsonEncoding does.
Name | Type | Description |
---|---|---|
obj | string | the object parsed from JSON |
the stream metadata instance
(static) locationMetadata(streamId, zone, locationId, sourceId, iNames, aNames, sNames) → {DatumStreamMetadata}
Create a new location datum stream metadata instance.
Name | Type | Description |
---|---|---|
streamId | string | the stream ID |
zone | string | the time zone ID |
locationId | number | the location ID |
sourceId | string | the source ID |
iNames | Array.<string> | the instantaneous property name array |
aNames | Array.<string> | the accumulating property name array |
sNames | Array.<string> | the status property name array |
the new metadata instance
- Type:
- DatumStreamMetadata
(static) nodeMetadata(streamId, zone, nodeId, sourceId, iNames, aNames, sNames) → {DatumStreamMetadata}
Create a new node datum stream metadata instance.
Name | Type | Description |
---|---|---|
streamId | string | the stream ID |
zone | string | the time zone ID |
nodeId | number | the node ID |
sourceId | string | the source ID |
iNames | Array.<string> | the instantaneous property name array |
aNames | Array.<string> | the accumulating property name array |
sNames | Array.<string> | the status property name array |
the new metadata instance
- Type:
- DatumStreamMetadata