class documentation

class TimeSeriesManager(object):

View In Hierarchy

Manager for TimeSeries handlings

Method addSubscription Add a subscription for the <TS> resource. Setup the internal structures.
Method isMonitored Check whether a resource is been monitored.
Method pauseMonitoringTimeSeries Pause the monitoring of a <TS> resource.
Method removeSubscription Remove a subcription from a <TS> resource. Remove the internal structures.
Method restart Restart the TimeSeriesManager service.
Method start Initialize the TimeSeriesManager. Register event handlers.
Method stop Shutdown the TimeSeriesManager. Stop all the active workers.
Method stopMonitoring Stop the background worker that monitores the timeSeries ingress.
Method stopMonitoringTimeSeries Remove a <TS> resource from monitoring. No other attributes are updated.
Method timeSeriesMonitor This method is called when the expectedDgtRange has passed. It checks whether a TSI is missing by looking at the latest arrived dgt.
Method updateSubscription Update an existing missing data subscription.
Method updateTimeSeries Add or update to the internal monitor DB. The monitoring is started when a first TSI is added for a <TS>.
Class Variable dispatcher Injected Dispatcher instance.
Class Variable notificationManager Injected NotificationManager instance.
Method _restoreTimeSeriesStructures Restore the necessary internal in-memory structures when (re)starting a CSE.
def addSubscription(self, timeSeries: Resource, subscription: Resource):

Add a subscription for the <TS> resource. Setup the internal structures.

Parameters
timeSeries:ResourceThe <TS> resource.
subscription:ResourceThe <sub
def isMonitored(self, ri: str) -> bool:

Check whether a resource is been monitored.

Parameters
ri:strResourceID of the TimeSeries resource.
Returns
boolBoolean indicating whether the resource is monitored.
def pauseMonitoringTimeSeries(self, tsRi: str) -> bool:

Pause the monitoring of a <TS> resource.

Parameters
tsRi:strResourceID of the TimeSeries resource.
Returns
boolBoolean indicating success.
def removeSubscription(self, timeSeries: Resource, subscription: Resource):

Remove a subcription from a <TS> resource. Remove the internal structures.

Parameters
timeSeries:ResourceThe <TS> resource.
subscription:ResourceThe <sub> resource.
def restart(self):

Restart the TimeSeriesManager service.

def start(self):

Initialize the TimeSeriesManager. Register event handlers.

def stop(self):

Shutdown the TimeSeriesManager. Stop all the active workers.

def stopMonitoring(self):

Stop the background worker that monitores the timeSeries ingress.

def stopMonitoringTimeSeries(self, tsRi: str) -> bool:

Remove a <TS> resource from monitoring. No other attributes are updated.

Parameters
tsRi:strResourceID of the TimeSeries resource.
Returns
boolBoolean indicating success.
def timeSeriesMonitor(self, tsRi: str) -> bool:

This method is called when the expectedDgtRange has passed. It checks whether a TSI is missing by looking at the latest arrived dgt.

Parameters
tsRi:strresourceID of the respective <TS> resource. Can be used to retrieve infos from runningTimeserieses dict.
Returns
boolTrue if the monitor should continue, False if the monitor should stop.
def updateSubscription(self, timeSeries: Resource, subscription: Resource):

Update an existing missing data subscription.

Parameters
timeSeries:ResourceThe <TS> resource.
subscription:ResourceThe <sub> resource.
def updateTimeSeries(self, timeSeries: Resource, instance: Resource):

Add or update to the internal monitor DB. The monitoring is started when a first TSI is added for a <TS>.

Parameters
timeSeries:ResourceThe <TS> resource.
instance:ResourceThe <TSI> resource.
dispatcher: Dispatcher =

Injected Dispatcher instance.

notificationManager: NotificationManager =

Injected NotificationManager instance.

def _restoreTimeSeriesStructures(self) -> bool:

Restore the necessary internal in-memory structures when (re)starting a CSE.

Returns
boolTrue if the structures have been restored.