-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMCWSFrameEventStreamProvider.js
More file actions
45 lines (41 loc) · 1.29 KB
/
MCWSFrameEventStreamProvider.js
File metadata and controls
45 lines (41 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import MCWSStreamProvider from './MCWSStreamProvider';
/**
* Provides real-time streaming DataProduct data.
* @memberof {vista/telemetry}
*/
class MCWSFrameEventStreamProvider extends MCWSStreamProvider {
/**
* Get the URL for streaming data for this domain object
* @param {Object} domainObject The domain object
* @returns {String} The URL to use for streaming
*/
getUrl(domainObject) {
return domainObject.telemetry?.frameEventStreamUrl;
}
/**
* Get the key to use for this stream
* @param {Object} domainObject The domain object
* @returns {String} The key
*/
getKey(domainObject) {
if (domainObject.type === 'vista.frame-event-filter') {
const frameEventType = domainObject.identifier.key.split(':')[0];
return frameEventType;
} else {
return undefined;
}
}
/**
* Get the property to use for this stream
* @param {Object} domainObject The domain object
* @returns {String} The property name
*/
getProperty(domainObject) {
if (domainObject.type === 'vista.frame-event-filter') {
return 'message_type';
} else {
return 'some_undefined_property';
}
}
}
export default MCWSFrameEventStreamProvider;