Package org.pegasus.jmpi

Examples of org.pegasus.jmpi.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);
              }

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

        return instanceProperties;
      }
View Full Code Here

    Vector properties=cimclass.getProperties();
    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

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

    Vector keys2=cop2.getKeys();
    Iterator it=keys1.iterator();
    Iterator it2=keys2.iterator();
    while(it.hasNext() && it2.hasNext())
    {
      CIMProperty prop=(CIMProperty)it.next();
      CIMProperty prop2=(CIMProperty)it2.next();
      String propertyname=prop.getName();
      String propertyname2=prop2.getName();
      CIMValue cimv1=prop.getValue();
      CIMValue cimv2=prop2.getValue();
      try
      {
        //System.out.println(" "+propertyname+" "+propertyname2+" "+cimv1.getValue()+" "+cimv2.getValue());
        if(!propertyname.equalsIgnoreCase(propertyname2))
        {
View Full Code Here

  private boolean validateAssociation(CIMClass associationClass,String className ,String classPath, String resultClass
      , String role, String resultRole) throws SPLException{
    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.getRefClassName()+" "+className);
    //check to see if the role played by src class is correct
    try{
      if(_classNameMatchesString(srcProperty.getRefClassName().toString().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.getRefClassName()+" "+resultClass);

        //check to see if role played by result class is corrrect
        if(_classNameMatchesString(resultProperty.getRefClassName().toString().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.getRefClassName());

          logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "associationExists");
          return false;
        }
      }
View Full Code Here

      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());
          try{


            CIMValue cimval=getCIMObjectOfGivenType(type, isArray, CIMKeyValue);


            cimprop.setValue(cimval);
            if(logger.isLoggable(Level.FINE))
              logger.fine(Thread.currentThread().getName()+" cimprop set to cimValue "+cimval.getValue());

          }
          catch(CIMException e){
View Full Code Here

        if(paramValue!=null)
        {
          CIMValue cv=getCIMObjectOfGivenType(type, isArray, paramValue);
          //System.out.println("parameter value = "+paramValue+ " "+cv.toString());
          inParams.add(new CIMProperty(parameterName,cv));
        }
        else
        {
          //System.out.println("value = null");
        }
View Full Code Here

TOP

Related Classes of org.pegasus.jmpi.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.