Package org.pegasus.jmpi

Examples of org.pegasus.jmpi.CIMObjectPath


  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


  throws SPLException
  {
    logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getInstanceMap");
    if(cop instanceof CIMObjectPath)
    {
      CIMObjectPath cimObjectPath= new CIMObjectPath(className,namespc);
      CIMObjectPath cop1=(CIMObjectPath)cop;
      cimObjectPath.setKeys(cop1.getKeys());
      try{
        CIMInstance ci=_handle.getInstance(cimObjectPath, true, true, true, null);
        Map instanceProperties=new HashMap();
        //get all properties of the current instance
        Vector properties=ci.getProperties();
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{
      CIMClass associationClass=_handle.getClass(cop, true, true, true, null);
      if(logger.isLoggable(Level.FINE))
View Full Code Here

  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

  public List getAssociatedInstanceReferences(Object srcReference, String classPath, String resultInstancesClassFilter, String assocClass, String role, String resultRole) throws SPLException {
    logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getAssociatedInstanceReferences");
    if(logger.isLoggable(Level.FINE))
      logger.fine(Thread.currentThread().getName()+" String className, String classPath, String resultInstancesClassFilter, String assocClass, String role, String resultRole,Map keys");
    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)){
          //System.out.println("association exists");
          //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);



          CIMObjectPath copAssociationClass=new CIMObjectPath(assocClass,classPath);

          //enumerating all instances of associaation class
          Enumeration instancesOfAssociation=_handle.enumerateInstances(copAssociationClass, true, true, true, true, null);
          //iterating over all instances of association class
          while(instancesOfAssociation.hasMoreElements()){
            CIMInstance inst=(CIMInstance)instancesOfAssociation.nextElement();
            //check to see if the source instance is same as current Anchor Object

            CIMProperty srcinstcop=inst.getProperty(role);//this will return partial cop of src instance
            CIMObjectPath copSrcInstFull=CIMObjectPath.toCop(srcinstcop.getValue().getValue().toString());
            if(logger.isLoggable(Level.FINE))
              logger.fine(Thread.currentThread().getName()+" Anchor cop "+cop);
            if(equalCOP(copSrcInstFull,cop)){
              //get and add associated result instance to vector
              CIMProperty cimprop=inst.getProperty(resultRole);
              CIMObjectPath coop= CIMObjectPath.toCop(cimprop.getValue().getValue().toString());
              CIMObjectPath copAssociatedInstance=new CIMObjectPath(resultInstancesClassFilter,classPath);
              copAssociatedInstance.setKeys(coop.getKeys());
              //Reference ref=new Reference(copAssociatedInstance.toString());
              instanceREFList.add(copAssociatedInstance);

            }
            else{
View Full Code Here

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

    return false;
View Full Code Here

  public static String getReferenceTypeName(String reference)
  {

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

    return referenceType;
  }
View Full Code Here

    try
    {
      boolean instcreated = _policyManager.createPolicy(pi.getPolicyRuleName(),pi.getPolicyString());
      if(instcreated)
      {
        CIMObjectPath cimop=_createPolicyObjectPath(pi.getPolicyRuleName());
        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+"createInstance");
        return cimop;
      }
      else
      {
View Full Code Here

TOP

Related Classes of org.pegasus.jmpi.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.