Examples of CIMInstance


Examples of org.sblim.wbem.cim.CIMInstance

         kvp.addElement (new CIMProperty ("PolicyString", policyStringCimValue));

         CIMObjectPath cop = new CIMObjectPath ("CIM_SPLPolicyRule", kvp);
         cop.setNameSpace ("root/cimv2");

         CIMInstance ci = new CIMInstance (cop);
         ci.setObjectPath (cop);
         CIMObjectPath returnpath=_cimClient.createInstance(ci.getObjectPath(), ci);
     System.out.println("returnpath :"+returnpath);
   
   
  }
View Full Code Here

Examples of org.sblim.wbem.cim.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)
          {
            Vector modifiedProperties = new Vector();
           
            Vector instanceProperties = cimInstance.getAllProperties();
            Set propertyNames = properties.keySet();
            Iterator propertyIterator = propertyNames.iterator();
            while(propertyIterator.hasNext())
            {
              String keyName = (String)propertyIterator.next();
              Object keyValue = properties.get(keyName);
              Iterator instancePropertyIterator = instanceProperties.iterator();

              while(instancePropertyIterator.hasNext())
              {
                CIMProperty cimprop=(CIMProperty)instancePropertyIterator.next();
                String name=cimprop.getName();
                int type=cimprop.getType().getType();
              //  boolean isArray=cimprop.isArray();
                CIMValue instValue=cimprop.getValue();
                if(cimprop.getName().equalsIgnoreCase(keyName))
                {
                  Object cimKeyValue = keyValue;
                  if(logger.isLoggable(Level.FINE))
                    logger.fine(Thread.currentThread().getName()+
                        " Instance property:: Name,Type,Value,CIMKeyValue :"+name+" "+type+" "
                          +instValue+" "+ cimKeyValue.getClass());

                  CIMValue cimval = getCIMObjectOfGivenType(type,cimKeyValue);


                  cimprop.setValue(cimval);
                  handle.setProperty(cimInstance.getObjectPath(), keyName, cimval);
                  modifiedProperties.add(cimprop);
                  if(logger.isLoggable(Level.FINE))
                    logger.fine(Thread.currentThread().getName()+" cimprop set to cimValue "+cimval.getValue());
                }
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.