Package org.sblim.wbem.cim

Examples of org.sblim.wbem.cim.CIMProperty


  {
    Vector properties=_getPropertiesOfClass(cimClass ,classPath );

    for(int i=0;i<properties.size();i++)
    {
      CIMProperty cimproperty=(CIMProperty) properties.get(i);
      String qualifiedPropertyName=  cimproperty.getName();
      if(logger.isLoggable(Level.FINE))
        logger.fine(Thread.currentThread().getName()+" PropertyName "+cimproperty.getName().toLowerCase());
      if(logger.isLoggable(Level.FINE))
        logger.fine(Thread.currentThread().getName()+" qualifiedPropertyName "+qualifiedPropertyName);
//      //add the property to the HashMap as(class.propertyName, PropertySymbol)
      if( ! symbols.containsKey(qualifiedPropertyName))
      {

        int type=CIMSPLTypeConstants.convertCIMTypeToInternalType(cimproperty.getType().getType());
        String referenceTypeName="";
        if(type == TypeConstants.referenceType)
        {
          String path=(String)cimproperty.getValue().getValue();
          //the property is a CIMObjectPath
          referenceTypeName=CIMSPLTypeConstants.getReferenceTypeName(path);
        }
        boolean isArray = CIMSPLTypeConstants.getIsArray(cimproperty.getType().getType());

        if(logger.isLoggable(Level.FINE))
          logger.fine(Thread.currentThread().getName()+" symboltable does not currently contain the given property, so creating property symbol");
        Symbol symbol = new PropertySymbol(qualifiedPropertyName,type,referenceTypeName,isArray,_isKey(cimproperty),true);
        //add property to properties list
        if(logger.isLoggable(Level.FINE))
          logger.fine(Thread.currentThread().getName()+" adding property to Map in datacollector : "+qualifiedPropertyName);
        symbols.put(qualifiedPropertyName, symbol);

      }
      else
      {
        if(logger.isLoggable(Level.FINE))
          logger.fine(Thread.currentThread().getName()+" symboltable already contains the given symbol "+cimproperty.getName().toLowerCase());
        logger.severe(qualifiedPropertyName+" symbol Already exists in SymbolTable");
        throw new SPLException("symbol Already exists in SymbolTable");
      }

    }
View Full Code Here


        //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();
          instanceProperties.put(qualifiedPropertyName, cimproperty.getValue().getValue());
        }
        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getInstanceMap");

        return instanceProperties;
      }
View Full Code Here

    Iterator it=properties.iterator();
    String superClass=cimclass.getSuperClass();

    while(it.hasNext())
    {
      CIMProperty cimProp=(CIMProperty)it.next();
      //System.out.println("cimProp "+cimProp.toString());
      String propName=cimProp.getName();
      //System.out.println("propName "+propName);

      propertyNames.add(propName);

    }
    superClass=cimclass.getSuperClass();

    while((superClass!= null)&&(superClass!= "")&&(superClass.length()!=0))
    {
      CIMObjectPath cop=new CIMObjectPath(superClass,classPath);
      cimclass=_handle.getClass(cop, true, true, true, null);

      Vector propertiesSuper=cimclass.getAllProperties();
      Iterator proppertiesSuperIt=propertiesSuper.iterator();
      while(proppertiesSuperIt.hasNext())
      {
        CIMProperty cimProp=(CIMProperty)proppertiesSuperIt.next();
        if (!propertyNames.contains(cimProp.getName()))
        {
          properties.add(cimProp);
          String propName=cimProp.getName();
          propertyNames.add(propName);
          if(logger.isLoggable(Level.FINE))
            logger.fine(cimProp.getName()+"new superclass property found "+cimProp.getName());


        }
        else
        {
          if(logger.isLoggable(Level.FINE))
            logger.fine(cimProp.getName()+"already exists ,Super class variable ignored");

        }

      }
      superClass=cimclass.getSuperClass();
View Full Code Here

              if(isAssoc)
              {
                           
                  if(logger.isLoggable(Level.FINE))
                      logger.fine(Thread.currentThread().getName()+" class is an association");
                  CIMProperty srcProperty=associationClass.getProperty(role);
                             
                  if(logger.isLoggable(Level.FINE))
                      logger.fine(Thread.currentThread().getName()+" check to see if the role played by src class is correct");
                  if(logger.isLoggable(Level.FINE))
                      logger.fine(Thread.currentThread().getName()+" src RefClassName(),className::"+
                          srcProperty.getOriginClass()+" "+className);
                  //check to see if the role played by src class is correct
                 
                  if(_classNameMatchesString(srcProperty.getType().getRefClassName().trim(), classPath, className))
                  {
                 
                      CIMProperty resultProperty=associationClass.getProperty(resultRole);
                                       
                      if(logger.isLoggable(Level.FINE))
                          logger.fine(Thread.currentThread().getName()+" check to see if role played by result class is corrrect");
                      if(logger.isLoggable(Level.FINE))
                          logger.fine(Thread.currentThread().getName()+" result RefClassName(),className::"+
                              resultProperty.getType().getRefClassName()+" "+resultClass);
                     
                      //check to see if role played by result class is corrrect
                      if(_classNameMatchesString(resultProperty.getType().getRefClassName().trim(), classPath, resultClass))
                      {
                                             
                          if(logger.isLoggable(Level.FINE))
                              logger.fine(Thread.currentThread().getName()+" associationExists returning true");
                         
                          logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "associationExists");
                          return true;
                      }
                      else
                      {
                                           
                          if(logger.isLoggable(Level.FINE))
                              logger.fine(Thread.currentThread().getName()+" associationExists returning false " +
                                  "because of resultClass "+resultClass+ " "+resultProperty.getType().getRefClassName());
                         
                          logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "associationExists");
                          return false;
                      }
                  }
View Full Code Here

    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);
         System.out.println("----------------------------");
View Full Code Here

    boolean localOnly = true;
    Vector kvp = new Vector ();
    CIMDataType strType = new CIMDataType(CIMDataType.STRING);
    CIMValue policyStringCimValue = new CIMValue (policyString,strType);
   
        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);
View Full Code Here

   
    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

     CIMDataType strType = new CIMDataType(CIMDataType.STRING);
     CIMValue policyNameCimValue = new CIMValue (policyName,strType);
    
     CIMValue policyStringCimValue = new CIMValue(policyString,strType);

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

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

         CIMInstance ci = new CIMInstance (cop);
View Full Code Here

              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

Related Classes of org.sblim.wbem.cim.CIMProperty

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.