summaryrefslogtreecommitdiffstats
path: root/src/python/openlmi/common/IndicationManager.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/openlmi/common/IndicationManager.py')
-rw-r--r--src/python/openlmi/common/IndicationManager.py60
1 files changed, 54 insertions, 6 deletions
diff --git a/src/python/openlmi/common/IndicationManager.py b/src/python/openlmi/common/IndicationManager.py
index ba0919d..a17703f 100644
--- a/src/python/openlmi/common/IndicationManager.py
+++ b/src/python/openlmi/common/IndicationManager.py
@@ -35,8 +35,9 @@ RE_FILTER_NAME = re.compile(r'^(?P<prefix>lmi:'
r'(?P<class_name>[a-z0-9_]+):)(?P<filter_id>.*)$', re.IGNORECASE)
FILTER_DEFAULTS = {
+ "SourceNamespace" : "root/cimv2",
"SourceNamespaces" : ["root/cimv2"],
- "QueryLanguage" : "CIM:CQL"
+ "QueryLanguage" : "CIM:CQL"
}
@cmpi_logging.trace_function
@@ -511,10 +512,19 @@ class IndicationManager(singletonmixin.Singleton):
self.ensure_filters_installed(class_name=class_name)
@cmpi_logging.trace_method
- def authorize_filter(self, _env, fltr, _ns, _classes, _owner):
+ def authorize_filter(self, _env, fltr, _class_name, _op, _owner):
"""
AuthorizeFilter callback from CIMOM. Call this method from appropriate
- CIMOM callback.
+ CIMOM callback
+
+ It asks us to verify whether this filter is allowed.
+
+ :param fltr: Contains the filter that must be authorized.
+ :param _class_name: (``String``) Contains the class name extracted
+ from the filter FROM clause.
+ :param _op: The name of the class for which monitoring is required.
+ Only the namespace part is set if className is a process indication.
+ :param _owner The owner argument is the destination owner.
"""
with self._access_lock:
res = self._get_matching_filter(fltr)
@@ -526,10 +536,24 @@ class IndicationManager(singletonmixin.Singleton):
return False
@cmpi_logging.trace_method
- def activate_filter(self, _env, fltr, _ns, _classes, first_activation):
+ def activate_filter(self, _env, fltr, _class_name, _class_path,
+ first_activation):
"""
ActivateFilter callback from CIMOM. Call this method from appropriate
CIMOM callback.
+
+ It ask us to begin monitoring a resource. The function shall begin
+ monitoring the resource according to the filter express only.
+
+ :param fltr: The filter argument contains the filter specification
+ for this subscription to become active.
+ :param _class_name: (``String``) The class name extracted from the filter
+ FROM clause.
+ :param _class_path: (``CIMInstanceName``) The name of the class for
+ which monitoring is required. Only the namespace part is set if
+ eventType is a process indication.
+ :param first_activation: (``bool``) Set to true if this is the first
+ filter for className.
"""
with self._access_lock:
if not first_activation:
@@ -541,10 +565,23 @@ class IndicationManager(singletonmixin.Singleton):
make_filter_name(res[0], res[1]), fltr)
@cmpi_logging.trace_method
- def deactivate_filter(self, _env, fltr, _ns, _classes, last_activation):
+ def deactivate_filter(self, _env, fltr, _class_name, _class_path,
+ last_activation):
"""
DeactivateFilter callback from CIMOM. Call this method from appropriate
CIMOM callback.
+
+ Informs us that monitoring using this filter should stop.
+
+ :param fltr: The filter argument contains the filter specification for
+ this subscription to become active.
+ :param class_name: (``String``) The class name extracted from the filter
+ FROM clause.
+ :param class_path: (``CIMInstanceName``) class_path The name of the
+ class for which monitoring is required. Only the namespace part is
+ set if className is a process indication.
+ :last_activation: (``bool``) Set to true if this is the last filter for
+ className.
"""
with self._access_lock:
if not last_activation:
@@ -560,6 +597,11 @@ class IndicationManager(singletonmixin.Singleton):
"""
EnableIndications callback from CIMOM. Call this method from
appropriate CIMOM callback.
+
+ Tells us that indications can now be generated. The MB is now prepared
+ to process indications. The function is normally called by the MB after
+ having done its intialization and processing of persistent subscription
+ requests.
"""
with self._access_lock:
self._enabled = True
@@ -570,6 +612,11 @@ class IndicationManager(singletonmixin.Singleton):
"""
EnableIndications callback from CIMOM. Call this method from
appropriate CIMOM callback.
+
+ Tells us that we should stop generating indications. MB will not accept
+ any indications until enabled again. The function is normally called
+ when the MB is shutting down indication services either temporarily or
+ permanently.
"""
with self._access_lock:
self._enabled = False
@@ -603,7 +650,8 @@ class IndicationManager(singletonmixin.Singleton):
ind['SourceInstance'] = instance
ind['SourceInstanceHost'] = socket.gethostname()
ind['SourceInstanceModelPath'] = str(instance.path)
- ind['IndicationFilterName'] = make_filter_name(instance.classname, filter_id)
+ ind['IndicationFilterName'] = make_filter_name(
+ instance.classname, filter_id)
ind['PerceivedSeverity'] = self.SEVERITY_INFO
cmpi_logging.logger.info("Sending indication %s for %s" %