(file) Return to JMPIProviderManager.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2 / JMPI

Diff for /pegasus/src/Pegasus/ProviderManager2/JMPI/JMPIProviderManager.cpp between version 1.51 and 1.52

version 1.51, 2006/05/24 20:42:21 version 1.52, 2006/06/21 21:54:56
Line 55 
Line 55 
 #include <Pegasus/ProviderManager2/JMPI/JMPIProviderModule.h> #include <Pegasus/ProviderManager2/JMPI/JMPIProviderModule.h>
 #include <Pegasus/ProviderManager2/ProviderManagerService.h> #include <Pegasus/ProviderManager2/ProviderManagerService.h>
  
 #include <Pegasus/ProviderManager2/CMPI/CMPI_SelectExp.h>  
   
   
 PEGASUS_USING_STD; PEGASUS_USING_STD;
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 6252 
Line 6249 
     return 0;     return 0;
 } }
  
 CMPI_SelectExp *  WQLSelectStatement *
 newSelectExp (CIMOMHandleQueryContext *qContext,  newSelectExp (String& query,
               OperationContext        *ctx,                String& queryLanguage)
               String&                  query,  
               String&                  queryLanguage,  
               CIMNamespaceName&        nameSpace,  
               Array<CIMName>&          classNames,  
               CIMPropertyList&         propertyList)  
 { {
    CMPI_SelectExp *eSelx = NULL;     WQLSelectStatement *stmt = new WQLSelectStatement (queryLanguage, query);
  
    eSelx = new CMPI_SelectExp (*ctx,     try
                                qContext,  
                                query,  
                                queryLanguage);  
   
    if (!eSelx)  
    {    {
       return eSelx;        WQLParser::parse (query, *stmt);
    }    }
      catch (const Exception &e)
    for (Uint32 i = 0, n = classNames.size (); i < n; i++)  
    {    {
        CIMObjectPath className (System::getHostName(),        cerr << "Error: newSelectExp caught: " << e.getMessage () << endl;
                                 nameSpace,  
                                 classNames[i]);  
   
        eSelx->classNames.append (className);  
    }  
   
    if (!propertyList.isNull ())  
    {  
       Array<CIMName> p      = propertyList.getPropertyNameArray ();  
       int            pCount = p.size ();  
   
       eSelx->props = (const char**)malloc ((1 + pCount) * sizeof (char*));  
   
       for (int i = 0; i < pCount; i++)  
       {  
          eSelx->props[i] = strdup (p[i].getString ().getCString ());  
       }  
   
       eSelx->props[pCount] = NULL;  
    }    }
  
    return eSelx;     return stmt;
 } }
  
 Message * JMPIProviderManager::handleCreateSubscriptionRequest(const Message * message) throw() Message * JMPIProviderManager::handleCreateSubscriptionRequest(const Message * message) throw()
Line 6421 
Line 6388 
  
            CIMOMHandleQueryContext *qContext = new CIMOMHandleQueryContext (CIMNamespaceName (request->nameSpace.getString ()),            CIMOMHandleQueryContext *qContext = new CIMOMHandleQueryContext (CIMNamespaceName (request->nameSpace.getString ()),
                                                                             *pr._cimom_handle);                                                                             *pr._cimom_handle);
            CMPI_SelectExp          *eSelx    = newSelectExp (qContext,  
                                                              prec->ctx,  
                                                              srec->query,  
                                                              srec->queryLanguage,  
                                                              request->nameSpace,  
                                                              request->classNames,  
                                                              srec->propertyList);  
   
            srec->eSelx    = eSelx;  
            srec->qContext = qContext;            srec->qContext = qContext;
  
            CIMObjectPath sPath (request->subscriptionInstance.getPath ().getClassName ().getString ());            CIMObjectPath sPath (request->subscriptionInstance.getPath ().getClassName ().getString ());
Line 6442 
Line 6400 
  
            selxTab.insert (sPath.toString (), srec);            selxTab.insert (sPath.toString (), srec);
  
            DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: For selxTab "<<sPath.toString ()<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", eSelx = "<<PEGASUS_STD(hex)<<(int)eSelx<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleCreateSubscriptionRequest: For selxTab "<<sPath.toString ()<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));
         }         }
  
         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.createSubscriptionRequest: " + pr.getName());         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, "Calling provider.createSubscriptionRequest: " + pr.getName());
Line 6531 
Line 6489 
         {         {
         case METHOD_EVENTPROVIDER:         case METHOD_EVENTPROVIDER:
         {         {
             CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,              WQLSelectStatement *stmt       = newSelectExp (srec->query,
                                                       prec->ctx,                                                             srec->queryLanguage);
                                                       srec->query,              jint                jStmtRef   = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, stmt);
                                                       srec->queryLanguage,              jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jStmtRef);
                                                       request->nameSpace,  
                                                       request->classNames,  
                                                       srec->propertyList);  
             jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);  
             jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 6557 
Line 6510 
  
             env->CallVoidMethod ((jobject)pr.jProvider,             env->CallVoidMethod ((jobject)pr.jProvider,
                                  id,                                  id,
                                  jEselx,                                   jSelectExp,
                                  jType,                                  jType,
                                  jcop,                                  jcop,
                                  (jboolean)fNewPrec);                                  (jboolean)fNewPrec);
Line 6573 
Line 6526 
             jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);             jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
             jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);             jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
  
             CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,              WQLSelectStatement *stmt       = newSelectExp (srec->query,
                                                       prec->ctx,                                                             srec->queryLanguage);
                                                       srec->query,              jint                jStmtRef   = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, stmt);
                                                       srec->queryLanguage,              jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jStmtRef);
                                                       request->nameSpace,  
                                                       request->classNames,  
                                                       srec->propertyList);  
             jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);  
             jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 6600 
Line 6548 
             env->CallVoidMethod ((jobject)pr.jProvider,             env->CallVoidMethod ((jobject)pr.jProvider,
                                  id,                                  id,
                                  joc,                                  joc,
                                  jEselx,                                   jSelectExp,
                                  jType,                                  jType,
                                  jcop,                                  jcop,
                                  (jboolean)fNewPrec);                                  (jboolean)fNewPrec);
Line 6726 
Line 6674 
  
            selxTab.lookup (sPathString, srec);            selxTab.lookup (sPathString, srec);
  
            DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: For selxTab "<<sPathString<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", eSelx = "<<PEGASUS_STD(hex)<<(int)srec->eSelx<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)srec->qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));             DDD(PEGASUS_STD(cout)<<"--- JMPIProviderManager::handleDeleteSubscriptionRequest: For selxTab "<<sPathString<<", srec = "<<PEGASUS_STD(hex)<<(int)srec<<PEGASUS_STD(dec)<<", qContext = "<<PEGASUS_STD(hex)<<(int)srec->qContext<<PEGASUS_STD(dec)<<PEGASUS_STD(endl));
  
            selxTab.remove (sPathString);            selxTab.remove (sPathString);
         }         }
Line 6817 
Line 6765 
         {         {
         case METHOD_EVENTPROVIDER:         case METHOD_EVENTPROVIDER:
         {         {
             CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,              WQLSelectStatement *stmt       = newSelectExp (srec->query,
                                                       prec->ctx,                                                             srec->queryLanguage);
                                                       srec->query,              jint                jStmtRef   = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, stmt);
                                                       srec->queryLanguage,              jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jStmtRef);
                                                       request->nameSpace,  
                                                       request->classNames,  
                                                       srec->propertyList);  
             jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);  
             jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 6843 
Line 6786 
  
             env->CallVoidMethod ((jobject)pr.jProvider,             env->CallVoidMethod ((jobject)pr.jProvider,
                                  id,                                  id,
                                  jEselx,                                   jSelectExp,
                                  jType,                                  jType,
                                  jcop,                                  jcop,
                                  (jboolean)fFreePrec);                                  (jboolean)fFreePrec);
Line 6859 
Line 6802 
             jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);             jint    jocRef = DEBUG_ConvertCToJava (OperationContext*, jint, &request->operationContext);
             jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);             jobject joc    = env->NewObject(jv->OperationContextClassRef,jv->OperationContextNewI,jocRef);
  
             CMPI_SelectExp *eSelx     = newSelectExp (srec->qContext,              WQLSelectStatement *stmt       = newSelectExp (srec->query,
                                                       prec->ctx,                                                             srec->queryLanguage);
                                                       srec->query,              jint                jStmtRef   = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, stmt);
                                                       srec->queryLanguage,              jobject             jSelectExp = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jStmtRef);
                                                       request->nameSpace,  
                                                       request->classNames,  
                                                       srec->propertyList);  
             jint            jEselxRef = DEBUG_ConvertCToJava (CMPI_SelectExp*, jint, eSelx);  
             jobject         jEselx    = env->NewObject(jv->SelectExpClassRef,jv->SelectExpNewI,jEselxRef);  
  
             JMPIjvm::checkException(env);             JMPIjvm::checkException(env);
  
Line 6886 
Line 6824 
             env->CallVoidMethod ((jobject)pr.jProvider,             env->CallVoidMethod ((jobject)pr.jProvider,
                                  id,                                  id,
                                  joc,                                  joc,
                                  jEselx,                                   jSelectExp,
                                  jType,                                  jType,
                                  jcop,                                  jcop,
                                  (jboolean)fFreePrec);                                  (jboolean)fFreePrec);
Line 6920 
Line 6858 
  
     if (srec)     if (srec)
     {     {
        if (  srec->eSelx  
           && srec->eSelx->props  
           )  
        {  
           const char **props = srec->eSelx->props;  
   
           while (*props)  
           {  
              const char *prop = *props;  
   
              props++;  
   
              if (prop)  
              {  
                 free ((void *)prop);  
              }  
           }  
   
           free ((void *)srec->eSelx->props);  
        }  
        delete srec->eSelx;  
        delete srec->qContext;        delete srec->qContext;
     }     }
     delete srec;     delete srec;


Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2