File

core/realtime/measurement-realtime.service.ts

Extends

RealtimeService

Index

Methods

Constructor

constructor(realtimeSubject: RealtimeSubjectService, measurementService: MeasurementService)
Parameters :
Name Type Optional
realtimeSubject RealtimeSubjectService No
measurementService MeasurementService No

Methods

Protected channel
channel()
Returns : string
Protected lastMeasurement$
lastMeasurement$(fragment: string, series: string, entityOrId: string | number | IIdentified, pageSize: number, emitNullIfInitialValuesWereNotFound)
Parameters :
Name Type Optional Default value
fragment string No
series string No
entityOrId string | number | IIdentified No
pageSize number No
emitNullIfInitialValuesWereNotFound No false
Returns : any
latestValueOfSpecificMeasurement$
latestValueOfSpecificMeasurement$(fragment: string, series: string, entityOrId: string | number | IIdentified, pageSize: number, emitNullIfInitialValuesWereNotFound)

Get an Observable of all measurements filtered by fragment and series. Combines the latest value from measurement API and future values via realtime API.

Parameters :
Name Type Optional Default value Description
fragment string No

Measurement fragment

series string No

Measurement series

entityOrId string | number | IIdentified No

Entity object or id

pageSize number No 1

Number of measurements to initially retrieve from backend

emitNullIfInitialValuesWereNotFound No false

Flag that if set to true will initially emit value of null in case no measurement could have been retrieved from backend

Returns : any

An [[Observable]] of newly created entity objects.

onCreateOfSpecificMeasurement$
onCreateOfSpecificMeasurement$(fragment: string, series: string, entityOrId?: string | number | IIdentified)

Get an Observable of all measurements filtered by fragment and series.

Parameters :
Name Type Optional Description
fragment string No

Measurement fragment

series string No

Measurement series

entityOrId string | number | IIdentified Yes

Entity object or id

Returns : Observable<IMeasurement>

An [[Observable]] of newly created entity objects.

Protected getChannel
getChannel(entityOrId?: string | number | IIdentified)
Parameters :
Name Type Optional
entityOrId string | number | IIdentified Yes
Returns : any
Protected getIdString
getIdString(reference: number | string | IIdentified)
Parameters :
Name Type Optional
reference number | string | IIdentified No
Returns : string
onAll$
onAll$(entityOrId?: string | number | IIdentified)

Get an Observable of all realtime notifications.

Parameters :
Name Type Optional Description
entityOrId string | number | IIdentified Yes

Entity object or id

An [[Observable]] of notifications wrapped as [[RealtimeMessage]]

onCreate$
onCreate$(entityOrId?: string | number | IIdentified)

Get an Observable of all CREATE realtime notifications.

Parameters :
Name Type Optional Description
entityOrId string | number | IIdentified Yes

Entity object or id

Returns : Observable<T>

An [[Observable]] of newly created entity objects.

onDelete$
onDelete$(entityOrId?: string | number | IIdentified)

Get an Observable of all DELETE realtime notifications.

Parameters :
Name Type Optional Description
entityOrId string | number | IIdentified Yes

Entity object or id

Returns : Observable<number>

An [[Observable]] of deleted entity objects.

onUpdate$
onUpdate$(entityOrId?: string | number | IIdentified)

Get an Observable of all UPDATE realtime notifications.

Parameters :
Name Type Optional Description
entityOrId string | number | IIdentified Yes

Entity object or id

Returns : Observable<T>

An [[Observable]] of updated entity objects.

start
start()

Subscribes again all realtime channels with active observers.

Returns : void
stop
stop()

Stops realtime notifications and unsubscribes all realtime channels.

Returns : void

results matching ""

    No results matching ""