Examples of CIMObjectPath


Examples of org.sblim.wbem.cim.CIMObjectPath

  public Object invokeMethod(String className,String namespace,Object instance,String methodName, List inParameterValues) throws SPLException {
    logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "invokeMethod");

    Vector inParams=new Vector();
    Vector outParams=new Vector();
    CIMObjectPath cop=new CIMObjectPath(className,namespace);

    if(className!=null && namespace!=null){
      try
      {

        Iterator it=inParameterValues.iterator();
        Map cimArgNameValuePairs= new HashMap();
        while(it.hasNext())
        {
          Argument arg=(Argument)it.next();
          cimArgNameValuePairs.put(arg.getName(), arg.getValue());
          //System.out.println(" added to cimArgNameValuePairs : "+arg.getName()+ " "+arg.getValue().toString());
        }
       
       


        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();
            int type=cimparameter.getType().getType();
            //boolean isArray=cimparameter.isArray();
            //System.out.println("parameter name = "+parameterName);
            Object paramValue=cimArgNameValuePairs.get(parameterName);
            if(paramValue!=null){
             

              CIMValue cv=getCIMObjectOfGivenType(type, paramValue);
              //System.out.println("parameter value = "+paramValue+ " "+cv.toString());
              //new CIMArgument(parameterName,cv);
              inParams.add(new CIMArgument(parameterName,cv));
            }
           
            else
            {
              //System.out.println("value = null");
            }

          }

          if(logger.isLoggable(Level.FINE))
            logger.fine(Thread.currentThread().getName()+" Actuator::invokeMethod:invoking method "+methodName);
          CIMObjectPath instanceCop=new CIMObjectPath(className,namespace);
          instanceCop.setKeys(cop.getKeys());
         
          //System.out.println("cop, methodName :"+instanceCop+" "+ methodName);
          CIMValue cv=handle.invokeMethod(instanceCop, methodName, inParams, outParams);
          //System.out.println("invokeMethod complete : return value="+cv.getValue());
          if(logger.isLoggable(Level.FINE))
View Full Code Here

Examples of org.sblim.wbem.cim.CIMObjectPath

    {
      try
      {
        if(instance instanceof CIMObjectPath)
        {
          CIMObjectPath copTemp=(CIMObjectPath)instance;
          CIMObjectPath cop=new CIMObjectPath(className,namespace);
          cop.setKeys(copTemp.getKeys());


          if(logger.isLoggable(Level.FINE))
            logger.fine(Thread.currentThread().getName()+" Actuator::Modify instance :cop"+cop);
View Full Code Here

Examples of org.sblim.wbem.cim.CIMObjectPath

    {
      Map objMap = new Hashtable();
     
      String className=(String)classit.next();
      String nameSpace=(String)classQuaifierMap.get(className);
      CIMObjectPath classCop=new CIMObjectPath(className,nameSpace);
      Enumeration copEnum=null;
      try{
        copEnum=_client.enumerateInstanceNames(classCop);
        if(logger.isLoggable(Level.FINE))
          logger.fine(Thread.currentThread().getName()+" enumerating instances of :"+classCop);
       
      }catch(CIMException e){
        System.out.println("caught a CIMException "+e.getMessage());
        e.printStackTrace();
      }
      if(logger.isLoggable(Level.FINE))
        logger.fine(Thread.currentThread().getName()+" iteratig over instances of :"+classCop);
     
      while(copEnum.hasMoreElements())
      {
       
        CIMObjectPath copI=(CIMObjectPath)copEnum.nextElement();
        System.out.println("instance objectpath= "+copI.toString());

        String objectName=copI.getObjectName();

        if(objectName.equalsIgnoreCase(className))
        {

          if(logger.isLoggable(Level.FINE))
            logger.fine(Thread.currentThread().getName()+" object name matches classname :"+objectName +" "+className);
         
        //  InstanceInfo iI=new InstanceInfo(objectName,copI);


          //List instanceInfoList = new ArrayList();
          //instanceInfoList.add(iI);

          objMap.put(objectName, copI);





          retVal=(Integer)_policyManager.evaluatePolicy(policyName,objMap);
          if (logger.isLoggable(Level.FINE))
            logger
            .fine(Thread.currentThread().getName()+" return value is = "+retVal);

          System.out.println(" policy evaluation complete "+ policyName +" on "+copI.toString()+" and return value= "+retVal);
          objMap.remove(objectName);

          logger.exiting(sourceClass,Thread.currentThread().getName()+" "+"invokeMethod");

        }
View Full Code Here

Examples of org.sblim.wbem.cim.CIMObjectPath

        sessionId.toCharArray());

    CIMNameSpace ns = new CIMNameSpace(
        cimAgentAddress, namespace);
    CIMClient cimClient = new CIMClient(ns, userPr, pwCred);
    CIMObjectPath rpCOP = new CIMObjectPath(
        "CIM_RegisteredProfile");

    System.out.println("Looking for children of " +
        "CIM_RegisteredProfile");
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.