Package org.sblim.wbem.cim

Examples of org.sblim.wbem.cim.CIMObjectPath


   
  }

  public void listAllPolicyNames() throws CIMException
  {
    CIMObjectPath cop = new CIMObjectPath("CIM_SPLPolicyRule");
    cop.setNameSpace("root/cimv2");
    Enumeration enm = _cimClient.enumerateInstanceNames(cop);
   
    while (enm.hasMoreElements ())
        {
      CIMObjectPath cimObjectPath = (CIMObjectPath)enm.nextElement ();
          
         System.out.println("----------------------------");
         System.out.println("Policy : " + cimObjectPath);
         System.out.println("----------------------------");
        }
View Full Code Here


   
  }

  public void listAllPolicies() throws CIMException
  {
    CIMObjectPath cop = new CIMObjectPath("CIM_SPLPolicyRule");
    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");
View Full Code Here

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

     
      cimInstance.setProperty("PolicyString", policyStringCimValue);
View Full Code Here

  }

  public String listPolicy(String policyName) throws CIMException
  {
    boolean localOnly = true;
    CIMObjectPath cop=new CIMObjectPath("CIM_SPLPolicyRule","root/cimv2");
   
    CIMDataType strType = new CIMDataType(CIMDataType.STRING);
    CIMValue policyNameCimValue = new CIMValue (policyName,strType);
   
    cop.addKey("PolicyRuleName", policyNameCimValue);
    
    CIMInstance cimInstance = _cimClient.getInstance(cop, localOnly);
    
    CIMProperty cimProperty = cimInstance.getProperty("PolicyString");
    CIMValue policyStringCimValue = cimProperty.getValue();
View Full Code Here

     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);
         ci.setObjectPath (cop);
         CIMObjectPath returnpath=_cimClient.createInstance(ci.getObjectPath(), ci);
     System.out.println("returnpath :"+returnpath);
   
   
  }
View Full Code Here

  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

    {
      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

    {
      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

        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

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

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.