domain~ DatumStreamMetadata

Metadata about a datum stream.

Constructor

new DatumStreamMetadata(streamId, zone, kind, objectId, sourceId, iNames, aNames, sNames)

Constructor.

Parameters:
NameTypeDescription
streamIdstring

the stream ID

zonestring

the time zone ID

kindDatumStreamType

the stream type

objectIdnumber

the node or location ID

sourceIdstring

the source ID

iNamesArray.<string>

the instantaneous property name array

aNamesArray.<string>

the accumulating property name array

sNamesArray.<string>

the status property name array

Members

accumulatingLength :number

The accumulating property names array length.

Type:
  • number

accumulatingNames :Array.<String>

The accumulating property names array.

Type:
  • Array.<String>

instantaneousLength :number

The instantaneous property names array length.

Type:
  • number

instantaneousNames :Array.<String>

The instantaneous property names array.

Type:
  • Array.<String>

kind :DatumStreamType

The stream type.

locationId :number

The stream object ID (if the kind is Location), otherewise undefined.

Type:
  • number

nodeId :number

The stream object ID (if the kind is Node), otherwise undefined.

Type:
  • number

objectId :number

The stream objece (node or location) ID.

Type:
  • number

propertyNames :Array.<string>

Get all stream property names, in order of instantaneous, accumulating, and status.

Type:
  • Array.<string>

propertyNamesLength :number

The total number of instantaneous, accumulating, and status property names.

Type:
  • number

sourceId :string

The stream source ID.

Type:
  • string

statusLength :number

The status property names array length.

Type:
  • number

statusNames :Array.<String>

The status property names array.

Type:
  • Array.<String>

streamId :string

The stream ID, for example 7714f762-2361-4ec2-98ab-7e96807b32a6.

Type:
  • string

timeZoneId :string

The stream time zone ID, for example Pacific/Auckland.

Type:
  • string

Methods

propertyNamesForType(samplesType) → {Array.<string>}

Get the property names for a given samples type.

Parameters:
NameTypeDescription
samplesTypeDatumSamplesType

the type of property names to return; Tag is not supported

Returns:

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"]
}
Returns:

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.

Parameters:
NameTypeDescription
jsonstring

the JSON to parse

Returns:

the stream metadata instance

Type: 
module:domain~DatumStreamMetadata

(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.

Parameters:
NameTypeDescription
objstring

the object parsed from JSON

Returns:

the stream metadata instance

Type: 
module:domain~DatumStreamMetadata

(static) locationMetadata(streamId, zone, locationId, sourceId, iNames, aNames, sNames) → {DatumStreamMetadata}

Create a new location datum stream metadata instance.

Parameters:
NameTypeDescription
streamIdstring

the stream ID

zonestring

the time zone ID

locationIdnumber

the location ID

sourceIdstring

the source ID

iNamesArray.<string>

the instantaneous property name array

aNamesArray.<string>

the accumulating property name array

sNamesArray.<string>

the status property name array

Returns:

the new metadata instance

Type: 
DatumStreamMetadata

(static) nodeMetadata(streamId, zone, nodeId, sourceId, iNames, aNames, sNames) → {DatumStreamMetadata}

Create a new node datum stream metadata instance.

Parameters:
NameTypeDescription
streamIdstring

the stream ID

zonestring

the time zone ID

nodeIdnumber

the node ID

sourceIdstring

the source ID

iNamesArray.<string>

the instantaneous property name array

aNamesArray.<string>

the accumulating property name array

sNamesArray.<string>

the status property name array

Returns:

the new metadata instance

Type: 
DatumStreamMetadata