⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cimoperationrequestdispatcher.cpp

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 CPP
📖 第 1 页 / 共 5 页
字号:
                PEGASUS_QUEUENAME_CONTROLSERVICE);            _routing_table.insert_record(                 PEGASUS_CLASSNAME_PG_SUBPROFILEREQUIRESPROFILE,                PEGASUS_NAMESPACENAME_INTEROP,                DynamicRoutingTable::INTERNAL,                0,                static_cast<MessageQueueService*>(                    MessageQueue::lookup(PEGASUS_QUEUENAME_CONTROLSERVICE)),                PEGASUS_MODULENAME_INTEROPPROVIDER,                PEGASUS_QUEUENAME_CONTROLSERVICE);            _routing_table.insert_record(                PEGASUS_CLASSNAME_PG_SOFTWAREIDENTITY,                PEGASUS_NAMESPACENAME_INTEROP,                DynamicRoutingTable::INTERNAL,                0,                static_cast<MessageQueueService*>(                    MessageQueue::lookup(PEGASUS_QUEUENAME_CONTROLSERVICE)),                PEGASUS_MODULENAME_INTEROPPROVIDER,                PEGASUS_QUEUENAME_CONTROLSERVICE);            _routing_table.insert_record(                PEGASUS_CLASSNAME_PG_ELEMENTSOFTWAREIDENTITY,                PEGASUS_NAMESPACENAME_INTEROP,                DynamicRoutingTable::INTERNAL,                0,                static_cast<MessageQueueService*>(                    MessageQueue::lookup(PEGASUS_QUEUENAME_CONTROLSERVICE)),                PEGASUS_MODULENAME_INTEROPPROVIDER,                PEGASUS_QUEUENAME_CONTROLSERVICE);            _routing_table.insert_record(                PEGASUS_CLASSNAME_PG_INSTALLEDSOFTWAREIDENTITY,                PEGASUS_NAMESPACENAME_INTEROP,                DynamicRoutingTable::INTERNAL,                0,                static_cast<MessageQueueService*>(                    MessageQueue::lookup(PEGASUS_QUEUENAME_CONTROLSERVICE)),                PEGASUS_MODULENAME_INTEROPPROVIDER,                PEGASUS_QUEUENAME_CONTROLSERVICE);#endif // PEGASUS_ENABLE_SLP            _routing_table.insert_record(                PEGASUS_CLASSNAME_PROVIDERMODULE,                PEGASUS_NAMESPACENAME_PROVIDERREG,                DynamicRoutingTable::INTERNAL,                0,                static_cast<MessageQueueService*>(                    MessageQueue::lookup(PEGASUS_QUEUENAME_CONTROLSERVICE)),                PEGASUS_MODULENAME_PROVREGPROVIDER,                PEGASUS_QUEUENAME_CONTROLSERVICE);            _routing_table.insert_record(                PEGASUS_CLASSNAME_PROVIDER,                PEGASUS_NAMESPACENAME_PROVIDERREG,                DynamicRoutingTable::INTERNAL,                0,                static_cast<MessageQueueService*>(                    MessageQueue::lookup(PEGASUS_QUEUENAME_CONTROLSERVICE)),                PEGASUS_MODULENAME_PROVREGPROVIDER,                PEGASUS_QUEUENAME_CONTROLSERVICE);            _routing_table.insert_record(                PEGASUS_CLASSNAME_PROVIDERCAPABILITIES,                PEGASUS_NAMESPACENAME_PROVIDERREG,                DynamicRoutingTable::INTERNAL,                0,                static_cast<MessageQueueService*>(                    MessageQueue::lookup(PEGASUS_QUEUENAME_CONTROLSERVICE)),                PEGASUS_MODULENAME_PROVREGPROVIDER,                PEGASUS_QUEUENAME_CONTROLSERVICE);            _routing_table.insert_record(                PEGASUS_CLASSNAME_CONSUMERCAPABILITIES,                PEGASUS_NAMESPACENAME_PROVIDERREG,                DynamicRoutingTable::INTERNAL,                0,                static_cast<MessageQueueService*>(                    MessageQueue::lookup(PEGASUS_QUEUENAME_CONTROLSERVICE)),                PEGASUS_MODULENAME_PROVREGPROVIDER,                PEGASUS_QUEUENAME_CONTROLSERVICE);            if (_enableIndicationService)            {                _routing_table.insert_record(                    PEGASUS_CLASSNAME_INDSUBSCRIPTION,                    _wild,                    DynamicRoutingTable::INTERNAL,                    0,                    static_cast<MessageQueueService*>(MessageQueue::lookup(                        PEGASUS_QUEUENAME_INDICATIONSERVICE)),                    String::EMPTY,                    PEGASUS_QUEUENAME_INDICATIONSERVICE);                _routing_table.insert_record(                    PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION,                    _wild,                    DynamicRoutingTable::INTERNAL,                    0,                    static_cast<MessageQueueService*>(MessageQueue::lookup(                        PEGASUS_QUEUENAME_INDICATIONSERVICE)),                    String::EMPTY,                    PEGASUS_QUEUENAME_INDICATIONSERVICE);                _routing_table.insert_record(                    PEGASUS_CLASSNAME_INDHANDLER,                    _wild,                    DynamicRoutingTable::INTERNAL,                    0,                    static_cast<MessageQueueService*>(MessageQueue::lookup(                        PEGASUS_QUEUENAME_INDICATIONSERVICE)),                    String::EMPTY,                    PEGASUS_QUEUENAME_INDICATIONSERVICE);                        _routing_table.insert_record(                    PEGASUS_CLASSNAME_LSTNRDST_CIMXML,                    _wild,                    DynamicRoutingTable::INTERNAL,                    0,                    static_cast<MessageQueueService*>(MessageQueue::lookup(                        PEGASUS_QUEUENAME_INDICATIONSERVICE)),                    String::EMPTY,                    PEGASUS_QUEUENAME_INDICATIONSERVICE);                _routing_table.insert_record(                    PEGASUS_CLASSNAME_INDHANDLER_CIMXML,                    _wild,                    DynamicRoutingTable::INTERNAL,                    0,                    static_cast<MessageQueueService*>(MessageQueue::lookup(                        PEGASUS_QUEUENAME_INDICATIONSERVICE)),                    String::EMPTY,                    PEGASUS_QUEUENAME_INDICATIONSERVICE);                _routing_table.insert_record(                    PEGASUS_CLASSNAME_INDHANDLER_SNMP,                    _wild,                    DynamicRoutingTable::INTERNAL,                    0,                    static_cast<MessageQueueService*>(MessageQueue::lookup(                        PEGASUS_QUEUENAME_INDICATIONSERVICE)),                    String::EMPTY,                    PEGASUS_QUEUENAME_INDICATIONSERVICE);                _routing_table.insert_record(                    PEGASUS_CLASSNAME_LSTNRDST_SYSTEM_LOG,                    _wild,                    DynamicRoutingTable::INTERNAL,                    0,                    static_cast<MessageQueueService*>(MessageQueue::lookup(                        PEGASUS_QUEUENAME_INDICATIONSERVICE)),                    String::EMPTY,                    PEGASUS_QUEUENAME_INDICATIONSERVICE);                _routing_table.insert_record(                    PEGASUS_CLASSNAME_LSTNRDST_EMAIL,                    _wild,                    DynamicRoutingTable::INTERNAL,                    0,                    static_cast<MessageQueueService*>(MessageQueue::lookup(                        PEGASUS_QUEUENAME_INDICATIONSERVICE)),                    String::EMPTY,                    PEGASUS_QUEUENAME_INDICATIONSERVICE);                _routing_table.insert_record(                    PEGASUS_CLASSNAME_INDFILTER,                    _wild,                    DynamicRoutingTable::INTERNAL,                    0,                    static_cast<MessageQueueService*>(MessageQueue::lookup(                        PEGASUS_QUEUENAME_INDICATIONSERVICE)),                    String::EMPTY,                    PEGASUS_QUEUENAME_INDICATIONSERVICE);            }            _initialized = 1;        }    }    MessageQueueService* router =        _routing_table.get_routing(            className,            nameSpace,            DynamicRoutingTable::INTERNAL,            0,            provider,            service);    PEG_TRACE_STRING(TRC_DISPATCHER, Tracer::LEVEL4,        "Internal provider  Service = " + service + " provider " + provider +            " found.");    PEG_METHOD_EXIT();    return (router != 0);}/**    _getSubClassNames - Gets the names of all subclasses of the defined    class (including the class) and returns it in an array of strings. Uses a    similar function in the repository class to get the names.  Note that    this prepends the result with the input classname.    @param namespace    @param className    @return Array of strings with class names.  Note that there should be at    least one classname in the array (the input name)    Note that there is a special exception to this function, the __namespace    class which does not have any representation in the class repository.    @exception CIMException(CIM_ERR_INVALID_CLASS)*/Array<CIMName> CIMOperationRequestDispatcher::_getSubClassNames(    const CIMNamespaceName& nameSpace,    const CIMName& className){    PEG_METHOD_ENTER(TRC_DISPATCHER,        "CIMOperationRequestDispatcher::_getSubClassNames");    Array<CIMName> subClassNames;    //    // Get names of descendent classes:    //    if (!className.equal (PEGASUS_CLASSNAME___NAMESPACE))    {        try        {            // Get the complete list of subclass names            _repository->getSubClassNames(nameSpace,                 className, true, subClassNames);            PEG_LOGGER_TRACE((Logger::STANDARD_LOG, System::CIMSERVER,                Logger::TRACE,                "CIMOperationRequestDispatcher::_getSubClassNames - "                    "Namespace: $0  Class name: $1",                nameSpace.getString(),                className.getString()));        }        catch (...)        {            // getSubClassNames throws an exception if the class does not exist            PEG_METHOD_EXIT();            throw;        }    }    // Prepend the array with the classname that formed the array.    subClassNames.prepend(className);    return subClassNames;}/////////////////////////////////////////////////////////////////////////////  PropertyList management functions///////////////////////////////////////////////////////////////////////////* _showPropertyList is local support for displaying the propertylist   For display only. Generates String with property list names   or "empty" or "NULL" if that is the case.   @param pl CIMPropertyList to convert   @return String containing the list of properties comma separated   or the keywords NULL or EMPTY. */static String _showPropertyList(const CIMPropertyList& pl){    String returnString;    if (pl.isNull())    {        returnString = "NULL";    }    else if (pl.size() == 0)    {        returnString = "EMPTY";    }    else    {        for (Uint32 i = 0; i < pl.size(); i++)        {            if (i > 0)            {                returnString.append(", ");            }            returnString.append(pl[i].getString());        }    }    return returnString;}///////////////////////////////////////////////////////////////////////////// Provider Lookup Functions////////////////////////////////////////////////////////////* _lookupAllInstanceProviders - Returns the list of all subclasses of this   class along with information about whether it is an instance provider.   @param nameSpace - Namespace for the lookup.   @param className - className for which we are finding providers   @param providerCount - Returns count of providers in the response array.   This is because the array returned is all subclasses, not simply those   with providers.   @return Returns an array of ProviderInfo, one entry for each subclass.   Each ProviderInfo instance defines whether a provider exists and the   information on the provider so that the operation can be forwarded to the   provider.   @exception - Throws one exception if the className is in error.  Note that   this should NEVER occur since the className should have already been   validated in the operation code.*/Array<ProviderInfo> CIMOperationRequestDispatcher::_lookupAllInstanceProviders(    const CIMNamespaceName& nameSpace,    const CIMName& className,    Uint32& providerCount){    PEG_METHOD_ENTER(        TRC_DISPATCHER,        "CIMOperationRequestDispatcher::_lookupAllInstanceProviders");    providerCount = 0;    // NOTE: This function can generate an exception.    Array<CIMName> classNames = _getSubClassNames(nameSpace, className);    Array<ProviderInfo> providerInfoList;    // Loop for all classNames found    for (Uint32 i = 0, n = classNames.size(); i < n; i++)    {        // Lookup any instance providers and add to send list        ProviderInfo providerInfo =            _lookupNewInstanceProvider(                nameSpace,                classNames[i]);        if (providerInfo.hasProvider)        {            providerCount++;            CDEBUG("Found provider for class = " << classNames[i].getString());            PEG_TRACE_STRING(                TRC_DISPATCHER,                Tracer::LEVEL4,                "Provider found for class = " +                    providerInfo.className.getString() +                    " servicename = " + providerInfo.serviceName +                    " controlProviderName = " +                    providerInfo.controlProviderName);        }        else        {            CDEBUG("No provider for class = " << classNames[i].getString());        }        providerInfoList.append(providerInfo);   }   PEG_METHOD_EXIT();   return providerInfoList;}/* _lookupInstanceProvider - Looks up the instance provider for the    classname and namespace.    Returns the name of the provider.    NOTE: This is the low level lookup for compatibility with    the external lookup in provider registration manager.    Added value is simply to get the name property from the returned    Instance.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -