Examples of CIMInstance


Examples of org.pegasus.jmpi.CIMInstance

    {
      CIMObjectPath cimObjectPath= new CIMObjectPath(className,namespc);
      CIMObjectPath cop1=(CIMObjectPath)cop;
      cimObjectPath.setKeys(cop1.getKeys());
      try{
        CIMInstance ci=_handle.getInstance(cimObjectPath, true, true, true, null);
        Map instanceProperties=new HashMap();
        //get all properties of the current instance
        Vector properties=ci.getProperties();
        for(int i=0;i<properties.size();i++)
        {
          //add property to HashMap as (class.name,value) pair
          CIMProperty cimproperty=(CIMProperty) properties.get(i);
          String qualifiedPropertyName=  cimproperty.getName();
View Full Code Here

Examples of org.pegasus.jmpi.CIMInstance

          //enumerating all instances of associaation class
          Enumeration instancesOfAssociation=_handle.enumerateInstances(copAssociationClass, true, true, true, true, null);
          //iterating over all instances of association class
          while(instancesOfAssociation.hasMoreElements()){
            CIMInstance inst=(CIMInstance)instancesOfAssociation.nextElement();
            //check to see if the source instance is same as current Anchor Object

            CIMProperty srcinstcop=inst.getProperty(role);//this will return partial cop of src instance
            CIMObjectPath copSrcInstFull=CIMObjectPath.toCop(srcinstcop.getValue().getValue().toString());
            if(logger.isLoggable(Level.FINE))
              logger.fine(Thread.currentThread().getName()+" Anchor cop "+cop);
            if(equalCOP(copSrcInstFull,cop)){
              //get and add associated result instance to vector
              CIMProperty cimprop=inst.getProperty(resultRole);
              CIMObjectPath coop= CIMObjectPath.toCop(cimprop.getValue().getValue().toString());
              CIMObjectPath copAssociatedInstance=new CIMObjectPath(resultInstancesClassFilter,classPath);
              copAssociatedInstance.setKeys(coop.getKeys());
              //Reference ref=new Reference(copAssociatedInstance.toString());
              instanceREFList.add(copAssociatedInstance);
View Full Code Here

Examples of org.pegasus.jmpi.CIMInstance

        Iterator it=polNames.iterator();
        Vector instances=new Vector();
        while(it.hasNext())
        {
          String pi=(String)it.next();
          CIMInstance cimInst=_createPolicyCIMInstance(pi, (String)policyInstances.get(pi));
          instances.add(cimInst);
        }
        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+"enumerateInstances");

        return instances;
View Full Code Here

Examples of org.pegasus.jmpi.CIMInstance

        && (nameSpace.equals(NAMESPACE)))
    {
      try
      {
        String pi=_policyManager.getPolicy(PolicyRuleName);
        CIMInstance cimInst=_createPolicyCIMInstance(PolicyRuleName, pi);
        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+"getInstance");
        return cimInst;
      }
      catch (SPLException e)
      {
View Full Code Here

Examples of org.pegasus.jmpi.CIMInstance

    {
      if (logger.isLoggable(Level.FINE))
        logger.fine(Thread.currentThread().getName()+" create a CIMPolicy Object out of the PolicyString and PolicyRuleName");
      // create a CIMPolicy Object out of the PolicyString and
      // PolicyRuleName
      CIMInstance policyInstance = new CIMInstance(POLICY_CLASS_NAME);

      policyInstance.setProperty("SystemCreationClassName",
          new CIMValue("cim_splpolicyrule"));
      policyInstance.setProperty("SystemName", new CIMValue("localhost.localdomain"));
      policyInstance.setProperty("CreationClassName", new CIMValue(POLICY_CLASS_NAME));
      policyInstance.setProperty("PolicyRuleName", new CIMValue(policyRuleName));
      policyInstance.setProperty("PolicyString", new CIMValue(PolicyString));
      logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "_createPolicyCIMInstance");
      return policyInstance;
    }
    else
    {
View Full Code Here

Examples of org.pegasus.jmpi.CIMInstance


          if(logger.isLoggable(Level.FINE))
            logger.fine(Thread.currentThread().getName()+" Actuator::Modify instance :cop"+cop);

          CIMInstance cimInstance= null;
          try{
            cimInstance=handle.getInstance(cop, true, true, true, null);
          }
          catch(CIMException e){
            logger.severe(Thread.currentThread().getName()+" "+"instance does not belong to Anchor Class, might be of an extension of Anchor class, no action will be taken on it. "+e.getMessage());
            throw new SPLException("instance does not belong to Anchor Class, might be of an extension of Anchor class, no action will be taken on it. "+e.getMessage());

          }
          if(cimInstance != null){

            if(logger.isLoggable(Level.FINE))
              logger.fine(Thread.currentThread().getName()+" done setting all properties");
            Vector instanceProperties=generateModifiedPropertiesVector(cimInstance, properties);
            cimInstance.setProperty(instanceProperties);
            handle.modifyInstance(cop, cimInstance, true, null);
            if(logger.isLoggable(Level.FINE))
              logger.fine(Thread.currentThread().getName()+" done modifying CIMInstance");
            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "modifyInstance");
          }
View Full Code Here

Examples of org.sblim.wbem.cim.CIMInstance

    {
    //  CIMObjectPath cimObjectPath= new CIMObjectPath(className,namespc);
    //  CIMObjectPath cop1=(CIMObjectPath)cop;
    //  cimObjectPath.setKeys(cop1.getKeys());
      try{
        CIMInstance ci=_handle.getInstance((CIMObjectPath)cop, true, true, true, null);
        Map instanceProperties=new HashMap();
        //get all properties of the current instance
        Vector properties=ci.getAllProperties();
        for(int i=0;i<properties.size();i++)
        {
          //add property to HashMap as (class.name,value) pair
          CIMProperty cimproperty=(CIMProperty) properties.get(i);
          String qualifiedPropertyName=  cimproperty.getName();
View Full Code Here

Examples of org.sblim.wbem.cim.CIMInstance

    CIMObjectPath cop = new CIMObjectPath("CIM_SPLPolicyRule");
    cop.setNameSpace("root/cimv2");
    Enumeration enm = _cimClient.enumerateInstances(cop, true, true, true, true, null);
    while (enm.hasMoreElements ())
        {
           CIMInstance cimInstance = (CIMInstance)enm.nextElement ();
           CIMProperty cimProperty = cimInstance.getProperty("PolicyString");
           CIMValue policyStringCimValue = cimProperty.getValue();
         String policyString = policyStringCimValue.toString();
        
         CIMProperty cimProperty2 = cimInstance.getProperty("PolicyRuleName");
         CIMValue policyRuleCimValue = cimProperty2.getValue();
       String policyName = policyRuleCimValue.toString();
         System.out.println("----------------------------");
         System.out.println("Policy Name: " + policyName);
         System.out.println("Policy String: " + policyString);
View Full Code Here

Examples of org.sblim.wbem.cim.CIMInstance

        kvp.addElement (new CIMProperty ("PolicyRuleName", new CIMValue (policyName,strType)));
       
        CIMObjectPath cop = new CIMObjectPath ("CIM_SPLPolicyRule", kvp);
        cop.setNameSpace ("root/cimv2");
       
      CIMInstance cimInstance = _cimClient.getInstance(cop, localOnly);

     
      cimInstance.setProperty("PolicyString", policyStringCimValue);
      
     
    _cimClient.setInstance(cop, cimInstance, true, null);
   
   
View Full Code Here

Examples of org.sblim.wbem.cim.CIMInstance

    CIMDataType strType = new CIMDataType(CIMDataType.STRING);
    CIMValue policyNameCimValue = new CIMValue (policyName,strType);
   
    cop.addKey("PolicyRuleName", policyNameCimValue);
    
    CIMInstance cimInstance = _cimClient.getInstance(cop, localOnly);
    
    CIMProperty cimProperty = cimInstance.getProperty("PolicyString");
    CIMValue policyStringCimValue = cimProperty.getValue();
    String policyString = policyStringCimValue.toString();
    System.out.println("Policy String: " + policyString);
        return policyString;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.