Package org.sblim.wbem.cim

Examples of org.sblim.wbem.cim.CIMClass


      //get class
      try
      {
        //System.out.println("_handle.getClass");

        CIMClass cimClass=_handle.getClass(cop, true, true, true, null);
        if(logger.isLoggable(Level.FINE))
          logger.fine(Thread.currentThread().getName()+" got class "+cimClass.getName());
        if(cimClass!=null)
        {
          if(logger.isLoggable(Level.FINE))
            logger.fine(Thread.currentThread().getName()+" get all the properties of the class and iterate over them");
          //System.out.println("get all the properties of the class and iterate over them");
View Full Code Here


//  }

  private static Vector _getPropertiesOfClass(CIMClass cimClass ,String classPath ) throws CIMException
  {
    logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getPropertiesOfClass");
    CIMClass cimclass=cimClass;
    Vector propertyNames=new Vector();
   
    Vector properties=cimclass.getAllProperties();
    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();
    }
    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getPropertiesOfClass");

    return properties;
  }
View Full Code Here

          if(logger.isLoggable(Level.FINE))
              logger.fine(Thread.currentThread().getName()+" associationExists::cop ::"+cop);
          try
          {
           
              CIMClass associationClass=_handle.getClass(cop, true, true, true, null);
                         
              if(logger.isLoggable(Level.FINE))
                  logger.fine(Thread.currentThread().getName()+" got class "+associationClass.getName());
              if(logger.isLoggable(Level.FINE))
                  logger.fine(Thread.currentThread().getName()+" check to see if the class is an association");
              //check to see if the class is an association
             
              boolean isAssoc=associationClass.isAssociation();
              if(logger.isLoggable(Level.FINE))
                  logger.fine(Thread.currentThread().getName()+" CIMClass, isAssociation()= "+
                      isAssoc+" "+associationClass.getAllProperties().toString());
              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::"+
View Full Code Here

          //CIMClass cimclass=cimClass;
          //Vector propertyNames=new Vector();
          System.out.println("associationExists ->classnm.equalsIgnoreCase(str) "+className+" "+namespace+" "+str);
           
          CIMObjectPath copOriginal=new CIMObjectPath(className,namespace);
          CIMClass cimclass=_handle.getClass(copOriginal, true, true, true, null);
          String classnm=cimclass.getName();
          String superClass=cimclass.getSuperClass();
          if(classnm.equalsIgnoreCase(str))
          {
                         
              if(logger.isLoggable(Level.FINE))
                  logger.fine(Thread.currentThread().getName()+" classNameMatchesString "+classnm+ " "+str);       
              logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "classNameMatchesString");
              return true;
          }
          else if(superClass!= null)
          {
              while((superClass!= "")&&(superClass.length()!=0))
              {
                  ////System.out.println("superclass "+superClass);
                  if(superClass.equalsIgnoreCase(str))
                  {
                                    
                      if(logger.isLoggable(Level.FINE))
                          logger.fine(Thread.currentThread().getName()+" classNameMatchesString "+superClass+ " "+str);       
                     
                      logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "classNameMatchesString");
                      return true;
                  }
                  else
                  {
                      if(logger.isLoggable(Level.FINE))
                          logger.fine(superClass+" did not Match "+str+" ,trying superclass");       
                     
                      CIMObjectPath cop=new CIMObjectPath(superClass,namespace);
                      cimclass=_handle.getClass(cop, true, true, true, null);                   
                      superClass=cimclass.getSuperClass();
                      if(logger.isLoggable(Level.FINE))
                          logger.fine(Thread.currentThread().getName()+" new superclass= "+superClass);       
                     
                  }
                 
View Full Code Here

        if(instance instanceof CIMObjectPath)
        {
          cop=(CIMObjectPath)instance;
          CIMObjectPath classCop=new CIMObjectPath(className,namespace);
          CIMClass cimclass=handle.getClass(classCop, true, true, true, null);

          CIMMethod cimMethod= cimclass.getMethod(methodName);
          Vector params = cimMethod.getParameters();
          for(int j=0;j<params.size();j++)
          {
            CIMParameter cimparameter=(CIMParameter)params.get(j);
            String parameterName=cimparameter.getName();
View Full Code Here

TOP

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

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.