当前位置: 首页>>代码示例>>C++>>正文


C++ CIMNamespaceName函数代码示例

本文整理汇总了C++中CIMNamespaceName函数的典型用法代码示例。如果您正苦于以下问题:C++ CIMNamespaceName函数的具体用法?C++ CIMNamespaceName怎么用?C++ CIMNamespaceName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CIMNamespaceName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: _deleteSubscriptionInstance

void _deleteSubscriptionInstance 
    (CIMClient & client, 
     const String & filterName,
     const String & handlerName)
{
    _deleteSubscriptionInstance (client, filterName, handlerName,
        CIMNamespaceName (), CIMNamespaceName (),
        PEGASUS_NAMESPACENAME_INTEROP);
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:9,代码来源:DisableEnable2.cpp

示例2: CIMNamespaceName

PEGASUS_NAMESPACE_BEGIN

MCCA_TestAssocProvider::MCCA_TestAssocProvider(void)
{
    nameSpaceA = CIMNamespaceName ("root/MCCAtest/A");
    nameSpaceB = CIMNamespaceName ("root/MCCAtest/B");
    testClassName = CIMName ("MCCA_TestClass");
    assocClassName = CIMName ("MCCA_TestAssocClass");

}
开发者ID:brunolauze,项目名称:pegasus,代码行数:10,代码来源:MCCA_TestAssocProvider.cpp

示例3: _getKeyValue

void _getKeyValue (
    const CIMInstance& namespaceInstance,
    CIMNamespaceName& childNamespaceName,
    Boolean& isRelativeName)

{
    //Validate key property

    Uint32 pos;
    CIMValue propertyValue;

    // [Key, MaxLen (256), Description (
    //       "A string that uniquely identifies the Namespace "
    //       "within the ObjectManager.") ]
    // string Name;

    pos = namespaceInstance.findProperty(NAMESPACE_PROPERTYNAME);
    if (pos == PEG_NOT_FOUND)
    {
        throw CIMPropertyNotFoundException
        (NAMESPACE_PROPERTYNAME.getString());
    }

    propertyValue = namespaceInstance.getProperty(pos).getValue();
    if (propertyValue.getType() != CIMTYPE_STRING)
    {
        //l10n
        //throw CIMInvalidParameterException("Invalid type for property: "
        //+ NAMESPACE_PROPERTYNAME.getString());
        throw CIMInvalidParameterException(MessageLoaderParms(
                                               "ControlProviders.NamespaceProvider.NamespaceProvider.INVALID_TYPE_FOR_PROPERTY",
                                               "Invalid type for property: $0",
                                               NAMESPACE_PROPERTYNAME.getString()));
    }

    String cnsName;
    propertyValue.get(cnsName);
    if (cnsName == String::EMPTY)
    {
        childNamespaceName = CIMNamespaceName();
    }
    else
    {
        childNamespaceName = CIMNamespaceName(cnsName);
    }

    isRelativeName = !(childNamespaceName.isNull());

}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:49,代码来源:NamespaceProvider.cpp

示例4: _testHostedIndicationServiceInstance

void _testHostedIndicationServiceInstance(CIMClient &client)
{
    cout << "Testing Association Class "
        << (const char *)PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE.
             getString().getCString()
        << "...";
    // Get PG_HostedIndicationService Instances
    Array<CIMInstance> hostedInstances = client.enumerateInstances(
        PEGASUS_NAMESPACENAME_INTEROP,
        PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE);
    PEGASUS_TEST_ASSERT(hostedInstances.size() == 1);

    // Get PG_HostedIndicationService Instance names
    Array<CIMObjectPath> hostedPaths = client.enumerateInstanceNames(
        PEGASUS_NAMESPACENAME_INTEROP,
        PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE);
    PEGASUS_TEST_ASSERT(hostedPaths.size() == 1);

    // Get CIM_IndicationService instance names
    Array<CIMObjectPath> servicePaths = client.enumerateInstanceNames(
        PEGASUS_NAMESPACENAME_INTEROP,
        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
    PEGASUS_TEST_ASSERT(servicePaths.size() == 1);

    // Test the CIM_IndicationService value.
    CIMValue capValue = hostedInstances[0].getProperty(
        hostedInstances[0].findProperty("Dependent")).getValue();
    CIMObjectPath testPath;
    capValue.get(testPath);
    testPath.setNameSpace(CIMNamespaceName());
    PEGASUS_TEST_ASSERT(testPath.identical(servicePaths[0]));

    cout << "Test Complete" << endl;
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:34,代码来源:ServerProfile.cpp

示例5: testArrayType

void testArrayType(const Array<T>& x)
{
    WsmToCimRequestMapper mapper((CIMRepository*) 0);

    // Create a NULL CIMValue of the appropriate type. Normally type
    // info is retrieved from the repository.
    CIMValue tmp(x);
    CIMValue cimValue(tmp.getType(), tmp.isArray());

    // Create WsmValue out of the given array
    Array<String> arr;
    for (Uint32 i = 0; i < x.size(); i++)
    {
        String str = CIMValue(x[i]).toString();
        if (tmp.getType() == CIMTYPE_BOOLEAN)
        {
            str.toLower();
        }
        arr.append(str);
    }

    WsmValue wsmValue(arr);
    mapper.convertWsmToCimValue(wsmValue, CIMNamespaceName(), cimValue);
    PEGASUS_TEST_ASSERT(tmp == cimValue);
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:25,代码来源:WsmToCimMapper.cpp

示例6:

Array<CIMInstance> CIMClient::enumerateInstances(
    const CIMNamespaceName& nameSpace,
    const CIMName& className,
    Boolean deepInheritance,
    Boolean localOnly,
    Boolean includeQualifiers,
    Boolean includeClassOrigin,
    const CIMPropertyList& propertyList)
{

    Array<CIMInstance> a = _rep->enumerateInstances(
            nameSpace,
            className,
            deepInheritance,
            localOnly,
            includeQualifiers,
            includeClassOrigin,
            propertyList).getInstances();    

    // remove name space and host name to be instance names
    for (Uint32 i = 0, n = a.size(); i < n ; i++)
    {
        if (!a[i].isUninitialized())
        {
            CIMObjectPath& p = const_cast<CIMObjectPath&>(a[i].getPath());
            p.setNameSpace(CIMNamespaceName());
            p.setHost(String());
        }
    }


    return a;
}
开发者ID:kaixuanlive,项目名称:openpegasus,代码行数:33,代码来源:CIMClient.cpp

示例7: CIMObjectPath

void AuditLogger::logUpdateInstanceOperation(
    const char* cimMethodName,
    AuditEvent eventType,
    const String& userName,
    const String& ipAddr,
    const CIMNamespaceName& nameSpace,
    const CIMObjectPath& instanceName,
    const String& moduleName,
    const String& providerName,
    CIMStatusCode statusCode)
{
    // check if SMF is gathering this type of records.
    if (_smf.isRecording(CIM_OPERATION) ||
        (! _isInternalWriterUsed) )
    {
        String cimInstanceName =
            CIMObjectPath("", CIMNamespaceName(), instanceName.getClassName(),
            instanceName.getKeyBindings()).toString();

        _writeCIMOperationRecord(
            INSTANCE_OPERATION, userName, statusCode,
            ipAddr, cimMethodName, cimInstanceName,
            nameSpace.getString(), providerName, moduleName );
    }
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:25,代码来源:AuditLoggerToSMF.cpp

示例8: CIMObjectPath

void InstanceProvider::deleteInstance(
	const OperationContext & context,
	const CIMObjectPath & instanceReference,
	ResponseHandler & handler)
{
	// convert a potential fully qualified reference into a local reference
	// (class name and keys only).
	CIMObjectPath localReference = CIMObjectPath(
		String(),
		CIMNamespaceName(),
		instanceReference.getClassName(),
		instanceReference.getKeyBindings());
	
	// begin processing the request
	handler.processing();

	// instance index corresponds to reference index
	for(Uint32 i = 0, n = _instances.size(); i < n; i++)
	{
		if(localReference == _instances[i].getPath())
		{
			// remove instance from the array
			_instances.remove(i);

			break;
		}
	}
	
	// complete processing the request
	handler.complete();
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:31,代码来源:InstanceProvider.cpp

示例9: mbReferenceNames

   static CMPIEnumeration* mbReferenceNames(const CMPIBroker *mb, const CMPIContext *ctx,
                  const CMPIObjectPath *cop, const char *resultClass, const char *role,
                  CMPIStatus *rc) {
      DDD(cout<<"--- mbReferencesNames()"<<endl);
      mb=CM_BROKER;
      CIMObjectPath qop(String::EMPTY,CIMNamespaceName(),
                        CM_ObjectPath(cop)->getClassName(),
            CM_ObjectPath(cop)->getKeyBindings());

      AutoMutex mtx(((CMPI_Broker*)mb)->mtx);
      try {
         Array<CIMObjectPath> const &en=CM_CIMOM(mb)->referenceNames(
         OperationContext(*CM_Context(ctx)),
         CM_ObjectPath(cop)->getNameSpace(),
         qop,
         resultClass ? CIMName(resultClass) : CIMName(),
         role ? String(role) : String::EMPTY);
         if (rc) CMSetStatus(rc,CMPI_RC_OK);
         CMPI_Object *obj =
             new CMPI_Object(new CMPI_OpEnumeration(new Array<CIMObjectPath>(en)));
         return (CMPI_OpEnumeration *)obj->getHdl();
      }
      catch (const CIMException &e) {
         DDD(cout<<"### exception: mbReferencesNames - code: "<<e.getCode()<<" msg: "<<e.getMessage()<<endl);
         if (rc) CMSetStatusWithString(rc,(CMPIrc)e.getCode(),
            (CMPIString*)string2CMPIString(e.getMessage()));
      }
      if (rc) CMSetStatusWithChars(mb,rc,CMPI_RC_ERROR,"Internal error - CMPIBoker.cpp-11");
      return NULL;
   }
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:30,代码来源:CMPI_Broker.cpp

示例10: methodName

void _sendIndicationShouldBeBlocked 
    (CIMClient & client)
{
    Array <CIMParamValue> inParams;
    Array <CIMParamValue> outParams;
    Array <CIMKeyBinding> keyBindings;
    Sint32 result;

    CIMName methodName ("SendTestIndication");
    CIMObjectPath className (String::EMPTY, CIMNamespaceName (), 
        CIMName("Test_IndicationProviderClass"), keyBindings);

    try
    {
        CIMValue retValue = client.invokeMethod 
            (SOURCENAMESPACE,
            className,
            methodName,
            inParams,
            outParams);
        retValue.get (result);
        PEGASUS_TEST_ASSERT (false);
    }
    catch (CIMException & e)
    {
        PEGASUS_TEST_ASSERT (e.getCode () == CIM_ERR_NOT_SUPPORTED);
    }
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:28,代码来源:DisableEnable2.cpp

示例11: _generateFullNamespaceName

void _generateFullNamespaceName(
    Array<CIMNamespaceName>& namespaceNames,
    CIMNamespaceName& parentNamespaceName,
    CIMNamespaceName& childNamespaceName,
    Boolean isRelativeName,
    CIMNamespaceName& fullNamespaceName)

{
    // If isRelativeName is true, then the parentNamespace
    // MUST exist
    //
    if (isRelativeName)
    {
        if (!Contains(namespaceNames, parentNamespaceName))
        {
            //l10n
            //throw CIMObjectNotFoundException("Parent namespace does not exist: "
            //+ parentNamespaceName.getString());
            throw CIMObjectNotFoundException(MessageLoaderParms(
                                                 "ControlProviders.NamespaceProvider.NamespaceProvider.PARENT_NAMESPACE_DOES_NOT_EXIST",
                                                 "Parent namespace does not exist: $0",
                                                 parentNamespaceName.getString()));
        }
        // Create full namespace name by prepending parentNamespaceName
        fullNamespaceName = CIMNamespaceName (parentNamespaceName.getString()
                                              + "/" + childNamespaceName.getString());
    }
    else
    {
        fullNamespaceName = parentNamespaceName;
    }

}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:33,代码来源:NamespaceProvider.cpp

示例12: mbGetInstance

   static CMPIInstance* mbGetInstance(const CMPIBroker *mb, const CMPIContext *ctx,
                  const CMPIObjectPath *cop, const char **properties, CMPIStatus *rc) {
      DDD(cout<<"--- mbGetInstance()"<<endl);
      mb=CM_BROKER;
      CMPIFlags flgs=ctx->ft->getEntry(ctx,CMPIInvocationFlags,NULL).value.uint32;
      const CIMPropertyList props=getList(properties);
      CIMObjectPath qop(String::EMPTY,CIMNamespaceName(),
                        CM_ObjectPath(cop)->getClassName(),
            CM_ObjectPath(cop)->getKeyBindings());

      AutoMutex mtx(((CMPI_Broker*)mb)->mtx);
      try {
         CIMInstance ci=CM_CIMOM(mb)->getInstance(
                     OperationContext(*CM_Context(ctx)),
         CM_ObjectPath(cop)->getNameSpace(),
         qop, //*CM_ObjectPath(cop),
         CM_LocalOnly(flgs),
         CM_IncludeQualifiers(flgs),
         CM_ClassOrigin(flgs),
         props);
         ci.setPath(*CM_ObjectPath(cop));
         if (rc) CMSetStatus(rc,CMPI_RC_OK);
         return (CMPIInstance*)new CMPI_Object(new CIMInstance(ci));
      }
      catch (const CIMException &e) {
         DDD(cout<<"### exception: mbGetInstance - code: "<<e.getCode()<<" msg: "<<e.getMessage()<<endl);
         if (rc) CMSetStatusWithString(rc,(CMPIrc)e.getCode(),
            (CMPIString*)string2CMPIString(e.getMessage()));
         return NULL;
      }
      if (rc) CMSetStatusWithChars(mb,rc,CMPI_RC_ERROR,"Internal error - CMPIBoker.cpp-0");
      return NULL;
   }
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:33,代码来源:CMPI_Broker.cpp

示例13: _sendTestIndication

void _sendTestIndication(
    CIMClient* client,
    const CIMName & methodName,
    Uint32 indicationSendCount)
{
    //
    //  Invoke method to send test indication
    //
    Array <CIMParamValue> inParams;
    Array <CIMParamValue> outParams;
    Array <CIMKeyBinding> keyBindings;
    Sint32 result;

    CIMObjectPath className (String::EMPTY, CIMNamespaceName (),
                             CIMName ("Test_IndicationProviderClass"), keyBindings);

    inParams.append(CIMParamValue(String("indicationSendCount"),
                                  CIMValue(indicationSendCount)));

    CIMValue retValue = client->invokeMethod
                        (SOURCE_NAMESPACE,
                         className,
                         methodName,
                         inParams,
                         outParams);

    retValue.get (result);
    PEGASUS_TEST_ASSERT (result == 0);
}
开发者ID:xenserver,项目名称:openpegasus,代码行数:29,代码来源:testSnmpHandler.cpp

示例14: _testElementCapabilityInstance

void _testElementCapabilityInstance(CIMClient &client)
{
    cout << "Testing Association Class "
        << (const char *)PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES.
             getString().getCString()
        << "...";

    // Get CIM_IndicationServiceCapabilities instance names
    Array<CIMObjectPath> capPaths = client.enumerateInstanceNames(
        PEGASUS_NAMESPACENAME_INTEROP,
        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES);
    PEGASUS_TEST_ASSERT(capPaths.size() == 1);

    // Get CIM_IndicationService instance names
    Array<CIMObjectPath> servicePaths = client.enumerateInstanceNames(
        PEGASUS_NAMESPACENAME_INTEROP,
        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
    PEGASUS_TEST_ASSERT(servicePaths.size() == 1);


    // Get PG_ElementCapabilities instances
    Array<CIMInstance> eleInstances = client.enumerateInstances(
        PEGASUS_NAMESPACENAME_INTEROP,
        PEGASUS_CLASSNAME_PG_ELEMENTCAPABILITIES);
    PEGASUS_TEST_ASSERT(eleInstances.size() == 1);

    // Test PG_ElementCapabilities instance.
    CIMValue capValue = eleInstances[0].getProperty(
        eleInstances[0].findProperty("Capabilities")).getValue();

    CIMValue meValue = eleInstances[0].getProperty(
        eleInstances[0].findProperty("ManagedElement")).getValue();

    // Now test the instance names of CIM_IndicationService instance and
    // CIM_IndicationServiceCapabilities instance.
    CIMObjectPath testPath;
    capValue.get(testPath);
    testPath.setNameSpace(CIMNamespaceName());
    PEGASUS_TEST_ASSERT(testPath.identical(capPaths[0]));

    meValue.get(testPath);
    testPath.setNameSpace(CIMNamespaceName());
    PEGASUS_TEST_ASSERT(testPath.identical(servicePaths[0]));

    cout << "Test Complete" << endl;
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:46,代码来源:ServerProfile.cpp

示例15: _testDuplicate

void _testDuplicate(CIMClient &client)
{
    CIMObjectPath filterPath;
    CIMObjectPath handlerPath;
    CIMObjectPath subscriptionPath;

    try
    {
        handlerPath = CreateHandler1Instance(client,
            PEGASUS_NAMESPACENAME_INTEROP);
        filterPath = CreateFilterInstance(client,
            QUERY1, "WQL", "Filter1",
            PEGASUS_NAMESPACENAME_INTEROP);
        subscriptionPath = CreateSbscriptionInstance(client, handlerPath,
            filterPath, PEGASUS_NAMESPACENAME_INTEROP);

        _createDuplicate(client, String::EMPTY, CIMNamespaceName(),
            filterPath, String::EMPTY, CIMNamespaceName(), handlerPath);

        _createDuplicate(client, String::EMPTY,
            PEGASUS_NAMESPACENAME_INTEROP, filterPath,
            String::EMPTY,PEGASUS_NAMESPACENAME_INTEROP, handlerPath);

        _createDuplicate(client, "127.0.0.1",
            PEGASUS_NAMESPACENAME_INTEROP, filterPath,
            String::EMPTY, CIMNamespaceName(), handlerPath);

        _createDuplicate(client, "127.0.0.1",PEGASUS_NAMESPACENAME_INTEROP,
            filterPath, "127.0.0.1", PEGASUS_NAMESPACENAME_INTEROP,
            handlerPath);

        _createDuplicate(client, String::EMPTY, CIMNamespaceName(),
            filterPath, "127.0.0.1", PEGASUS_NAMESPACENAME_INTEROP,
            handlerPath);
        _checkSubscriptionCount(client);
        DeleteInstance(client, subscriptionPath, PEGASUS_NAMESPACENAME_INTEROP);
        DeleteInstance(client, filterPath, PEGASUS_NAMESPACENAME_INTEROP);
        DeleteInstance(client, handlerPath, PEGASUS_NAMESPACENAME_INTEROP);
    }
    catch (const CIMException &e)
    {
        PEGASUS_STD(cerr) << "Exception: " << e.getMessage()
                          << PEGASUS_STD (endl);
        PEGASUS_TEST_ASSERT(0);
    }
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:46,代码来源:IndicationProcess.cpp


注:本文中的CIMNamespaceName函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。