Examples of CIMClass


Examples of org.pegasus.jmpi.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");
          //get all the properties of the class and iterate over them

          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");
            }

          }
          if(logger.isLoggable(Level.FINE))
            logger.fine(Thread.currentThread().getName()+" done adding all the properties");
          if(logger.isLoggable(Level.FINE))
            logger.fine(Thread.currentThread().getName()+" get all methods of the class and iterate over them");






          //get all methods of the class and iterate over them
          for(int i=0;i<cimclass.getMethodCount();i++)
          {
            CIMMethod cimMethod= cimclass.getMethod(i);

            if(logger.isLoggable(Level.FINE))
              logger.fine(Thread.currentThread().getName()+" method : "+cimMethod.getName()+ " Parameter count "+cimMethod.getParameterCount()+" is of type "+cimMethod.getType());
//            //ArrayList argTypeList=new ArrayList ();
            List methodArgs=new ArrayList();
            SPLSymbolTable methodArgsSymbolTable=new SPLSymbolTable();

            for(int j=0;j<cimMethod.getParameterCount();j++)
            {
              CIMParameter cimparameter=cimMethod.getParameter(j);
              String parameterName=cimparameter.getName();
              boolean isArr=cimparameter.isArray();
              int type=CIMSPLTypeConstants.convertCIMTypeToInternalType(cimparameter.getType().getType());

              String referenceTypeName="";

              if(type == TypeConstants.referenceType)
              { 
                referenceTypeName = CIMSPLTypeConstants.getReferenceTypeName(cimparameter.getReferenceClassName());
              }
              Argument arg=new ArgumentImpl(type, parameterName, isArr, referenceTypeName);

              methodArgsSymbolTable.insertVariableSymbol(parameterName, type, referenceTypeName, isArr, false, false);
              //System.out.println(" inserted variable symbol into methodArgsSymbolTable "+parameterName);
              methodArgs.add(arg);
            }
            String methodName=cimMethod.getName();
            if( ! symbols.containsKey(methodName))
            {
              int localReturnType=CIMSPLTypeConstants.convertCIMTypeToInternalType(cimMethod.getType());

              Symbol methodSymbol=new MethodSymbol(methodName,localReturnType,CIMSPLTypeConstants.getIsArray(localReturnType),cimclass.getName(),methodArgs,methodArgsSymbolTable);
              //add property to properties list
              if(logger.isLoggable(Level.FINE))
                logger.fine(Thread.currentThread().getName()+" adding method to symbol table" + methodName);
              symbols.put(methodName, methodSymbol);
            }
View Full Code Here

Examples of org.pegasus.jmpi.CIMClass

//  return null;
//  }

  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.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();
    }
    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getPropertiesOfClass");

    return properties;
  }
View Full Code Here

Examples of org.pegasus.jmpi.CIMClass

    logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "associationExists");
    CIMObjectPath cop=new CIMObjectPath(assocClass,classPath);
    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){
        boolean result=validateAssociation(associationClass,className ,classPath,resultClass, role, resultRole);
        return result;
      }
      else
View Full Code Here

Examples of org.pegasus.jmpi.CIMClass

  private static boolean _classNameMatchesString(String str,String namespace,String className ) throws CIMException{
    logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "classNameMatchesString");
    //CIMClass cimclass=cimClass;
    //Vector propertyNames=new Vector();
    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

Examples of org.pegasus.jmpi.CIMClass

        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);
          inParams=getMethodInputParams(cimMethod, cimArgNameValuePairs);
          if(logger.isLoggable(Level.FINE))
            logger.fine(Thread.currentThread().getName()+" Actuator::invokeMethod:invoking method "+methodName);

          CIMObjectPath instanceCop=new CIMObjectPath(className,namespace);
View Full Code Here

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

Examples of org.sblim.wbem.cim.CIMClass

//  }

  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

Examples of org.sblim.wbem.cim.CIMClass

          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

Examples of org.sblim.wbem.cim.CIMClass

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

Examples of org.sblim.wbem.cim.CIMClass

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