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

📄 internalcimomhandlerep.cpp

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 CPP
📖 第 1 页 / 共 4 页
字号:
    const CIMName& className){    PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,        "InternalCIMOMHandleRep::enumerateInstanceNames");#ifdef PEGASUS_OS_OS400    // If this is running in user-state, then run the request    // through the user-state layer    if (_chOS400.hasKey())    {        Array<CIMObjectPath> cimObjectPaths =            _chOS400.enumerateInstanceNames(                context,                nameSpace,                className);        PEG_METHOD_EXIT();        return cimObjectPaths;    }#endif    // encode request    CIMEnumerateInstanceNamesRequestMessage* request =        new CIMEnumerateInstanceNamesRequestMessage(            XmlWriter::getNextMessageId(),            nameSpace,            className,            QueueIdStack());    // copy and adjust, as needed, the operation context    request->operationContext = _filterOperationContext(context);    AutoPtr<CIMEnumerateInstanceNamesResponseMessage> response;    try    {        response.reset(dynamic_cast<CIMEnumerateInstanceNamesResponseMessage*>(            do_request(request)));        if (response.get() == 0)        {            PEG_TRACE_STRING(                TRC_CIMOM_HANDLE,                Tracer::LEVEL2,                "Incorrect response type in CIMOMHandle");            throw CIMException(CIM_ERR_FAILED);        }    }    catch (CIMException &)    {        PEG_METHOD_EXIT();        throw;    }    catch (...)    {        PEG_TRACE_STRING(            TRC_CIMOM_HANDLE,            Tracer::LEVEL2,            "Exception caught in CIMOMHandle");        PEG_METHOD_EXIT();        throw CIMException(            CIM_ERR_FAILED,            MessageLoaderParms(                "Provider.CIMOMHandle.CAUGHT_EXCEPTION",                "Exception caught in CIMOMHandle"));    }    Array<CIMObjectPath> cimObjectPaths = response->instanceNames;    PEG_METHOD_EXIT();    return cimObjectPaths;}CIMObjectPath InternalCIMOMHandleRep::createInstance(    const OperationContext & context,    const CIMNamespaceName &nameSpace,    const CIMInstance& newInstance){    PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,        "InternalCIMOMHandleRep::createInstance");#ifdef PEGASUS_OS_OS400    // If this is running in user-state, then run the request    // through the user-state layer    if (_chOS400.hasKey())    {        CIMObjectPath cimReference =            _chOS400.createInstance(                context,                nameSpace,                newInstance);        PEG_METHOD_EXIT();        return cimReference;    }#endif    CIMCreateInstanceRequestMessage* request =        new CIMCreateInstanceRequestMessage(            XmlWriter::getNextMessageId(),            nameSpace,            newInstance,            QueueIdStack());    // copy and adjust, as needed, the operation context    request->operationContext = _filterOperationContext(context);    AutoPtr<CIMCreateInstanceResponseMessage> response;    try    {        response.reset(dynamic_cast<CIMCreateInstanceResponseMessage*>(            do_request(request)));        if (response.get() == 0)        {            PEG_TRACE_STRING(                TRC_CIMOM_HANDLE,                Tracer::LEVEL2,                "Incorrect response type in CIMOMHandle");            throw CIMException(CIM_ERR_FAILED);        }    }    catch (CIMException &)    {        PEG_METHOD_EXIT();        throw;    }    catch (...)    {        PEG_TRACE_STRING(            TRC_CIMOM_HANDLE,            Tracer::LEVEL2,            "Exception caught in CIMOMHandle");        PEG_METHOD_EXIT();        throw CIMException(            CIM_ERR_FAILED,            MessageLoaderParms(                "Provider.CIMOMHandle.CAUGHT_EXCEPTION",                "Exception caught in CIMOMHandle"));    }    CIMObjectPath cimReference = response->instanceName;    PEG_METHOD_EXIT();    return cimReference;}void InternalCIMOMHandleRep::modifyInstance(    const OperationContext & context,    const CIMNamespaceName &nameSpace,    const CIMInstance& modifiedInstance,    Boolean includeQualifiers,    const CIMPropertyList& propertyList){    PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,        "InternalCIMOMHandleRep::modifyInstance");#ifdef PEGASUS_OS_OS400    // If this is running in user-state, then run the request    // through the user-state layer    if (_chOS400.hasKey())    {        _chOS400.modifyInstance(            context,            nameSpace,            modifiedInstance,            includeQualifiers,            propertyList);        PEG_METHOD_EXIT();        return;    }#endif    CIMModifyInstanceRequestMessage* request =        new CIMModifyInstanceRequestMessage(            XmlWriter::getNextMessageId(),            nameSpace,            modifiedInstance,            includeQualifiers,            propertyList,            QueueIdStack());    // copy and adjust, as needed, the operation context    request->operationContext = _filterOperationContext(context);    AutoPtr<CIMModifyInstanceResponseMessage> response;    try    {        response.reset(dynamic_cast<CIMModifyInstanceResponseMessage*>(            do_request(request)));        if (response.get() == 0)        {            PEG_TRACE_STRING(                TRC_CIMOM_HANDLE,                Tracer::LEVEL2,                "Incorrect response type in CIMOMHandle");            throw CIMException(CIM_ERR_FAILED);        }    }    catch (CIMException &)    {        PEG_METHOD_EXIT();        throw;    }    catch (...)    {        PEG_TRACE_STRING(            TRC_CIMOM_HANDLE,            Tracer::LEVEL2,            "Exception caught in CIMOMHandle");        PEG_METHOD_EXIT();        throw CIMException(            CIM_ERR_FAILED,            MessageLoaderParms(                "Provider.CIMOMHandle.CAUGHT_EXCEPTION",                "Exception caught in CIMOMHandle"));    }    PEG_METHOD_EXIT();    return;}void InternalCIMOMHandleRep::deleteInstance(    const OperationContext & context,    const CIMNamespaceName &nameSpace,    const CIMObjectPath& instanceName){    PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,        "InternalCIMOMHandleRep::deleteInstance");#ifdef PEGASUS_OS_OS400    // If this is running in user-state, then run the request    // through the user-state layer    if (_chOS400.hasKey())    {        _chOS400.deleteInstance(            context,            nameSpace,            instanceName);        PEG_METHOD_EXIT();        return;    }#endif    CIMDeleteInstanceRequestMessage* request =        new CIMDeleteInstanceRequestMessage(            XmlWriter::getNextMessageId(),            nameSpace,            instanceName,            QueueIdStack());    // copy and adjust, as needed, the operation context    request->operationContext = _filterOperationContext(context);    AutoPtr<CIMDeleteInstanceResponseMessage> response;    try    {        response.reset(dynamic_cast<CIMDeleteInstanceResponseMessage*>(            do_request(request)));        if (response.get() == 0)        {            PEG_TRACE_STRING(                TRC_CIMOM_HANDLE,                Tracer::LEVEL2,                "Incorrect response type in CIMOMHandle");            throw CIMException(CIM_ERR_FAILED);        }    }    catch (CIMException &)    {        PEG_METHOD_EXIT();        throw;    }    catch (...)    {        PEG_TRACE_STRING(            TRC_CIMOM_HANDLE,            Tracer::LEVEL2,            "Exception caught in CIMOMHandle");        PEG_METHOD_EXIT();        throw CIMException(            CIM_ERR_FAILED,            MessageLoaderParms(                "Provider.CIMOMHandle.CAUGHT_EXCEPTION",                "Exception caught in CIMOMHandle"));    }    PEG_METHOD_EXIT();    return;}Array<CIMObject> InternalCIMOMHandleRep::execQuery(    const OperationContext & context,    const CIMNamespaceName &nameSpace,    const String& queryLanguage,    const String& query){    PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::execQuery");#ifdef PEGASUS_OS_OS400    // If this is running in user-state, then run the request    // through the user-state layer    if (_chOS400.hasKey())    {        Array<CIMObject> cimObjects =            _chOS400.execQuery(                context,                nameSpace,                queryLanguage,                query);        PEG_METHOD_EXIT();        return cimObjects;    }#endif    CIMExecQueryRequestMessage* request =        new CIMExecQueryRequestMessage(            XmlWriter::getNextMessageId(),            nameSpace,            queryLanguage,            query,            QueueIdStack());    // copy and adjust, as needed, the operation context    request->operationContext = _filterOperationContext(context);    AutoPtr<CIMExecQueryResponseMessage> response;    try    {        response.reset(dynamic_cast<CIMExecQueryResponseMessage*>(            do_request(request)));        if (response.get() == 0)        {            PEG_TRACE_STRING(                TRC_CIMOM_HANDLE,                Tracer::LEVEL2,                "Incorrect response type in CIMOMHandle");            throw CIMException(CIM_ERR_FAILED);        }    }    catch (CIMException &)    {        PEG_METHOD_EXIT();        throw;    }    catch (...)    {        PEG_TRACE_STRING(            TRC_CIMOM_HANDLE,            Tracer::LEVEL2,            "Exception caught in CIMOMHandle");        PEG_METHOD_EXIT();        throw CIMException(            CIM_ERR_FAILED,            MessageLoaderParms(                "Provider.CIMOMHandle.CAUGHT_EXCEPTION",                "Exception caught in CIMOMHandle"));    }    Array<CIMObject> cimObjects = response->cimObjects;    PEG_METHOD_EXIT();    return cimObjects;}Array<CIMObject> InternalCIMOMHandleRep::associators(    const OperationContext & context,    const CIMNamespaceName &nameSpace,    const CIMObjectPath& objectName,    const CIMName& assocClass,    const CIMName& resultClass,    const String& role,    const String& resultRole,    Boolean includeQualifiers,    Boolean includeClassOrigin,    const CIMPropertyList& propertyList){    PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::associators");#ifdef PEGASUS_OS_OS400    // If this is running in user-state, then run the request    // through the user-state layer    if (_chOS400.hasKey())    {        Array<CIMObject> cimObjects =            _chOS400.associators(                context,                nameSpace,                objectName,                assocClass,                resultClass,                role,                resultRole,                includeQualifiers,                includeClassOrigin,                propertyList);        PEG_METHOD_EXIT();        return cimObjects;    }#endif    CIMAssociatorsRequestMessage* request =        new CIMAssociatorsRequestMessage(            XmlWriter::getNextMessageId(),            nameSpace,            objectName,            assocClass,            resultClass,            role,            resultRole,            includeQualifiers,            includeClassOrigin,            propertyList,            QueueIdStack());    // copy and adjust, as needed, the operation context    request->operationContext = _filterOperationContext(context);    AutoPtr<CIMAssociatorsResponseMessage> response;    try    {        response.reset(dynamic_cast<CIMAssociatorsResponseMessage*>(            do_request(request)));        if (response.get() == 0)        {            PEG_TRACE_STRING(                TRC_CIMOM_HANDLE,                Tracer::LEVEL2,                "Incorrect response type in CIMOMHandle");            throw CIMException(CIM_ERR_FAILED);        }    }    catch (CIMException &)    {        PEG_METHOD_EXIT();        throw;    }    catch (...)    {        PEG_TRACE_STRING(            TRC_CIMOM_HANDLE,            Tracer::LEVEL2,            "Exception caught in CIMOMHandle");        PEG_METHOD_EXIT();        throw CIMException(            CIM_ERR_FAILED,            MessageLoaderParms(                "Provider.CIMOMHandle.CAUGHT_EXCEPTION",                "Exception caught in CIMOMHandle"));    }    Array<CIMObject> cimObjects = response->cimObjects;    PEG_METHOD_EXIT();    return cimObjects;}Array<CIMObjectPath> InternalCIMOMHandleRep::associatorNames(    const OperationContext & context,    const CIMNamespaceName &nameSpace,    const CIMObjectPath& objectName,    const CIMName& assocClass,    const CIMName& resultClass,    const String& role,    const String& resultRole){    PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,        "InternalCIMOMHandleRep::associatorNames");#ifdef PEGASUS_OS_OS400    // If this is running in user-state, then run the request    // through the user-state layer    if (_chOS400.hasKey())    {        Array<CIMObjectPath> cimObjectPaths =            _chOS400.associatorNames(                context,                nameSpace,                objectName,                assocClass,                resultClass,                role,                resultRole);        PEG_METHOD_EXIT();        return cimObjectPaths;    }#endif    CIMAssociatorNamesRequestMessage* request =        new CIMAssociatorNamesRequestMessage(            XmlWriter::getNextMessageId(),            nameSpace,            objectName,            assocClass,            resultClass,            role,            resultRole,            QueueIdStack());    // copy and adjust, as needed, the operation context    request->operationContext = _filterOperationContext(context);    AutoPtr<CIMAssociatorNamesResponseMessage> response;

⌨️ 快捷键说明

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