Package org.pegasus.jmpi

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


          //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

        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

        && (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

    {
      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


          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

TOP

Related Classes of org.pegasus.jmpi.CIMInstance

Copyright © 2018 www.massapicom. 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.