diff options
Diffstat (limited to 'src/software/openlmi/software/cimom_entry.py')
-rw-r--r-- | src/software/openlmi/software/cimom_entry.py | 73 |
1 files changed, 66 insertions, 7 deletions
diff --git a/src/software/openlmi/software/cimom_entry.py b/src/software/openlmi/software/cimom_entry.py index ad944c8..70df071 100644 --- a/src/software/openlmi/software/cimom_entry.py +++ b/src/software/openlmi/software/cimom_entry.py @@ -26,6 +26,7 @@ Entry module for OpenLMI Software providers. from multiprocessing import Queue from openlmi.common import cmpi_logging +from openlmi.common import JobManager from openlmi.common.IndicationManager import IndicationManager from openlmi.software.core import InstallationJob from openlmi.software.LMI_SoftwareIdentity import LMI_SoftwareIdentity @@ -113,26 +114,84 @@ def get_providers(env): # daemon. That means it does not have to be cleaned up. im = IndicationManager.get_instance( env, "Software", "root/cimv2", queue=Queue()) - jobmanager.register_filters(im) + JobManager.register_filters("LMI_SoftwareInstallationJob", im) return providers -def authorize_filter(env, fltr, ns, classes, owner): +def authorize_filter(env, fltr, class_name, op, owner): + """ + CIMOM callback. + + It asks us to verify whether this filter is allowed. + + :param fltr: (``String``) 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. + """ IndicationManager.get_instance().authorize_filter( - env, fltr, ns, classes, owner) + env, fltr, class_name, op, owner) -def activate_filter (env, fltr, ns, classes, first_activation): +def activate_filter(env, fltr, class_name, class_path, first_activation): + """ + 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: (``String``) 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. + """ IndicationManager.get_instance().activate_filter( - env, fltr, ns, classes, first_activation) + env, fltr, class_name, class_path, first_activation) + +def deactivate_filter(env, fltr, class_name, class_path, last_activation): + """ + CIMOM callback. -def deactivate_filter(env, fltr, ns, classes, last_activation): + Informs us that monitoring using this filter should stop. + + :param fltr: (``String``) 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. + """ IndicationManager.get_instance().deactivate_filter( - env, fltr, ns, classes, last_activation) + env, fltr, class_name, class_path, last_activation) def enable_indications(env): + """ + 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. + """ IndicationManager.get_instance().enable_indications(env) def disable_indications(env): + """ + 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. + """ IndicationManager.get_instance().disable_indications(env) def can_unload(_env): |