Examples of CIMObjectPath


Examples of org.sblim.wbem.cim.CIMObjectPath

          logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "classNameMatchesString");
          //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.CIMObjectPath

          String resultInstancesClassFilter, String assocClass,
          String role, String resultRole) throws SPLException
      {
          logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getAssociatedInstanceReferences");
         
          CIMObjectPath srcRef=(CIMObjectPath)srcReference;
          String className=srcRef.getObjectName();
           
          if(logger.isLoggable(Level.FINE))
          { 
              logger.fine(className+" "+classPath+" "+resultInstancesClassFilter+" "
                  + assocClass+" "+role+" "+ resultRole+" "+ srcReference.toString());
          }   
         
         
          if(className!=null && classPath!=null)
          {
            try
            {
             
              List instanceREFList = new ArrayList();
              //check to see if the association exists
              if(logger.isLoggable(Level.FINE))
                logger.fine(Thread.currentThread().getName()+" check to see if the association exists");
              if(associationExists(className ,classPath,resultInstancesClassFilter,assocClass,role,resultRole))
              {
                 
                  //create cop of anchor object
                CIMObjectPath cop=new CIMObjectPath(className,classPath);
                cop.setKeys(srcRef.getKeys());
                  //add keys of the source instance to the cop
                 
                if(logger.isLoggable(Level.FINE))
                  logger.fine(Thread.currentThread().getName()+" Anchor Object cop "+cop);
               
View Full Code Here

Examples of org.sblim.wbem.cim.CIMObjectPath

    }

        public boolean isInstance(String className, Object instance)
                throws SPLException
        {
            CIMObjectPath cop = (CIMObjectPath)instance;
            String instClassName = cop.getObjectName();
            if(className.equals(instClassName))
                return true;
            return false;
        }
View Full Code Here

Examples of org.sblim.wbem.cim.CIMObjectPath

  }
 
  public void executePolicy(String policyName) throws CIMException
  {
    CIMValue result = null;
    CIMObjectPath cimObjectPath = new CIMObjectPath("CIM_SPLPolicyRule");
      CIMNameSpace clientNameSpace = _cimClient.getNameSpace();
      cimObjectPath.setNameSpace(clientNameSpace.getNameSpace());
      cimObjectPath.setHost(clientNameSpace.getHost());
      System.out.println("cimObjectPath : "+cimObjectPath.toString());
     
      CIMDataType strType = new CIMDataType(CIMDataType.STRING);
    CIMValue policyNameCimValue = new CIMValue (policyName,strType);
     
      cimObjectPath.addKey("PolicyRuleName", policyNameCimValue);
      if(_cimClient.getInstance(cimObjectPath, true, true, true, null) != null)
      {
        System.out.println("before invoke method, cimObjectPath : "+cimObjectPath.toString());
       
        result = _cimClient.invokeMethod(cimObjectPath, "evaluatePolicy",
            (Vector)null, (Vector)null);
       
//        result = _cimClient.invokeMethod(cimObjectPath, "evaluatePolicy",
View Full Code Here

Examples of org.sblim.wbem.cim.CIMObjectPath

   
  }

  public void deletePolicy(String policyName) throws CIMException
  {
    CIMObjectPath cimObjectPath = new CIMObjectPath("CIM_SPLPolicyRule");
      CIMNameSpace clientNameSpace = _cimClient.getNameSpace();
      cimObjectPath.setNameSpace(clientNameSpace.getNameSpace());
      cimObjectPath.setHost(clientNameSpace.getHost());
     
      CIMDataType strType = new CIMDataType(CIMDataType.STRING);
    CIMValue policyNameCimValue = new CIMValue (policyName,strType);
   
      cimObjectPath.addKey("PolicyRuleName", policyNameCimValue);
        
    _cimClient.deleteInstance(cimObjectPath);
   
  }
View Full Code Here

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

Examples of org.sblim.wbem.cim.CIMObjectPath

   
  }

  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

Examples of org.sblim.wbem.cim.CIMObjectPath

    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

Examples of org.sblim.wbem.cim.CIMObjectPath

  }

  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

Examples of org.sblim.wbem.cim.CIMObjectPath

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