Package org.sblim.wbem.cim

Examples of org.sblim.wbem.cim.CIMObjectPath


  public static String getReferenceTypeName(String reference)
  {

    //extract class name and return
    String referenceType = null;
    CIMObjectPath cop = new CIMObjectPath(reference);
    //CIMObjectPath cop=CIMObjectPath.toCop(reference);
    referenceType=cop.getObjectName();     

    return referenceType;
  }
View Full Code Here


  private void _populateClassMembers(String className,String classPath, Map symbolMap) throws SPLException
  {
    if(className!=null && classPath!=null)
    {
      CIMObjectPath cop=new CIMObjectPath(className,classPath);
      if(logger.isLoggable(Level.FINE))
        logger.fine(Thread.currentThread().getName()+" cop   "+cop);
      Map symbols=symbolMap;
      //get class
      try
View Full Code Here

    }
    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())
View Full Code Here

    else
    {
      formattedClass = className;
    }
    //System.out.println("formatted class" + formattedClass);
    CIMObjectPath classCop=new CIMObjectPath(formattedClass,namespace);
    List instanceList=new ArrayList();
    try{
      Enumeration instanceEnumeration=_handle.enumerateInstanceNames(classCop);
      while(instanceEnumeration.hasMoreElements())
      {
View Full Code Here

  public boolean associationExists(String className ,String classPath, String resultClass,
         String assocClass, String role, String resultRole) throws SPLException
  {
          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
          {
           
View Full Code Here

          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

          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

    }

        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

  }
 
  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

   
  }

  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

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.