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

   1 martin 1.149 //%LICENSE////////////////////////////////////////////////////////////////
   2 martin 1.150 //
   3 martin 1.149 // Licensed to The Open Group (TOG) under one or more contributor license
   4              // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
   5              // this work for additional information regarding copyright ownership.
   6              // Each contributor licenses this file to you under the OpenPegasus Open
   7              // Source License; you may not use this file except in compliance with the
   8              // License.
   9 martin 1.150 //
  10 martin 1.149 // Permission is hereby granted, free of charge, to any person obtaining a
  11              // copy of this software and associated documentation files (the "Software"),
  12              // to deal in the Software without restriction, including without limitation
  13              // the rights to use, copy, modify, merge, publish, distribute, sublicense,
  14              // and/or sell copies of the Software, and to permit persons to whom the
  15              // Software is furnished to do so, subject to the following conditions:
  16 martin 1.150 //
  17 martin 1.149 // The above copyright notice and this permission notice shall be included
  18              // in all copies or substantial portions of the Software.
  19 martin 1.150 //
  20 martin 1.149 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  21 martin 1.150 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22 martin 1.149 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  23              // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  24              // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  25              // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  26              // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  27 martin 1.150 //
  28 martin 1.149 //////////////////////////////////////////////////////////////////////////
  29 marek  1.63  //
  30              //%/////////////////////////////////////////////////////////////////////////////
  31              
  32              #include "CMPI_Version.h"
  33              
  34              #include "CMPIProviderManager.h"
  35              
  36              #include "CMPI_Object.h"
  37              #include "CMPI_Instance.h"
  38              #include "CMPI_ObjectPath.h"
  39              #include "CMPI_Result.h"
  40              #include "CMPI_SelectExp.h"
  41 thilo.boehm 1.162 #include "CMPISCMOUtilities.h"
  42                   #include "CMPI_Value.h"
  43                   #include "CMPIMsgHandleManager.h"
  44                   
  45 marek       1.63  
  46                   #include <Pegasus/Common/CIMMessage.h>
  47                   #include <Pegasus/Common/OperationContext.h>
  48 a.dunfey    1.85  #include <Pegasus/Common/OperationContextInternal.h>
  49 marek       1.63  #include <Pegasus/Common/Tracer.h>
  50                   #include <Pegasus/Common/StatisticalData.h>
  51                   #include <Pegasus/Common/Logger.h>
  52 kumpf       1.79  #include <Pegasus/Common/LanguageParser.h>
  53 marek       1.63  #include <Pegasus/Common/MessageLoader.h> //l10n
  54                   #include <Pegasus/Common/Constants.h>
  55 thilo.boehm 1.89  #include <Pegasus/Common/FileSystem.h>
  56 marek       1.63  
  57                   #include <Pegasus/Config/ConfigManager.h>
  58                   
  59                   #include <Pegasus/Provider/CIMOMHandleQueryContext.h>
  60 a.dunfey    1.85  #include <Pegasus/ProviderManager2/CIMOMHandleContext.h>
  61 marek       1.63  #include <Pegasus/ProviderManager2/ProviderName.h>
  62 kumpf       1.93  #include <Pegasus/ProviderManager2/AutoPThreadSecurity.h>
  63 marek       1.63  #include <Pegasus/ProviderManager2/CMPI/CMPIProviderModule.h>
  64                   #include <Pegasus/ProviderManager2/CMPI/CMPIProvider.h>
  65 thilo.boehm 1.162 #include <Pegasus/ProviderManager2/CMPI/CMPI_ThreadContext.h>
  66 venkat.puvvada 1.145 #include <Pegasus/Query/QueryExpression/QueryExpression.h>
  67                      #include <Pegasus/Query/QueryCommon/QueryException.h>
  68 marek          1.63  
  69 kumpf          1.93  PEGASUS_USING_STD;
  70 marek          1.63  
  71                      PEGASUS_NAMESPACE_BEGIN
  72                      
  73 dave.sudlik    1.96  
  74 venkat.puvvada 1.160 ReadWriteSem CMPIProviderManager::rwSemProvTab;
  75                      CMPIProviderManager::IndProvTab CMPIProviderManager::indProvTab;
  76 marek          1.95  
  77 venkat.puvvada 1.108 class CMPIPropertyList
  78                      {
  79                          char **props;
  80                          int pCount;
  81                      public:
  82                          CMPIPropertyList(CIMPropertyList &propertyList) : props(0), pCount(0)
  83                          {
  84 ms.aruran      1.115         PEG_METHOD_ENTER(
  85                                  TRC_PROVIDERMANAGER,
  86                                  "CMPIPropertyList::CMPIPropertyList()");
  87 venkat.puvvada 1.108         if (!propertyList.isNull())
  88                              {
  89                                  Array<CIMName> p=propertyList.getPropertyNameArray();
  90                                  pCount=p.size();
  91                                  props = new char*[1+pCount];
  92                                  for (int i=0; i<pCount; i++)
  93                                  {
  94                                      props[i]=strdup(p[i].getString().getCString());
  95                                  }
  96                                  props[pCount]=NULL;
  97                              }
  98                              else props=NULL;
  99 ms.aruran      1.115         PEG_METHOD_EXIT();
 100 venkat.puvvada 1.108     }
 101                          ~CMPIPropertyList()
 102                          {
 103 ms.aruran      1.115         PEG_METHOD_ENTER(
 104                                  TRC_PROVIDERMANAGER,
 105                                  "CMPIPropertyList::~CMPIPropertyList()");
 106 venkat.puvvada 1.108         if (props)
 107                              {
 108                                  for (int i=0; i<pCount; i++)
 109                                      free(props[i]);
 110                                  delete [] props;
 111                              }
 112 ms.aruran      1.115         PEG_METHOD_EXIT();
 113 venkat.puvvada 1.108     }
 114                          char  **getList()
 115                          {
 116                              return props;
 117                          }
 118 marek          1.63  };
 119                      
 120 marek          1.127 CMPIProviderManager::CMPIProviderManager()
 121 marek          1.63  {
 122 ms.aruran      1.115     PEG_METHOD_ENTER(
 123                              TRC_PROVIDERMANAGER,
 124                              "CMPIProviderManager::CMPIProviderManager()");
 125                      
 126 venkat.puvvada 1.108     _subscriptionInitComplete = false;
 127 ms.aruran      1.115     PEG_TRACE_CSTRING (
 128                              TRC_PROVIDERMANAGER,
 129                              Tracer::LEVEL2,
 130                              "-- CMPI Provider Manager activated");
 131                          PEG_METHOD_EXIT();
 132 marek          1.63  }
 133                      
 134 venkat.puvvada 1.108 CMPIProviderManager::~CMPIProviderManager()
 135 marek          1.63  {
 136 ms.aruran      1.115     PEG_METHOD_ENTER(
 137                              TRC_PROVIDERMANAGER,
 138                              "CMPIProviderManager::~CMPIProviderManager()");
 139 venkat.puvvada 1.160 
 140 thilo.boehm    1.162     IndProvRecord *indProvRec = 0;
 141 venkat.puvvada 1.160 
 142                          WriteLock lock(rwSemProvTab);
 143                      
 144                          for (IndProvTab::Iterator i = indProvTab.start(); i; i++)
 145 marek          1.95      {
 146 venkat.puvvada 1.160         indProvTab.lookup(i.key(), indProvRec);
 147                              delete indProvRec;
 148 marek          1.95      }
 149                      
 150 ms.aruran      1.115     PEG_METHOD_EXIT();
 151 marek          1.63  }
 152                      
 153 thilo.boehm    1.162 
 154                      SCMOInstance* CMPIProviderManager::getSCMOClassFromRequest(
 155                          CString& nameSpace,
 156                          CString& className )
 157                      {
 158                          SCMOClass* scmoClass = mbGetSCMOClass(
 159                              (const char*)nameSpace,
 160                              strlen((const char*)nameSpace),
 161                              (const char*)className,
 162                              strlen((const char*)className));
 163                      
 164                          if (0 == scmoClass)
 165                          {
 166                              // This indicates a severe error, since we should't have come
 167                              // here at all, if the class is invalid
 168                              PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL2,
 169                                  "CMPIProviderManager::getSCMOClassFromRequest - "
 170                                  "Failed to obtain SCMOClass for Namespace: %s  Classname: %s",
 171                                  (const char*) nameSpace,
 172                                  (const char*) className));
 173                      
 174 thilo.boehm    1.162         CIMException cimException(CIM_ERR_NOT_FOUND);
 175                              throw cimException;
 176                          }
 177                      
 178                          return new SCMOInstance(*scmoClass);
 179                      }
 180                      
 181                      SCMOInstance* CMPIProviderManager::getSCMOObjectPathFromRequest(
 182                          CString& nameSpace,
 183                          CString& className,
 184                          CIMObjectPath& cimObjPath )
 185                      {
 186                          SCMOClass* scmoClass = mbGetSCMOClass(
 187                              (const char*)nameSpace,
 188                              strlen((const char*)nameSpace),
 189                              (const char*)className,
 190                              strlen((const char*)className));
 191                      
 192                          if (0 == scmoClass)
 193                          {
 194                              // This indicates a severe error, since we should't have come
 195 thilo.boehm    1.162         // here at all, if the class is invalid
 196                              PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1,
 197                                  "CMPIProviderManager::getSCMOObjectPathFromRequest - "
 198                                  "Failed to obtain CIMClass for Namespace: %s  Classname: %s",
 199                                  (const char*) nameSpace,
 200                                  (const char*) className));
 201                      
 202                              CIMException cimException(CIM_ERR_NOT_FOUND);
 203                              throw cimException;
 204                          }
 205                      
 206                          SCMOInstance * objectPath = new SCMOInstance(*scmoClass,cimObjPath);
 207                          objectPath->setHostName((const char*)System::getHostName().getCString());
 208                          return objectPath;
 209                      }
 210                      
 211                      SCMOInstance* CMPIProviderManager::getSCMOInstanceFromRequest(
 212                          CString& nameSpace,
 213                          CString& className,
 214                          CIMInstance& cimInstance )
 215                      {
 216 thilo.boehm    1.162     SCMOClass* scmoClass = mbGetSCMOClass(
 217                              (const char*)nameSpace,
 218                              strlen((const char*)nameSpace),
 219                              (const char*)className,
 220                              strlen((const char*)className));
 221                      
 222                          if (0 == scmoClass)
 223                          {
 224                              // This indicates a severe error, since we should't have come
 225                              // here at all, if the class is invalid
 226                              PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1,
 227                                  "CMPIProviderManager::getSCMOInstanceFromRequest - "
 228                                  "Failed to obtain CIMClass for Namespace: %s  Classname: %s",
 229                                  (const char*) nameSpace,
 230                                  (const char*) className));
 231                      
 232                              CIMException cimException(CIM_ERR_NOT_FOUND);
 233                              throw cimException;
 234                          }
 235                      
 236                          SCMOInstance * newInstance = new SCMOInstance(*scmoClass, cimInstance);
 237 thilo.boehm    1.162     newInstance->setHostName((const char*)System::getHostName().getCString());
 238                      
 239                          return newInstance;
 240                      }
 241                      
 242                      
 243                      
 244 marek          1.63  Message * CMPIProviderManager::processMessage(Message * request)
 245                      {
 246 ms.aruran      1.115     PEG_METHOD_ENTER(
 247                              TRC_PROVIDERMANAGER,
 248 marek          1.63          "CMPIProviderManager::processMessage()");
 249                      
 250                          Message * response = 0;
 251                      
 252                          // pass the request message to a handler method based on message type
 253 venkat.puvvada 1.108     switch (request->getType())
 254 marek          1.63      {
 255 venkat.puvvada 1.108         case CIM_GET_INSTANCE_REQUEST_MESSAGE:
 256                                  response = handleGetInstanceRequest(request);
 257 marek          1.63  
 258 venkat.puvvada 1.108             break;
 259                              case CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE:
 260                                  response = handleEnumerateInstancesRequest(request);
 261                      
 262                                  break;
 263                              case CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE:
 264                                  response = handleEnumerateInstanceNamesRequest(request);
 265                      
 266                                  break;
 267                              case CIM_CREATE_INSTANCE_REQUEST_MESSAGE:
 268                                  response = handleCreateInstanceRequest(request);
 269                      
 270                                  break;
 271                              case CIM_MODIFY_INSTANCE_REQUEST_MESSAGE:
 272                                  response = handleModifyInstanceRequest(request);
 273                      
 274                                  break;
 275                              case CIM_DELETE_INSTANCE_REQUEST_MESSAGE:
 276                                  response = handleDeleteInstanceRequest(request);
 277                      
 278                                  break;
 279 venkat.puvvada 1.108         case CIM_EXEC_QUERY_REQUEST_MESSAGE:
 280                                  response = handleExecQueryRequest(request);
 281                      
 282                                  break;
 283                              case CIM_ASSOCIATORS_REQUEST_MESSAGE:
 284                                  response = handleAssociatorsRequest(request);
 285                      
 286                                  break;
 287                              case CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE:
 288                                  response = handleAssociatorNamesRequest(request);
 289                      
 290                                  break;
 291                              case CIM_REFERENCES_REQUEST_MESSAGE:
 292                                  response = handleReferencesRequest(request);
 293                      
 294                                  break;
 295                              case CIM_REFERENCE_NAMES_REQUEST_MESSAGE:
 296                                  response = handleReferenceNamesRequest(request);
 297                      
 298                                  break;
 299                              case CIM_INVOKE_METHOD_REQUEST_MESSAGE:
 300 venkat.puvvada 1.108             response = handleInvokeMethodRequest(request);
 301                      
 302                                  break;
 303                              case CIM_CREATE_SUBSCRIPTION_REQUEST_MESSAGE:
 304                                  response = handleCreateSubscriptionRequest(request);
 305 marek          1.63  
 306 venkat.puvvada 1.108             break;
 307 marek          1.63  /*    case CIM_MODIFY_SUBSCRIPTION_REQUEST_MESSAGE:
 308                              response = handleModifySubscriptionRequest(request);
 309                      
 310                              break;
 311 venkat.puvvada 1.108 */
 312                              case CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE:
 313                                  response = handleDeleteSubscriptionRequest(request);
 314 marek          1.63  
 315 venkat.puvvada 1.108             break;
 316 marek          1.63  /*    case CIM_EXPORT_INDICATION_REQUEST_MESSAGE:
 317                              response = handleExportIndicationRequest(request);
 318                              break;
 319                      */
 320 venkat.puvvada 1.108         case CIM_DISABLE_MODULE_REQUEST_MESSAGE:
 321                                  response = handleDisableModuleRequest(request);
 322 marek          1.63  
 323 venkat.puvvada 1.108             break;
 324                              case CIM_ENABLE_MODULE_REQUEST_MESSAGE:
 325                                  response = handleEnableModuleRequest(request);
 326                      
 327                                  break;
 328                              case CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE:
 329                                  response = handleStopAllProvidersRequest(request);
 330                      
 331                                  break;
 332                              case CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE:
 333                                  response = handleSubscriptionInitCompleteRequest (request);
 334                      
 335                                  break;
 336 venkat.puvvada 1.155         case CIM_INDICATION_SERVICE_DISABLED_REQUEST_MESSAGE:
 337                                  response = handleIndicationServiceDisabledRequest (request);
 338                                  break;
 339 venkat.puvvada 1.108         case CIM_GET_PROPERTY_REQUEST_MESSAGE:
 340                                  response = handleGetPropertyRequest(request);
 341                      
 342                                  break;
 343                              case CIM_SET_PROPERTY_REQUEST_MESSAGE:
 344                                  response = handleSetPropertyRequest(request);
 345                      
 346                                  break;
 347                              default:
 348                                  response = handleUnsupportedRequest(request);
 349 marek          1.63  
 350 venkat.puvvada 1.108             break;
 351 marek          1.63      }
 352                      
 353                          PEG_METHOD_EXIT();
 354                      
 355                          return(response);
 356                      }
 357                      
 358                      Boolean CMPIProviderManager::hasActiveProviders()
 359                      {
 360 venkat.puvvada 1.108     return providerManager.hasActiveProviders();
 361 marek          1.63  }
 362                      
 363                      void CMPIProviderManager::unloadIdleProviders()
 364                      {
 365 venkat.puvvada 1.108     providerManager.unloadIdleProviders();
 366 marek          1.63  }
 367                      
 368                      
 369                      #define CHARS(cstring) (char*)(strlen(cstring)?(const char*)cstring:NULL)
 370                      
 371                      
 372 kumpf          1.92  #define HandlerIntroBase(type,type1,message,request,response,handler) \
 373 marek          1.63      CIM##type##RequestMessage * request = \
 374 venkat.puvvada 1.108         dynamic_cast<CIM##type##RequestMessage *>(const_cast<Message *> \
 375                              (message)); \
 376 marek          1.63      PEGASUS_ASSERT(request != 0); \
 377                          CIM##type##ResponseMessage * response = \
 378 kumpf          1.92          dynamic_cast<CIM##type##ResponseMessage*>(request->buildResponse()); \
 379 marek          1.63      PEGASUS_ASSERT(response != 0); \
 380 kumpf          1.84      type1##ResponseHandler handler(request, response, _responseChunkCallback);
 381 marek          1.63  
 382                      #define HandlerIntroInd(type,message,request,response,handler) \
 383 kumpf          1.92       HandlerIntroBase(type,Operation,message,request,response,handler)
 384 marek          1.63  
 385                      #define HandlerIntroInit(type,message,request,response,handler) \
 386 kumpf          1.92       HandlerIntroBase(type,Operation,message,request,response,handler)
 387 marek          1.63  
 388 kumpf          1.92  #define HandlerIntro(type,message,request,response,handler) \
 389                           HandlerIntroBase(type,type,message,request,response,handler)
 390 marek          1.63  
 391                      #define HandlerCatch(handler) \
 392 konrad.r       1.64      catch(const CIMException & e)  \
 393 thilo.boehm    1.138     { PEG_TRACE((TRC_PROVIDERMANAGER, Tracer::LEVEL1, \
 394                                "CIMException: %s",(const char*)e.getMessage().getCString())); \
 395 dave.sudlik    1.103         handler.setCIMException(e); \
 396 marek          1.63      } \
 397 konrad.r       1.64      catch(const Exception & e) \
 398 thilo.boehm    1.138     { PEG_TRACE((TRC_PROVIDERMANAGER, Tracer::LEVEL1, \
 399                                "Exception: %s",(const char*)e.getMessage().getCString())); \
 400 venkat.puvvada 1.108         handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), \
 401                              e.getMessage()); \
 402 marek          1.63      } \
 403                          catch(...) \
 404 marek          1.131     { PEG_TRACE_CSTRING(TRC_PROVIDERMANAGER, Tracer::LEVEL1, \
 405 marek          1.63                  "Exception: Unknown"); \
 406                              handler.setStatus(CIM_ERR_FAILED, "Unknown error."); \
 407                          }
 408                      
 409 marek          1.157 /* setup the CMPI context based on the requests OperationContext
 410                         the OperationContext
 411                         nameSpace and remoteInfo are used by pointer instead of by reference to
 412                         avoid copies being generated, both CStrings are anchored on the stack in the
 413                         scope of the calling function to keep them valid across the lifetime of the
 414                         CMPI processing of a request
 415 thilo.boehm    1.162 */
 416 marek          1.124 void CMPIProviderManager::_setupCMPIContexts(
 417                          CMPI_ContextOnStack * eCtx,
 418                          OperationContext * context,
 419 marek          1.157     const CString * nameSpace,
 420                          const CString * remoteInfo,
 421 marek          1.124     Boolean remote,
 422                          Boolean includeQualifiers,
 423                          Boolean includeClassOrigin,
 424                          Boolean setFlags)
 425                      {
 426                          if (setFlags)
 427                          {
 428                              // set CMPI invocation flags
 429 kumpf          1.125         CMPIValue value;
 430                              value.uint32 = 0;
 431                              if (includeQualifiers) value.uint32 |= CMPI_FLAG_IncludeQualifiers;
 432                              if (includeClassOrigin) value.uint32 |= CMPI_FLAG_IncludeClassOrigin;
 433 marek          1.124         eCtx->ft->addEntry(
 434                                  eCtx,
 435                                  CMPIInvocationFlags,
 436 kumpf          1.125             &value,
 437 marek          1.124             CMPI_uint32);
 438                          }
 439                      
 440                          // add identity context
 441                          const IdentityContainer container =
 442                          context->get(IdentityContainer::NAME);
 443                          eCtx->ft->addEntry(
 444                              eCtx,
 445                              CMPIPrincipal,
 446                              (CMPIValue*)(const char*)container.getUserName().getCString(),
 447                              CMPI_chars);
 448                      
 449                          // add AcceptLanguages to CMPI context
 450 kumpf          1.151     const AcceptLanguageListContainer accept_language=
 451                          context->get(AcceptLanguageListContainer::NAME);
 452 marek          1.124     const AcceptLanguageList acceptLangs = accept_language.getLanguages();
 453                      
 454                          eCtx->ft->addEntry(
 455                              eCtx,
 456                              CMPIAcceptLanguage,
 457                              (CMPIValue*)(const char*)
 458                                  LanguageParser::buildAcceptLanguageHeader(acceptLangs).getCString(),
 459                              CMPI_chars);
 460                      
 461                          // add initial namespace to context
 462                          eCtx->ft->addEntry(
 463 marek          1.157         eCtx,
 464                              CMPIInitNameSpace,
 465                              (CMPIValue*)(const char*)(*nameSpace),
 466                              CMPI_chars);
 467 marek          1.124 
 468                          // add remote info to context
 469                          if (remote)
 470                          {
 471                              eCtx->ft->addEntry(
 472                                  eCtx,
 473 marek          1.157             "CMPIRRemoteInfo",(CMPIValue*)(const char*)(*remoteInfo),
 474 marek          1.124             CMPI_chars);
 475                          }
 476                      }
 477                      
 478 marek          1.157 /*
 479                         Function resolves the provider name and gets the cached or loads new
 480                         provider module, also returns if operation is remote and the remote
 481                         information
 482                      */
 483                      CMPIProvider & CMPIProviderManager::_resolveAndGetProvider(
 484                          OperationContext * context,
 485                          OpProviderHolder * ph,
 486                          CString * remoteInfo,
 487                          Boolean & isRemote)
 488                      {
 489                              isRemote=false;
 490                      
 491                              // resolve provider name
 492                              ProviderIdContainer pidc =
 493                                  context->get(ProviderIdContainer::NAME);
 494                      
 495                              ProviderName name = _resolveProviderName(pidc);
 496                      
 497                              if ((isRemote=pidc.isRemoteNameSpace()))
 498                              {
 499 marek          1.157             *ph = providerManager.getRemoteProvider(
 500 venkat.puvvada 1.161                 name.getLocation(),
 501                                      name.getLogicalName(),
 502                                      name.getModuleName());
 503 marek          1.157         }
 504                              else
 505                              {
 506                                  // get cached or load new provider module
 507                                  *ph = providerManager.getProvider(
 508 venkat.puvvada 1.161                 name.getPhysicalName(),
 509                                      name.getLogicalName(),
 510                                      name.getModuleName());
 511 marek          1.157         }
 512                              *remoteInfo = pidc.getRemoteInfo().getCString();
 513                      
 514                              // forward request
 515                              return ph->GetProvider();
 516                      }
 517                      
 518 venkat.puvvada 1.108 Message * CMPIProviderManager::handleGetInstanceRequest(
 519                          const Message * message)
 520 marek          1.63  {
 521 ms.aruran      1.115     PEG_METHOD_ENTER(
 522                              TRC_PROVIDERMANAGER,
 523                              "CMPIProviderManager::handleGetInstanceRequest()");
 524 marek          1.63  
 525 kumpf          1.92      HandlerIntro(GetInstance,message,request,response,handler);
 526 marek          1.63  
 527 venkat.puvvada 1.108     try
 528                          {
 529 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
 530 marek          1.129             "CMPIProviderManager::handleGetInstanceRequest - Host name:"
 531                                  " %s  Name space: %s  Class name: %s",
 532                                  (const char*) System::getHostName().getCString(),
 533                                  (const char*) request->nameSpace.getString().getCString(),
 534                                  (const char*)
 535                                      request->instanceName.getClassName().getString().getCString()));
 536 kumpf          1.151 
 537 marek          1.63          Boolean remote=false;
 538 venkat.puvvada 1.132         OpProviderHolder ph;
 539 marek          1.157         CString remoteInfo;
 540 thilo.boehm    1.162 
 541 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
 542                                  &(request->operationContext),
 543                                  &ph,
 544                                  &remoteInfo,
 545                                  remote);
 546 marek          1.63  
 547                              CMPIStatus rc={CMPI_RC_OK,NULL};
 548 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
 549 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
 550                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
 551 marek          1.63  
 552                              CMPIPropertyList props(request->propertyList);
 553 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
 554 thilo.boehm    1.162         CString className = request->className.getString().getCString();
 555 kumpf          1.151 
 556 marek          1.124         _setupCMPIContexts(
 557 venkat.puvvada 1.108             &eCtx,
 558 marek          1.157             &(request->operationContext),
 559                                  &nameSpace,
 560                                  &remoteInfo,
 561 marek          1.124             remote,
 562                                  request->includeQualifiers,
 563                                  request->includeClassOrigin,
 564                                  true);
 565 marek          1.63  
 566 thilo.boehm    1.162 
 567                              SCMOInstance * objectPath = getSCMOObjectPathFromRequest(
 568                                  nameSpace, className, request->instanceName);
 569                      
 570                              CMPI_ObjectPathOnStack eRef(objectPath);
 571                      
 572 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
 573                      
 574 thilo.boehm    1.143         PEG_TRACE((
 575                                  TRC_PROVIDERMANAGER,
 576                                  Tracer::LEVEL2,
 577                                  "Calling provider.getInstance: %s",
 578                                  (const char*)pr.getName().getCString()));
 579                      
 580 kumpf          1.92          {
 581 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
 582                      
 583 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
 584 marek          1.63  
 585 venkat.puvvada 1.132             rc = pr.getInstMI()->ft->getInstance(
 586                                      pr.getInstMI(),
 587 venkat.puvvada 1.108                 &eCtx,
 588                                      &eRes,
 589                                      &eRef,
 590 kumpf          1.92                  (const char **)props.getList());
 591                              }
 592 marek          1.63  
 593 thilo.boehm    1.143         PEG_TRACE((
 594                                  TRC_PROVIDERMANAGER,
 595                                  Tracer::LEVEL2,
 596                                  "Returning from provider.getInstance: %s",
 597                                  (const char*)pr.getName().getCString()));
 598                      
 599 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
 600 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
 601 dave.sudlik    1.99  //      rc.msg is also localized.
 602                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
 603 kumpf          1.151         CMPIData cldata =
 604 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
 605 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
 606                              {
 607                                  response->operationContext.set(
 608                                      ContentLanguageListContainer(
 609 venkat.puvvada 1.108                 ContentLanguageList(
 610                                      LanguageParser::parseContentLanguageHeader(
 611 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
 612 dave.sudlik    1.103             handler.setContext(response->operationContext);
 613 dave.sudlik    1.99          }
 614                      
 615 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
 616 marek          1.63      }
 617                          HandlerCatch(handler);
 618                      
 619                          PEG_METHOD_EXIT();
 620                      
 621                          return(response);
 622                      }
 623                      
 624 venkat.puvvada 1.108 Message * CMPIProviderManager::handleEnumerateInstancesRequest(
 625                          const Message * message)
 626 marek          1.63  {
 627 ms.aruran      1.115     PEG_METHOD_ENTER(
 628                              TRC_PROVIDERMANAGER,
 629                              "CMPIProviderManager::handleEnumerateInstanceRequest()");
 630 marek          1.63  
 631 kumpf          1.92      HandlerIntro(EnumerateInstances,message,request,response,handler);
 632 venkat.puvvada 1.108     try
 633                          {
 634 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
 635 venkat.puvvada 1.108             "CMPIProviderManager::handleEnumerateInstancesRequest - Host name:"
 636 marek          1.129             " %s  Name space: %s  Class name: %s",
 637                                  (const char*) System::getHostName().getCString(),
 638                                  (const char*) request->nameSpace.getString().getCString(),
 639                                  (const char*) request->className.getString().getCString()));
 640 marek          1.63  
 641                      
 642                              Boolean remote=false;
 643 venkat.puvvada 1.132         OpProviderHolder ph;
 644 marek          1.157         CString remoteInfo;
 645 thilo.boehm    1.162 
 646 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
 647                                  &(request->operationContext),
 648                                  &ph,
 649                                  &remoteInfo,
 650                                  remote);
 651 marek          1.63  
 652                              CIMPropertyList propertyList(request->propertyList);
 653                      
 654                              CMPIStatus rc={CMPI_RC_OK,NULL};
 655 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
 656 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
 657                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
 658 marek          1.63          CMPIPropertyList props(propertyList);
 659 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
 660 thilo.boehm    1.162         CString className = request->className.getString().getCString();
 661 marek          1.63  
 662 marek          1.124         _setupCMPIContexts(
 663 venkat.puvvada 1.108             &eCtx,
 664 marek          1.157             &(request->operationContext),
 665                                  &nameSpace,
 666                                  &remoteInfo,
 667 marek          1.124             remote,
 668                                  request->includeQualifiers,
 669                                  request->includeClassOrigin,
 670                                  true);
 671 marek          1.63  
 672 thilo.boehm    1.162         SCMOInstance * objectPath =
 673                                  getSCMOClassFromRequest(nameSpace, className);
 674                      
 675                              CMPI_ObjectPathOnStack eRef(objectPath);
 676                      
 677 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
 678                      
 679 thilo.boehm    1.143         PEG_TRACE((
 680                                  TRC_PROVIDERMANAGER,
 681                                  Tracer::LEVEL2,
 682                                  "Calling provider.enumerateInstances: %s",
 683                                   (const char*)pr.getName().getCString()));
 684                      
 685 kumpf          1.92          {
 686 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
 687                      
 688 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
 689 marek          1.63  
 690 venkat.puvvada 1.132             rc = pr.getInstMI()->ft->enumerateInstances(
 691                                      pr.getInstMI(),
 692 venkat.puvvada 1.108                 &eCtx,
 693                                      &eRes,
 694                                      &eRef,
 695 kumpf          1.92                  (const char **)props.getList());
 696                              }
 697 marek          1.63  
 698 thilo.boehm    1.143         PEG_TRACE((
 699                                  TRC_PROVIDERMANAGER,
 700                                  Tracer::LEVEL2,
 701                                  "Returning from provider.enumerateInstances: %s",
 702                                   (const char*)pr.getName().getCString()));
 703                      
 704 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
 705 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
 706 dave.sudlik    1.99  //      rc.msg is also localized.
 707                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
 708 kumpf          1.151         CMPIData cldata =
 709 venkat.puvvada 1.108             eCtx.ft->getEntry(&eCtx, CMPIContentLanguage, &tmprc);
 710 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
 711                              {
 712                                  response->operationContext.set(
 713                                      ContentLanguageListContainer(
 714 venkat.puvvada 1.108                 ContentLanguageList(
 715                                      LanguageParser::parseContentLanguageHeader(
 716 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
 717 dave.sudlik    1.103             handler.setContext(response->operationContext);
 718 dave.sudlik    1.99          }
 719                      
 720 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
 721 marek          1.63      }
 722                          HandlerCatch(handler);
 723                      
 724                          PEG_METHOD_EXIT();
 725                      
 726                          return(response);
 727                      }
 728                      
 729 venkat.puvvada 1.108 Message * CMPIProviderManager::handleEnumerateInstanceNamesRequest(
 730                          const Message * message)
 731 marek          1.63  {
 732 ms.aruran      1.115     PEG_METHOD_ENTER(
 733                              TRC_PROVIDERMANAGER,
 734                              "CMPIProviderManager::handleEnumerateInstanceNamesRequest()");
 735 marek          1.63  
 736 kumpf          1.92      HandlerIntro(EnumerateInstanceNames,message,request,response,handler);
 737 venkat.puvvada 1.108     try
 738                          {
 739 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
 740 marek          1.129             "CMPIProviderManager::handleEnumerateInstanceNamesRequest"
 741                                  " - Host name: %s  Name space: %s  Class name: %s",
 742                                  (const char*) System::getHostName().getCString(),
 743                                  (const char*) request->nameSpace.getString().getCString(),
 744                                  (const char*) request->className.getString().getCString()));
 745 marek          1.63  
 746                              Boolean remote=false;
 747 venkat.puvvada 1.132         OpProviderHolder ph;
 748 marek          1.157         CString remoteInfo;
 749 thilo.boehm    1.162 
 750 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
 751                                  &(request->operationContext),
 752                                  &ph,
 753                                  &remoteInfo,
 754                                  remote);
 755 marek          1.63  
 756                              CMPIStatus rc={CMPI_RC_OK,NULL};
 757 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
 758 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
 759                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
 760 marek          1.63  
 761 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
 762 thilo.boehm    1.162         CString className = request->className.getString().getCString();
 763 marek          1.157 
 764 marek          1.124         _setupCMPIContexts(
 765 venkat.puvvada 1.108             &eCtx,
 766 marek          1.157             &(request->operationContext),
 767                                  &nameSpace,
 768                                  &remoteInfo,
 769 marek          1.124             remote,
 770                                  false,
 771                                  false,
 772                                  true);
 773 marek          1.63  
 774 thilo.boehm    1.162         SCMOInstance * objectPath =
 775                                  getSCMOClassFromRequest(nameSpace, className);
 776                      
 777                              CMPI_ObjectPathOnStack eRef(objectPath);
 778                      
 779 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
 780                      
 781 thilo.boehm    1.143         PEG_TRACE((
 782                                  TRC_PROVIDERMANAGER,
 783                                  Tracer::LEVEL2,
 784                                  "Calling provider.enumerateInstanceNames: %s",
 785                                  (const char*)pr.getName().getCString()));
 786                      
 787 kumpf          1.92          {
 788 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
 789                      
 790 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
 791 marek          1.63  
 792 venkat.puvvada 1.132             rc = pr.getInstMI()->ft->enumerateInstanceNames(
 793                                      pr.getInstMI(),
 794                                      &eCtx,
 795                                      &eRes,
 796                                      &eRef);
 797 kumpf          1.92          }
 798 marek          1.63  
 799 thilo.boehm    1.143         PEG_TRACE((
 800                                  TRC_PROVIDERMANAGER,
 801                                  Tracer::LEVEL2,
 802                                  "Returning from provider.enumerateInstanceNames: %s",
 803                                  (const char*)pr.getName().getCString()));
 804                      
 805 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
 806 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
 807 dave.sudlik    1.99  //      rc.msg is also localized.
 808                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
 809 kumpf          1.151         CMPIData cldata =
 810 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
 811 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
 812                              {
 813                                  response->operationContext.set(
 814                                      ContentLanguageListContainer(
 815 venkat.puvvada 1.108                 ContentLanguageList(
 816                                      LanguageParser::parseContentLanguageHeader(
 817 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
 818 dave.sudlik    1.103             handler.setContext(response->operationContext);
 819 dave.sudlik    1.99          }
 820 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
 821 marek          1.63      }
 822                          HandlerCatch(handler);
 823                      
 824                          PEG_METHOD_EXIT();
 825                      
 826                          return(response);
 827                      }
 828                      
 829 venkat.puvvada 1.108 Message * CMPIProviderManager::handleCreateInstanceRequest(
 830                          const Message * message)
 831 marek          1.63  {
 832 ms.aruran      1.115     PEG_METHOD_ENTER(
 833                              TRC_PROVIDERMANAGER,
 834                              "CMPIProviderManager::handleCreateInstanceRequest()");
 835 marek          1.63  
 836 kumpf          1.92      HandlerIntro(CreateInstance,message,request,response,handler);
 837 venkat.puvvada 1.108     try
 838                          {
 839 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
 840 marek          1.129             "CMPIProviderManager::handleCreateInstanceRequest"
 841                                  " - Host name: %s  Name space: %s  Class name: %s",
 842                                  (const char*) System::getHostName().getCString(),
 843                                  (const char*) request->nameSpace.getString().getCString(),
 844                                  (const char*)
 845                                request->newInstance.getPath().getClassName().getString().getCString()
 846                              ));
 847 marek          1.63  
 848                              Boolean remote=false;
 849 venkat.puvvada 1.132         OpProviderHolder ph;
 850 marek          1.157         CString remoteInfo;
 851 thilo.boehm    1.162 
 852 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
 853                                  &(request->operationContext),
 854                                  &ph,
 855                                  &remoteInfo,
 856                                  remote);
 857 marek          1.63  
 858                              CMPIStatus rc={CMPI_RC_OK,NULL};
 859 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
 860 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
 861                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
 862 marek          1.63  
 863 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
 864 thilo.boehm    1.162         CString className = request->newInstance.getPath().getClassName().
 865                                  getString().getCString();
 866 marek          1.157 
 867 marek          1.124         _setupCMPIContexts(
 868 venkat.puvvada 1.108             &eCtx,
 869 marek          1.157             &(request->operationContext),
 870                                  &nameSpace,
 871                                  &remoteInfo,
 872 marek          1.124             remote,
 873                                  false,
 874                                  false,
 875                                  true);
 876 marek          1.63  
 877 thilo.boehm    1.162         SCMOInstance * newInstance = getSCMOInstanceFromRequest(
 878                                  nameSpace, className, request->newInstance);
 879                              CMPI_InstanceOnStack eInst(newInstance);
 880                      
 881                              // This will create a second reference for the same SCMOInstance
 882                              CMPI_ObjectPathOnStack eRef(*newInstance);
 883                      
 884 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
 885                      
 886 thilo.boehm    1.143         PEG_TRACE((
 887                                  TRC_PROVIDERMANAGER,
 888                                  Tracer::LEVEL2,
 889                                  "Calling provider.createInstance: %s",
 890                                  (const char*)ph.GetProvider().getName().getCString()));
 891                      
 892 kumpf          1.92          {
 893 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
 894                      
 895 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
 896 marek          1.63  
 897 venkat.puvvada 1.132             rc = pr.getInstMI()->ft->createInstance(
 898                                      pr.getInstMI(),
 899                                      &eCtx,
 900                                      &eRes,
 901                                      &eRef,
 902                                      &eInst);
 903 kumpf          1.92          }
 904 marek          1.63  
 905 thilo.boehm    1.143         PEG_TRACE((
 906                                  TRC_PROVIDERMANAGER,
 907                                  Tracer::LEVEL2,
 908                                  "Returning from provider.createInstance: %s",
 909                                  (const char*)ph.GetProvider().getName().getCString()));
 910                      
 911 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
 912 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
 913 dave.sudlik    1.99  //      rc.msg is also localized.
 914                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
 915 kumpf          1.151         CMPIData cldata =
 916 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
 917 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
 918                              {
 919                                  response->operationContext.set(
 920                                      ContentLanguageListContainer(
 921 venkat.puvvada 1.108                 ContentLanguageList(
 922                                      LanguageParser::parseContentLanguageHeader(
 923 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
 924 dave.sudlik    1.103             handler.setContext(response->operationContext);
 925 dave.sudlik    1.99          }
 926 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
 927 marek          1.63      }
 928                          HandlerCatch(handler);
 929                      
 930                          PEG_METHOD_EXIT();
 931                      
 932                          return(response);
 933                      }
 934                      
 935 venkat.puvvada 1.108 Message * CMPIProviderManager::handleModifyInstanceRequest(
 936                          const Message * message)
 937 marek          1.63  {
 938 ms.aruran      1.115     PEG_METHOD_ENTER(
 939                              TRC_PROVIDERMANAGER,
 940                              "CMPIProviderManager::handleModifyInstanceRequest()");
 941 marek          1.63  
 942 kumpf          1.92      HandlerIntro(ModifyInstance,message,request,response,handler);
 943 venkat.puvvada 1.108     try
 944                          {
 945 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
 946 marek          1.129             "CMPIProviderManager::handleModifyInstanceRequest"
 947                                  " - Host name: %s  Name space: %s  Class name: %s",
 948                                  (const char*) System::getHostName().getCString(),
 949                                  (const char*) request->nameSpace.getString().getCString(),
 950                                  (const char*) request->modifiedInstance.\
 951                                      getPath().getClassName().getString().getCString()));
 952 marek          1.63  
 953                              Boolean remote=false;
 954 venkat.puvvada 1.132         OpProviderHolder ph;
 955 marek          1.157         CString remoteInfo;
 956 thilo.boehm    1.162 
 957 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
 958                                  &(request->operationContext),
 959                                  &ph,
 960                                  &remoteInfo,
 961                                  remote);
 962 marek          1.63  
 963                              CMPIStatus rc={CMPI_RC_OK,NULL};
 964 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
 965 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
 966                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
 967 marek          1.63  
 968                              CMPIPropertyList props(request->propertyList);
 969                      
 970 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
 971 thilo.boehm    1.162         CString className = request->modifiedInstance.getPath().getClassName().
 972                                  getString().getCString();
 973 marek          1.157 
 974 marek          1.124         _setupCMPIContexts(
 975 venkat.puvvada 1.108             &eCtx,
 976 marek          1.157             &(request->operationContext),
 977                                  &nameSpace,
 978                                  &remoteInfo,
 979 marek          1.124             remote,
 980                                  request->includeQualifiers,
 981                                  false,
 982                                  true);
 983 marek          1.63  
 984 thilo.boehm    1.162 
 985                              SCMOInstance * modInstance = getSCMOInstanceFromRequest(
 986                                  nameSpace, className, request->modifiedInstance);
 987                              CMPI_InstanceOnStack eInst(modInstance);
 988                      
 989                              // This will create a second reference for the same SCMOInstance
 990                              CMPI_ObjectPathOnStack eRef(*modInstance);
 991                      
 992 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
 993                      
 994 thilo.boehm    1.143         PEG_TRACE((
 995                                  TRC_PROVIDERMANAGER,
 996                                  Tracer::LEVEL2,
 997                                  "Calling provider.modifyInstance: %s",
 998                                  (const char*)pr.getName().getCString()));
 999                      
1000 kumpf          1.92          {
1001 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
1002                      
1003 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
1004 marek          1.63  
1005 venkat.puvvada 1.132             rc = pr.getInstMI()->ft->modifyInstance(
1006                                      pr.getInstMI(),
1007                                      &eCtx,
1008                                      &eRes,
1009                                      &eRef,
1010                                      &eInst,
1011 kumpf          1.92                  (const char **)props.getList());
1012                              }
1013 marek          1.63  
1014 thilo.boehm    1.143         PEG_TRACE((
1015                                  TRC_PROVIDERMANAGER,
1016                                  Tracer::LEVEL2,
1017                                  "Returning from provider.modifyInstance: %s",
1018                                  (const char*)pr.getName().getCString()));
1019                      
1020 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
1021 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
1022 dave.sudlik    1.99  //      rc.msg is also localized.
1023                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
1024 kumpf          1.151         CMPIData cldata =
1025 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
1026 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
1027                              {
1028                                  response->operationContext.set(
1029                                      ContentLanguageListContainer(
1030 venkat.puvvada 1.108                 ContentLanguageList(
1031                                      LanguageParser::parseContentLanguageHeader(
1032 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
1033 dave.sudlik    1.103             handler.setContext(response->operationContext);
1034 dave.sudlik    1.99          }
1035 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
1036 marek          1.63      }
1037                          HandlerCatch(handler);
1038                      
1039                          PEG_METHOD_EXIT();
1040                      
1041                          return(response);
1042                      }
1043                      
1044 venkat.puvvada 1.108 Message * CMPIProviderManager::handleDeleteInstanceRequest(
1045                          const Message * message)
1046 marek          1.63  {
1047 ms.aruran      1.115     PEG_METHOD_ENTER(
1048                              TRC_PROVIDERMANAGER,
1049                              "CMPIProviderManager::handleDeleteInstanceRequest()");
1050 marek          1.63  
1051 kumpf          1.92      HandlerIntro(DeleteInstance,message,request,response,handler);
1052 venkat.puvvada 1.108     try
1053                          {
1054 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
1055 marek          1.129             "CMPIProviderManager::handleDeleteInstanceRequest"
1056                                  " - Host name: %s  Name space: %s  Class name: %s",
1057                                  (const char*) System::getHostName().getCString(),
1058                                  (const char*) request->nameSpace.getString().getCString(),
1059                                  (const char*)
1060                                      request->instanceName.getClassName().getString().getCString()));
1061 kumpf          1.151 
1062 marek          1.63          Boolean remote=false;
1063 venkat.puvvada 1.132         OpProviderHolder ph;
1064 marek          1.157         CString remoteInfo;
1065 thilo.boehm    1.162 
1066 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
1067                                  &(request->operationContext),
1068                                  &ph,
1069                                  &remoteInfo,
1070                                  remote);
1071 marek          1.63  
1072                              CMPIStatus rc={CMPI_RC_OK,NULL};
1073 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
1074 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
1075                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
1076 marek          1.63  
1077 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
1078 thilo.boehm    1.162         CString className = request->instanceName.getClassName().
1079                                  getString().getCString();
1080 marek          1.157 
1081 marek          1.124         _setupCMPIContexts(
1082 venkat.puvvada 1.108             &eCtx,
1083 marek          1.157             &(request->operationContext),
1084                                  &nameSpace,
1085                                  &remoteInfo,
1086 marek          1.124             remote,
1087                                  false,
1088                                  false,
1089                                  true);
1090 marek          1.63  
1091 thilo.boehm    1.162         SCMOInstance * objectPath = getSCMOObjectPathFromRequest(
1092                                  nameSpace, className, request->instanceName);
1093                      
1094                              CMPI_ObjectPathOnStack eRef(objectPath);
1095                      
1096 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
1097                      
1098 thilo.boehm    1.143         PEG_TRACE((
1099                                  TRC_PROVIDERMANAGER,
1100                                  Tracer::LEVEL2,
1101                                  "Calling provider.deleteInstance: %s",
1102                                  (const char*)pr.getName().getCString()));
1103                      
1104 kumpf          1.92          {
1105 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
1106                      
1107 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
1108 marek          1.63  
1109 venkat.puvvada 1.132             rc = pr.getInstMI()->ft->deleteInstance(
1110                                      pr.getInstMI(),
1111                                      &eCtx,
1112                                      &eRes,
1113                                      &eRef);
1114 kumpf          1.92          }
1115 marek          1.63  
1116 thilo.boehm    1.143         PEG_TRACE((
1117                                  TRC_PROVIDERMANAGER,
1118                                  Tracer::LEVEL2,
1119                                  "Returning from provider.deleteInstance: %s",
1120                                  (const char*)pr.getName().getCString()));
1121                      
1122 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
1123 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
1124 dave.sudlik    1.99  //      rc.msg is also localized.
1125                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
1126 kumpf          1.151         CMPIData cldata =
1127 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
1128 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
1129                              {
1130                                  response->operationContext.set(
1131                                      ContentLanguageListContainer(
1132 venkat.puvvada 1.108                 ContentLanguageList(
1133                                      LanguageParser::parseContentLanguageHeader(
1134 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
1135 dave.sudlik    1.103             handler.setContext(response->operationContext);
1136 dave.sudlik    1.99          }
1137 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
1138 marek          1.63      }
1139                          HandlerCatch(handler);
1140                      
1141                          PEG_METHOD_EXIT();
1142                      
1143                          return(response);
1144                      }
1145                      
1146                      Message * CMPIProviderManager::handleExecQueryRequest(const Message * message)
1147                      {
1148 ms.aruran      1.115     PEG_METHOD_ENTER(
1149                              TRC_PROVIDERMANAGER,
1150                              "CMPIProviderManager::handleExecQueryRequest()");
1151 marek          1.63  
1152 kumpf          1.92      HandlerIntro(ExecQuery,message,request,response,handler);
1153 marek          1.63  
1154 venkat.puvvada 1.108     try
1155                          {
1156 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
1157 marek          1.129             "CMPIProviderManager::ExecQueryRequest"
1158                                  " - Host name: %s  Name space: %s  Class name: %s",
1159                                  (const char*) System::getHostName().getCString(),
1160                                  (const char*) request->nameSpace.getString().getCString(),
1161                                  (const char*) request->className.getString().getCString()));
1162 marek          1.63  
1163                              Boolean remote=false;
1164 venkat.puvvada 1.132         OpProviderHolder ph;
1165 marek          1.157         CString remoteInfo;
1166 thilo.boehm    1.162 
1167 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
1168                                  &(request->operationContext),
1169                                  &ph,
1170                                  &remoteInfo,
1171                                  remote);
1172 marek          1.63  
1173                              const char **props=NULL;
1174                      
1175                              CMPIStatus rc={CMPI_RC_OK,NULL};
1176 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
1177 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
1178                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
1179 marek          1.63  
1180                              const CString queryLan=request->queryLanguage.getCString();
1181                              const CString query=request->query.getCString();
1182 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
1183 thilo.boehm    1.162         CString className = request->className.getString().getCString();
1184 marek          1.63  
1185 marek          1.124         _setupCMPIContexts(
1186 venkat.puvvada 1.108             &eCtx,
1187 marek          1.157             &(request->operationContext),
1188                                  &nameSpace,
1189                                  &remoteInfo,
1190 marek          1.124             remote,
1191                                  false,
1192                                  false,
1193                                  true);
1194 marek          1.63  
1195 thilo.boehm    1.162         SCMOInstance * classPath = getSCMOClassFromRequest(nameSpace,className);
1196                              CMPI_ObjectPathOnStack eRef(classPath);
1197                      
1198 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
1199                      
1200 thilo.boehm    1.143         PEG_TRACE((
1201                                  TRC_PROVIDERMANAGER,
1202                                  Tracer::LEVEL2,
1203                                  "Calling provider.execQuery: %s",
1204                                  (const char*)pr.getName().getCString()));
1205                      
1206 kumpf          1.92          {
1207 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
1208                      
1209 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
1210 marek          1.63  
1211 venkat.puvvada 1.132             rc = pr.getInstMI()->ft->execQuery(
1212                                      pr.getInstMI(),
1213                                      &eCtx,
1214                                      &eRes,
1215                                      &eRef,
1216                                      CHARS(queryLan),
1217                                      CHARS(query));
1218 kumpf          1.92          }
1219 marek          1.63  
1220 thilo.boehm    1.143         PEG_TRACE((
1221                                  TRC_PROVIDERMANAGER,
1222                                  Tracer::LEVEL2,
1223                                  "Returning from provider.execQuery: %s",
1224                                  (const char*)pr.getName().getCString()));
1225                      
1226 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
1227 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
1228 dave.sudlik    1.99  //      rc.msg is also localized.
1229                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
1230 kumpf          1.151         CMPIData cldata =
1231 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
1232 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
1233                              {
1234                                  response->operationContext.set(
1235                                      ContentLanguageListContainer(
1236 venkat.puvvada 1.108                 ContentLanguageList(
1237                                      LanguageParser::parseContentLanguageHeader(
1238 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
1239 dave.sudlik    1.103             handler.setContext(response->operationContext);
1240 dave.sudlik    1.99          }
1241 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
1242 dave.sudlik    1.102 
1243 marek          1.63      }
1244                          HandlerCatch(handler);
1245                      
1246                          PEG_METHOD_EXIT();
1247                      
1248                          return(response);
1249                      }
1250                      
1251                      Message * CMPIProviderManager::handleAssociatorsRequest(const Message * message)
1252                      {
1253 ms.aruran      1.115     PEG_METHOD_ENTER(
1254                              TRC_PROVIDERMANAGER,
1255                              "CMPIProviderManager::handleAssociatorsRequest()");
1256 marek          1.63  
1257 kumpf          1.92      HandlerIntro(Associators,message,request,response,handler);
1258 venkat.puvvada 1.108     try
1259                          {
1260 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
1261 marek          1.129             "CMPIProviderManager::handleAssociatorsRequest"
1262                                  " - Host name: %s  Name space: %s  Class name: %s",
1263                                  (const char*) System::getHostName().getCString(),
1264                                  (const char*) request->nameSpace.getString().getCString(),
1265                                  (const char*)
1266                                      request->objectName.getClassName().getString().getCString()));
1267 marek          1.63  
1268                              Boolean remote=false;
1269 venkat.puvvada 1.132         OpProviderHolder ph;
1270 marek          1.157         CString remoteInfo;
1271 thilo.boehm    1.162 
1272 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
1273                                  &(request->operationContext),
1274                                  &ph,
1275                                  &remoteInfo,
1276                                  remote);
1277 marek          1.63  
1278 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL4,
1279                                  "--- CMPIProviderManager::associators < role: > %s%s",
1280                                  (const char*)request->role.getCString(),
1281                                  (const char*)request->assocClass.getString().getCString()));
1282 marek          1.63  
1283                              CMPIStatus rc={CMPI_RC_OK,NULL};
1284 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
1285 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
1286                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
1287 marek          1.63          const CString aClass=request->assocClass.getString().getCString();
1288                              const CString rClass=request->resultClass.getString().getCString();
1289                              const CString rRole=request->role.getCString();
1290                              const CString resRole=request->resultRole.getCString();
1291 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
1292 thilo.boehm    1.162         CString className =
1293                                  request->objectName.getClassName().getString().getCString();
1294 marek          1.63  
1295                              CMPIPropertyList props(request->propertyList);
1296                      
1297 marek          1.124         _setupCMPIContexts(
1298 venkat.puvvada 1.108             &eCtx,
1299 marek          1.157             &(request->operationContext),
1300                                  &nameSpace,
1301                                  &remoteInfo,
1302 marek          1.124             remote,
1303                                  request->includeQualifiers,
1304                                  request->includeClassOrigin,
1305                                  true);
1306 marek          1.63  
1307 thilo.boehm    1.162         SCMOInstance * objectPath = getSCMOObjectPathFromRequest(
1308                                  nameSpace, className, request->objectName);
1309                      
1310                              CMPI_ObjectPathOnStack eRef(objectPath);
1311                      
1312 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
1313                      
1314 thilo.boehm    1.143         PEG_TRACE((
1315                                  TRC_PROVIDERMANAGER,
1316                                  Tracer::LEVEL2,
1317                                  "Calling provider.associators: %s",
1318                                  (const char*)pr.getName().getCString()));
1319                      
1320 kumpf          1.92          {
1321 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
1322                      
1323 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
1324 marek          1.63  
1325 venkat.puvvada 1.132             rc = pr.getAssocMI()->ft->associators(
1326                                      pr.getAssocMI(),
1327                                      &eCtx,
1328                                      &eRes,
1329                                      &eRef,
1330                                      CHARS(aClass),
1331                                      CHARS(rClass),
1332                                      CHARS(rRole),
1333                                      CHARS(resRole),
1334 kumpf          1.92                  (const char **)props.getList());
1335                              }
1336 marek          1.63  
1337 thilo.boehm    1.143         PEG_TRACE((
1338                                  TRC_PROVIDERMANAGER,
1339                                  Tracer::LEVEL2,
1340                                  "Returning from provider.associators: %s",
1341                                  (const char*)pr.getName().getCString()));
1342                      
1343 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
1344 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
1345 dave.sudlik    1.99  //      rc.msg is also localized.
1346                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
1347 venkat.puvvada 1.108         CMPIData cldata = eCtx.ft->getEntry (
1348 kumpf          1.151             &eCtx,
1349                                  CMPIContentLanguage,
1350 venkat.puvvada 1.108             &tmprc);
1351 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
1352                              {
1353                                  response->operationContext.set(
1354                                      ContentLanguageListContainer(
1355 venkat.puvvada 1.108                 ContentLanguageList(
1356                                      LanguageParser::parseContentLanguageHeader(
1357 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
1358 dave.sudlik    1.103             handler.setContext(response->operationContext);
1359 dave.sudlik    1.99          }
1360 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
1361 marek          1.63      }
1362                          HandlerCatch(handler);
1363                      
1364                          PEG_METHOD_EXIT();
1365                      
1366                          return(response);
1367                      }
1368                      
1369 venkat.puvvada 1.108 Message * CMPIProviderManager::handleAssociatorNamesRequest(
1370                          const Message * message)
1371 marek          1.63  {
1372 ms.aruran      1.115     PEG_METHOD_ENTER(
1373                              TRC_PROVIDERMANAGER,
1374                              "CMPIProviderManager::handleAssociatorNamesRequest()");
1375 marek          1.63  
1376 kumpf          1.92      HandlerIntro(AssociatorNames,message,request,response,handler);
1377 venkat.puvvada 1.108     try
1378                          {
1379 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
1380 marek          1.129             "CMPIProviderManager::handleAssociatorNamesRequest"
1381                                  " - Host name: %s  Name space: %s  Class name: %s",
1382                                  (const char*) System::getHostName().getCString(),
1383                                  (const char*) request->nameSpace.getString().getCString(),
1384                                  (const char*)
1385                                      request->objectName.getClassName().getString().getCString()));
1386 marek          1.63  
1387                              Boolean remote=false;
1388 venkat.puvvada 1.132         OpProviderHolder ph;
1389 marek          1.157         CString remoteInfo;
1390 thilo.boehm    1.162 
1391 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
1392                                  &(request->operationContext),
1393                                  &ph,
1394                                  &remoteInfo,
1395                                  remote);
1396 marek          1.63  
1397 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL4,
1398 kumpf          1.151             "--- CMPIProviderManager::associatorNames --  role: %s< aCls %s",
1399 thilo.boehm    1.138             (const char*)request->role.getCString(),
1400                                  (const char*)request->assocClass.getString().getCString()));
1401 marek          1.63  
1402                              CMPIStatus rc={CMPI_RC_OK,NULL};
1403 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
1404 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
1405                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
1406 marek          1.63          const CString aClass=request->assocClass.getString().getCString();
1407                              const CString rClass=request->resultClass.getString().getCString();
1408                              const CString rRole=request->role.getCString();
1409                              const CString resRole=request->resultRole.getCString();
1410 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
1411 thilo.boehm    1.162         CString className =
1412                                  request->objectName.getClassName().getString().getCString();
1413 marek          1.63  
1414 marek          1.124         _setupCMPIContexts(
1415 venkat.puvvada 1.108             &eCtx,
1416 marek          1.157             &(request->operationContext),
1417                                  &nameSpace,
1418                                  &remoteInfo,
1419 marek          1.124             remote,
1420                                  false,
1421                                  false,
1422                                  true);
1423 marek          1.63  
1424 thilo.boehm    1.162         SCMOInstance * objectPath = getSCMOObjectPathFromRequest(
1425                                  nameSpace, className, request->objectName);
1426                      
1427                              CMPI_ObjectPathOnStack eRef(objectPath);
1428                      
1429 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
1430                      
1431 thilo.boehm    1.143         PEG_TRACE((
1432                                  TRC_PROVIDERMANAGER,
1433                                  Tracer::LEVEL2,
1434                                  "Calling provider.associatorNames: %s",
1435                                  (const char*)pr.getName().getCString()));
1436                      
1437 kumpf          1.92          {
1438 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
1439                      
1440 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
1441 marek          1.63  
1442 venkat.puvvada 1.132             rc = pr.getAssocMI()->ft->associatorNames(
1443                                      pr.getAssocMI(),
1444                                      &eCtx,
1445                                      &eRes,
1446                                      &eRef,
1447                                      CHARS(aClass),
1448                                      CHARS(rClass),
1449                                      CHARS(rRole),
1450                                      CHARS(resRole));
1451 kumpf          1.92          }
1452 marek          1.63  
1453 thilo.boehm    1.143         PEG_TRACE((
1454                                  TRC_PROVIDERMANAGER,
1455                                  Tracer::LEVEL2,
1456                                  "Returning from provider.associatorNames: %s",
1457                                  (const char*)pr.getName().getCString()));
1458                      
1459 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
1460 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
1461 dave.sudlik    1.99  //      rc.msg is also localized.
1462                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
1463 kumpf          1.151         CMPIData cldata =
1464 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
1465 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
1466                              {
1467                                  response->operationContext.set(
1468                                      ContentLanguageListContainer(
1469 venkat.puvvada 1.108                 ContentLanguageList(
1470                                      LanguageParser::parseContentLanguageHeader(
1471 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
1472 dave.sudlik    1.103             handler.setContext(response->operationContext);
1473 dave.sudlik    1.99          }
1474 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
1475 marek          1.63      }
1476                          HandlerCatch(handler);
1477                      
1478                          PEG_METHOD_EXIT();
1479                      
1480                          return(response);
1481                      }
1482                      
1483                      Message * CMPIProviderManager::handleReferencesRequest(const Message * message)
1484                      {
1485 ms.aruran      1.115     PEG_METHOD_ENTER(
1486                              TRC_PROVIDERMANAGER,
1487                              "CMPIProviderManager::handleReferencesRequest()");
1488 marek          1.63  
1489 kumpf          1.92      HandlerIntro(References,message,request,response,handler);
1490 venkat.puvvada 1.108     try
1491                          {
1492 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
1493 marek          1.129             "CMPIProviderManager::handleReferencesRequest"
1494                                  " - Host name: %s  Name space: %s  Class name: %s",
1495                                  (const char*) System::getHostName().getCString(),
1496                                  (const char*) request->nameSpace.getString().getCString(),
1497                                  (const char*)
1498                                      request->objectName.getClassName().getString().getCString()));
1499 marek          1.63  
1500                              Boolean remote=false;
1501 venkat.puvvada 1.132         OpProviderHolder ph;
1502 marek          1.157         CString remoteInfo;
1503 thilo.boehm    1.162 
1504 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
1505                                  &(request->operationContext),
1506                                  &ph,
1507                                  &remoteInfo,
1508                                  remote);
1509 marek          1.63  
1510 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL4,
1511                                  "--- CMPIProviderManager::references -- role:%s< aCls %s",
1512                                  (const char*)request->role.getCString(),
1513                                  (const char*)request->resultClass.getString().getCString()));
1514 marek          1.63  
1515                              CMPIStatus rc={CMPI_RC_OK,NULL};
1516 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
1517 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
1518                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
1519 marek          1.63          const CString rClass=request->resultClass.getString().getCString();
1520                              const CString rRole=request->role.getCString();
1521 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
1522 thilo.boehm    1.162         CString className =
1523                                  request->objectName.getClassName().getString().getCString();
1524 marek          1.63  
1525                              CMPIPropertyList props(request->propertyList);
1526                      
1527 marek          1.124         _setupCMPIContexts(
1528 venkat.puvvada 1.108             &eCtx,
1529 marek          1.157             &(request->operationContext),
1530                                  &nameSpace,
1531                                  &remoteInfo,
1532 marek          1.124             remote,
1533                                  request->includeQualifiers,
1534                                  request->includeClassOrigin,
1535                                  true);
1536 marek          1.63  
1537 thilo.boehm    1.162         SCMOInstance * objectPath = getSCMOObjectPathFromRequest(
1538                                  nameSpace, className, request->objectName);
1539                      
1540                              CMPI_ObjectPathOnStack eRef(objectPath);
1541                      
1542 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
1543                      
1544 thilo.boehm    1.143         PEG_TRACE((
1545                                  TRC_PROVIDERMANAGER,
1546                                  Tracer::LEVEL2,
1547                                  "Calling provider.references: %s",
1548                                  (const char*)pr.getName().getCString()));
1549                      
1550 kumpf          1.92          {
1551 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
1552                      
1553 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
1554 marek          1.63  
1555 venkat.puvvada 1.132             rc = pr.getAssocMI()->ft->references(
1556                                      pr.getAssocMI(),
1557                                      &eCtx,
1558                                      &eRes,
1559                                      &eRef,
1560                                      CHARS(rClass),
1561                                      CHARS(rRole),
1562                                      (const char **)props.getList());
1563 kumpf          1.92          }
1564 marek          1.63  
1565 thilo.boehm    1.143         PEG_TRACE((
1566                                  TRC_PROVIDERMANAGER,
1567                                  Tracer::LEVEL2,
1568                                  "Returning from provider.references: %s",
1569                                  (const char*)pr.getName().getCString()));
1570                      
1571 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
1572 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
1573 dave.sudlik    1.99  //      rc.msg is also localized.
1574                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
1575 kumpf          1.151         CMPIData cldata =
1576 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
1577 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
1578                              {
1579                                  response->operationContext.set(
1580                                      ContentLanguageListContainer(
1581 venkat.puvvada 1.108                 ContentLanguageList(
1582                                      LanguageParser::parseContentLanguageHeader(
1583 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
1584 dave.sudlik    1.103             handler.setContext(response->operationContext);
1585 dave.sudlik    1.99          }
1586 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
1587 marek          1.63      }
1588                          HandlerCatch(handler);
1589                      
1590                          PEG_METHOD_EXIT();
1591                      
1592                          return(response);
1593                      }
1594                      
1595 venkat.puvvada 1.108 Message * CMPIProviderManager::handleReferenceNamesRequest(
1596                          const Message * message)
1597 marek          1.63  {
1598 ms.aruran      1.115     PEG_METHOD_ENTER(
1599                              TRC_PROVIDERMANAGER,
1600                              "CMPIProviderManager::handleReferenceNamesRequest()");
1601 marek          1.63  
1602 kumpf          1.92      HandlerIntro(ReferenceNames,message,request,response,handler);
1603 venkat.puvvada 1.108     try
1604                          {
1605 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
1606 marek          1.129             "CMPIProviderManager::handleReferenceNamesRequest"
1607                                  " - Host name: %s  Name space: %s  Class name: %s",
1608                                  (const char*) System::getHostName().getCString(),
1609                                  (const char*) request->nameSpace.getString().getCString(),
1610                                  (const char*)
1611                                      request->objectName.getClassName().getString().getCString()));
1612 kumpf          1.151 
1613 marek          1.63          Boolean remote=false;
1614 venkat.puvvada 1.132         OpProviderHolder ph;
1615 marek          1.157         CString remoteInfo;
1616 thilo.boehm    1.162 
1617 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
1618                                  &(request->operationContext),
1619                                  &ph,
1620                                  &remoteInfo,
1621                                  remote);
1622 marek          1.63  
1623 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL4,
1624                                  "--- CMPIProviderManager::referenceNames -- role: %s< aCls %s",
1625                                  (const char*)request->role.getCString(),
1626                                  (const char*)request->resultClass.getString().getCString()));
1627 marek          1.63  
1628                              CMPIStatus rc={CMPI_RC_OK,NULL};
1629 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
1630 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
1631                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
1632 marek          1.63          const CString rClass=request->resultClass.getString().getCString();
1633                              const CString rRole=request->role.getCString();
1634                      
1635 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
1636 thilo.boehm    1.162         CString className =
1637                                  request->objectName.getClassName().getString().getCString();
1638                      
1639 marek          1.124         _setupCMPIContexts(
1640 venkat.puvvada 1.108             &eCtx,
1641 marek          1.157             &(request->operationContext),
1642                                  &nameSpace,
1643                                  &remoteInfo,
1644 marek          1.124             remote,
1645                                  false,
1646                                  false,
1647                                  true);
1648 marek          1.63  
1649 thilo.boehm    1.162         SCMOInstance * objectPath = getSCMOObjectPathFromRequest(
1650                                  nameSpace, className, request->objectName);
1651                      
1652                              CMPI_ObjectPathOnStack eRef(objectPath);
1653                      
1654 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
1655                      
1656 thilo.boehm    1.143         PEG_TRACE((
1657                                  TRC_PROVIDERMANAGER,
1658                                  Tracer::LEVEL2,
1659                                  "Calling provider.referenceNames: %s",
1660                                  (const char*)pr.getName().getCString()));
1661                      
1662 kumpf          1.92          {
1663 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
1664                      
1665 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
1666 marek          1.63  
1667 venkat.puvvada 1.132             rc = pr.getAssocMI()->ft->referenceNames(
1668                                      pr.getAssocMI(),
1669                                      &eCtx,
1670                                      &eRes,
1671                                      &eRef,
1672                                      CHARS(rClass),
1673                                      CHARS(rRole));
1674 kumpf          1.92          }
1675 marek          1.63  
1676 thilo.boehm    1.143         PEG_TRACE((
1677                                  TRC_PROVIDERMANAGER,
1678                                  Tracer::LEVEL2,
1679                                  "Returning from provider.referenceNames: %s",
1680                                  (const char*)pr.getName().getCString()));
1681                      
1682 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
1683 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
1684 dave.sudlik    1.99  //      rc.msg is also localized.
1685                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
1686 kumpf          1.151         CMPIData cldata =
1687 venkat.puvvada 1.108              eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
1688 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
1689                              {
1690                                  response->operationContext.set(
1691                                      ContentLanguageListContainer(
1692 venkat.puvvada 1.108                 ContentLanguageList(
1693                                      LanguageParser::parseContentLanguageHeader(
1694 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
1695 dave.sudlik    1.103             handler.setContext(response->operationContext);
1696 dave.sudlik    1.99          }
1697 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
1698 marek          1.63      }
1699                          HandlerCatch(handler);
1700                      
1701                          PEG_METHOD_EXIT();
1702                      
1703                          return(response);
1704                      }
1705                      
1706 venkat.puvvada 1.108 Message * CMPIProviderManager::handleInvokeMethodRequest(
1707                          const Message * message)
1708 marek          1.63  {
1709 ms.aruran      1.115     PEG_METHOD_ENTER(
1710                              TRC_PROVIDERMANAGER,
1711                              "CMPIProviderManager::handleInvokeMethodRequest()");
1712 marek          1.63  
1713 kumpf          1.92      HandlerIntro(InvokeMethod,message,request,response,handler);
1714 venkat.puvvada 1.108     try
1715                          {
1716 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
1717 marek          1.129             "CMPIProviderManager::handleInvokeMethodRequest"
1718                                  " - Host name: %s  Name space: %s  Class name: %s",
1719                                  (const char*) System::getHostName().getCString(),
1720                                  (const char*) request->nameSpace.getString().getCString(),
1721                                  (const char*)
1722                                      request->instanceName.getClassName().getString().getCString()));
1723 marek          1.63  
1724                              Boolean remote=false;
1725 venkat.puvvada 1.132         OpProviderHolder ph;
1726 marek          1.157         CString remoteInfo;
1727 thilo.boehm    1.162 
1728 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
1729                                  &(request->operationContext),
1730                                  &ph,
1731                                  &remoteInfo,
1732                                  remote);
1733 marek          1.63  
1734                              CMPIStatus rc={CMPI_RC_OK,NULL};
1735 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
1736 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(handler,pr.getBroker());
1737                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
1738 marek          1.63          CMPI_ArgsOnStack eArgsIn(request->inParameters);
1739                              Array<CIMParamValue> outArgs;
1740                              CMPI_ArgsOnStack eArgsOut(outArgs);
1741                              CString mName=request->methodName.getString().getCString();
1742 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
1743 thilo.boehm    1.162         CString className = request->className.getString().getCString();
1744 marek          1.63  
1745 marek          1.124         _setupCMPIContexts(
1746 venkat.puvvada 1.108             &eCtx,
1747 marek          1.157             &(request->operationContext),
1748                                  &nameSpace,
1749                                  &remoteInfo,
1750 marek          1.124             remote,
1751                                  false,
1752                                  false,
1753                                  true);
1754 marek          1.63  
1755 thilo.boehm    1.162 
1756                              SCMOInstance * objectPath = getSCMOObjectPathFromRequest(
1757                                  nameSpace, className, request->instanceName);
1758                      
1759                              CMPI_ObjectPathOnStack eRef(objectPath);
1760                      
1761 marek          1.63          CMPIProvider::pm_service_op_lock op_lock(&pr);
1762                      
1763 thilo.boehm    1.143         PEG_TRACE((
1764                                  TRC_PROVIDERMANAGER,
1765                                  Tracer::LEVEL2,
1766                                  "Calling provider.invokeMethod: %s",
1767                                  (const char*)pr.getName().getCString()));
1768                      
1769 kumpf          1.92          {
1770 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
1771                      
1772 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
1773 marek          1.63  
1774 venkat.puvvada 1.132             rc = pr.getMethMI()->ft->invokeMethod(
1775                                      pr.getMethMI(),
1776                                      &eCtx,
1777                                      &eRes,
1778                                      &eRef,
1779                                      CHARS(mName),
1780                                      &eArgsIn,
1781                                      &eArgsOut);
1782 kumpf          1.92          }
1783 marek          1.63  
1784 thilo.boehm    1.143         PEG_TRACE((
1785                                  TRC_PROVIDERMANAGER,
1786                                  Tracer::LEVEL2,
1787                                  "Returning from provider.invokeMethod: %s",
1788                                  (const char*)pr.getName().getCString()));
1789                      
1790 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
1791 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
1792 dave.sudlik    1.99  //      rc.msg is also localized.
1793                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
1794 kumpf          1.151         CMPIData cldata =
1795 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
1796 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
1797                              {
1798                                  response->operationContext.set(
1799                                      ContentLanguageListContainer(
1800 venkat.puvvada 1.108                 ContentLanguageList(
1801                                      LanguageParser::parseContentLanguageHeader(
1802 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
1803 dave.sudlik    1.103             handler.setContext(response->operationContext);
1804 dave.sudlik    1.99          }
1805 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
1806 dave.sudlik    1.102 
1807 kumpf          1.151         // Even if external normalization is enabled we don't normalize the
1808 venkat.puvvada 1.121         // Embedded instances present in output args. Normalize them here.
1809 a.dunfey       1.85          {
1810                                  // There is no try catch here because if there is no external
1811                                  // normalization, then these containers were added by this method.
1812                                  const CachedClassDefinitionContainer * classCont =
1813                                      dynamic_cast<const CachedClassDefinitionContainer *>(
1814 venkat.puvvada 1.108                 &request->operationContext.get(
1815                                      CachedClassDefinitionContainer::NAME));
1816 kumpf          1.106             PEGASUS_ASSERT(classCont != 0);
1817                      
1818 mike           1.148             CIMConstClass classDef(classCont->getClass());
1819 a.dunfey       1.85              Uint32 methodIndex = classDef.findMethod(request->methodName);
1820 venkat.puvvada 1.152             CIMConstMethod methodDef;
1821 kavita.gupta   1.153             if (methodIndex != PEG_NOT_FOUND)
1822 venkat.puvvada 1.152             {
1823                                      methodDef = classDef.getMethod(methodIndex);
1824                                  }
1825 venkat.puvvada 1.108             for (unsigned int i = 0, n = outArgs.size(); i < n; ++i)
1826 a.dunfey       1.85              {
1827                                      CIMParamValue currentParam(outArgs[i]);
1828                                      CIMValue paramValue(currentParam.getValue());
1829                                      // If the parameter value is an EmbeddedObject type, we have
1830                                      // to check against the type of the parameter definition.
1831                                      // CMPI does not distinguish between EmbeddedObjects and
1832                                      // EmbeddedInstances, so if the parameter definition has a type
1833                                      // of EmbeddedInstance, the type of the output parameter must
1834                                      // be changed.
1835 thilo.boehm    1.162                 if (paramValue.getType() == CIMTYPE_OBJECT &&
1836 venkat.puvvada 1.152                     methodIndex != PEG_NOT_FOUND)
1837 a.dunfey       1.85                  {
1838                                          String currentParamName(currentParam.getParameterName());
1839                                          Uint32 paramIndex = methodDef.findParameter(
1840                                              CIMName(currentParamName));
1841 venkat.puvvada 1.108                     if (paramIndex == PEG_NOT_FOUND)
1842 a.dunfey       1.85                      {
1843                                              MessageLoaderParms msg("ProviderManager.CMPI."
1844                                                  "CMPIProviderManager.PARAMETER_NOT_FOUND",
1845 dave.sudlik    1.117                             "Parameter $0 not found in definition for "
1846                                                  "method $1.", currentParamName,
1847 a.dunfey       1.85                              request->methodName.getString());
1848 thilo.boehm    1.138 
1849                                              PEG_TRACE((TRC_PROVIDERMANAGER, Tracer::LEVEL1,
1850                                                  "Parameter %s not found in definition for "
1851                                                  "method %s.",
1852                                                  (const char*)currentParamName.getCString(),
1853                                                  (const char*)
1854                                                      request->methodName.getString().getCString()));
1855                      
1856 a.dunfey       1.85                          handler.setStatus(CIM_ERR_FAILED,
1857 dave.sudlik    1.117                             MessageLoader::getMessage(msg));
1858 a.dunfey       1.85                      }
1859                                          else
1860                                          {
1861                                              CIMConstParameter paramDef(
1862                                                  methodDef.getParameter(paramIndex));
1863 thilo.boehm    1.135                         if (paramDef.findQualifier(
1864                                                      PEGASUS_QUALIFIERNAME_EMBEDDEDINSTANCE)
1865 a.dunfey       1.85                              != PEG_NOT_FOUND)
1866                                              {
1867 venkat.puvvada 1.126                             if (paramValue.isArray())
1868 kumpf          1.151                             {
1869 venkat.puvvada 1.126                                 Array<CIMInstance> paramInstArr;
1870                                                      Array<CIMObject> paramObjectArr;
1871                                                      paramValue.get(paramObjectArr);
1872 kumpf          1.151                                 for (Uint32 j = 0 ;
1873 kumpf          1.134                                     j < paramObjectArr.size() ; ++j)
1874 venkat.puvvada 1.126                                 {
1875                                                          paramInstArr.append(
1876 kumpf          1.134                                         CIMInstance(paramObjectArr[j]));
1877 venkat.puvvada 1.126                                 }
1878                                                      currentParam = CIMParamValue(currentParamName,
1879                                                          CIMValue(paramInstArr));
1880                                                  }
1881                                                  else
1882                                                  {
1883                                                      CIMObject paramObject;
1884                                                      paramValue.get(paramObject);
1885                                                      CIMInstance paramInst(paramObject);
1886                                                      currentParam = CIMParamValue(currentParamName,
1887                                                          CIMValue(paramInst));
1888                                                  }
1889 a.dunfey       1.85                          }
1890                                              else
1891                                              {
1892                                                  currentParam = CIMParamValue(currentParamName,
1893 venkat.puvvada 1.126                                 paramValue);
1894 a.dunfey       1.85                          }
1895                      
1896                                              handler.deliverParamValue(currentParam);
1897                                          }
1898                                      }
1899                                      else
1900                                      {
1901                                          handler.deliverParamValue(currentParam);
1902                                      }
1903                                  }
1904                              }
1905 venkat.puvvada 1.108         handler.complete();
1906 marek          1.63      }
1907                          HandlerCatch(handler);
1908                      
1909                          PEG_METHOD_EXIT();
1910                      
1911                          return(response);
1912                      }
1913                      
1914 venkat.puvvada 1.108 int LocateIndicationProviderNames(
1915                          const CIMInstance& pInstance,
1916                          const CIMInstance& pmInstance,
1917 kumpf          1.151     String& providerName,
1918 venkat.puvvada 1.108     String& location)
1919 marek          1.63  {
1920 ms.aruran      1.115    PEG_METHOD_ENTER(
1921                              TRC_PROVIDERMANAGER,
1922                              "CMPIProviderManager:LocateIndicationProviderNames()");
1923 marek          1.139     Uint32 pos = pInstance.findProperty(PEGASUS_PROPERTYNAME_NAME);
1924 marek          1.63      pInstance.getProperty(pos).getValue().get(providerName);
1925                      
1926                          pos = pmInstance.findProperty(CIMName ("Location"));
1927                          pmInstance.getProperty(pos).getValue().get(location);
1928 ms.aruran      1.115     PEG_METHOD_EXIT();
1929 marek          1.63      return 0;
1930                      }
1931                      
1932 venkat.puvvada 1.145 String CMPIProviderManager::_getClassNameFromQuery(
1933                          CIMOMHandleQueryContext *context,
1934                          String &query,
1935                          String &lang)
1936                      {
1937 venkat.puvvada 1.146     String className;
1938                      
1939 venkat.puvvada 1.145     try
1940                          {
1941                              QueryExpression qe(lang, query, *context);
1942                              // Neither WQL nor CQL support joins, we should get only
1943                              // one class path here.
1944                              PEGASUS_ASSERT(qe.getClassPathList().size() == 1);
1945 venkat.puvvada 1.146         className = qe.getClassPathList()[0].getClassName().getString();
1946 venkat.puvvada 1.145     }
1947                          catch(QueryException&)
1948                          {
1949                              // We should never get query parsing exceptions, IndicationService
1950                              // already performed this checking.
1951                              PEGASUS_ASSERT(0);
1952                          }
1953 venkat.puvvada 1.146     return className;
1954 venkat.puvvada 1.145 }
1955                      
1956 kavita.gupta   1.158 void CMPIProviderManager::_throwCIMException(
1957                          CMPIStatus rc,
1958                          CMPI_Error* cmpiError)
1959                      {
1960                          if (rc.rc!=CMPI_RC_OK)
1961                          {
1962                              CIMException cimException(
1963                                  (CIMStatusCode)rc.rc,
1964                                  rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY);
1965                              if (cmpiError)
1966                              {
1967                                  for (CMPI_Error* currErr=cmpiError;
1968                                      currErr!=NULL;
1969                                      currErr=currErr->nextError)
1970                                  {
1971                                      cimException.addError(
1972                                          ((CIMError*)currErr->hdl)->getInstance());
1973                                  }
1974                              }
1975                              throw cimException;
1976                          }
1977 kavita.gupta   1.158 
1978                      }
1979                      
1980 venkat.puvvada 1.108 Message * CMPIProviderManager::handleCreateSubscriptionRequest(
1981                          const Message * message)
1982 marek          1.63  {
1983 ms.aruran      1.115     PEG_METHOD_ENTER(
1984                              TRC_PROVIDERMANAGER,
1985                              "CMPIProviderManager::handleCreateSubscriptionRequest()");
1986 marek          1.63  
1987                          HandlerIntroInd(CreateSubscription,message,request,response,
1988 venkat.puvvada 1.108         handler);
1989                          try
1990                          {
1991 marek          1.63          CIMInstance req_provider, req_providerModule;
1992 kumpf          1.151         ProviderIdContainer pidc =
1993 venkat.puvvada 1.108             (ProviderIdContainer)request->operationContext.get(
1994                                  ProviderIdContainer::NAME);
1995 marek          1.63          req_provider = pidc.getProvider();
1996                              req_providerModule = pidc.getModule();
1997                      
1998                              String providerName,providerLocation;
1999                              LocateIndicationProviderNames(req_provider, req_providerModule,
2000 venkat.puvvada 1.108             providerName,providerLocation);
2001 marek          1.63  
2002 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
2003 marek          1.129             "CMPIProviderManager::handleCreateSubscriptionRequest"
2004                                  " - Host name: %s  Name space: %s  Provider name(s): %s",
2005                                  (const char*) System::getHostName().getCString(),
2006                                  (const char*) request->nameSpace.getString().getCString(),
2007                                  (const char*) providerName.getCString()));
2008 marek          1.63  
2009                              Boolean remote=false;
2010 venkat.puvvada 1.132         OpProviderHolder ph;
2011 marek          1.157         CString remoteInfo;
2012 thilo.boehm    1.162 
2013 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
2014                                  &(request->operationContext),
2015                                  &ph,
2016                                  &remoteInfo,
2017                                  remote);
2018 marek          1.63  
2019                              //
2020                              //  Save the provider instance from the request
2021                              //
2022 marek          1.157         pr.setProviderInstance (req_provider);
2023 marek          1.63  
2024 kumpf          1.151         CIMObjectPath subscriptionName =
2025 venkat.puvvada 1.108             request->subscriptionInstance.getPath();
2026 marek          1.63  
2027                              CMPIStatus rc={CMPI_RC_OK,NULL};
2028 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
2029 kumpf          1.151         SubscriptionFilterConditionContainer sub_cntr =
2030 venkat.puvvada 1.108             request->operationContext.get(
2031                                  SubscriptionFilterConditionContainer::NAME);
2032                      
2033 harsha.bm      1.159         CIMOMHandleQueryContext _context(
2034 venkat.puvvada 1.108             CIMNamespaceName(
2035                                  request->nameSpace.getString()),
2036 venkat.puvvada 1.132             *pr.getCIMOMHandle());
2037 venkat.puvvada 1.108 
2038                              CMPI_SelectExp *eSelx=new CMPI_SelectExp(
2039 marek          1.157             request->operationContext,
2040 harsha.bm      1.159             &_context,
2041 venkat.puvvada 1.108             request->query,
2042                                  sub_cntr.getQueryLanguage());
2043 marek          1.63  
2044 venkat.puvvada 1.160         IndProvRecord *indProvRec=NULL;
2045                              const CIMObjectPath &sPath=request->subscriptionInstance.getPath();
2046                      
2047                              {
2048                                  WriteLock lock(rwSemProvTab);
2049                                  indProvTab.lookup(pr.getName(), indProvRec);
2050                                  if (indProvRec == NULL)
2051                                  {
2052                                      indProvRec = new IndProvRecord();
2053                      #ifdef PEGASUS_ENABLE_REMOTE_CMPI
2054                                      if (remote)
2055                                      {
2056                                          indProvRec->setRemoteInfo((const char*)remoteInfo);
2057                                      }
2058                      #endif
2059                                      indProvTab.insert(pr.getName(), indProvRec);                
2060                                  }
2061                                  // Note that per provider subscription path MUST be unique.
2062                                  Boolean ok = indProvRec->addSelectExp(sPath, eSelx);
2063                                  PEGASUS_ASSERT(ok);
2064                              }
2065 venkat.puvvada 1.160 
2066 marek          1.63  
2067 venkat.puvvada 1.132         CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
2068 marek          1.63  
2069 venkat.puvvada 1.145         String lang(sub_cntr.getQueryLanguage());
2070                              CString className = _getClassNameFromQuery(
2071 harsha.bm      1.159             &_context,
2072 venkat.puvvada 1.145             request->query,
2073                                  lang).getCString();
2074 thilo.boehm    1.162         CString nameSpace = request->nameSpace.getString().getCString();
2075 kumpf          1.151 
2076 venkat.puvvada 1.145         CIMObjectPath indClassPath(
2077                                  System::getHostName(),
2078                                  request->nameSpace,
2079                                  (const char*)className);
2080                      
2081                              eSelx->classNames.append(indClassPath);
2082 marek          1.63  
2083 thilo.boehm    1.162         SCMOInstance * indClassPathSCMO =
2084                                  getSCMOClassFromRequest(nameSpace, className);
2085                              indClassPathSCMO->setHostName(
2086                                  (const char*)System::getHostName().getCString());
2087                              eSelx->classNamesSCMO.append(*indClassPathSCMO);
2088                              delete indClassPathSCMO;
2089                      
2090 marek          1.63          CIMPropertyList propertyList = request->propertyList;
2091 venkat.puvvada 1.108         if (!propertyList.isNull())
2092                              {
2093                                  Array<CIMName> p=propertyList.getPropertyNameArray();
2094                                  int pCount=p.size();
2095                                  eSelx->props = new const char*[1+pCount];
2096                                  for (int i=0; i<pCount; i++)
2097                                  {
2098                                      eSelx->props[i]=strdup(p[i].getString().getCString());
2099                                  }
2100                                  eSelx->props[pCount]=NULL;
2101 marek          1.63          }
2102                      
2103 marek          1.124         // includeQualifiers and includeClassOrigin not of interest for
2104                              // this type of request
2105                              _setupCMPIContexts(
2106 kumpf          1.79              &eCtx,
2107 marek          1.157             &(request->operationContext),
2108                                  &nameSpace,
2109                                  &remoteInfo,
2110 marek          1.124             remote);
2111 marek          1.63  
2112                              CMPIProvider::pm_service_op_lock op_lock(&pr);
2113                      
2114 thilo.boehm    1.143         PEG_TRACE((
2115                                  TRC_PROVIDERMANAGER,
2116                                  Tracer::LEVEL2,
2117                                  "Calling provider.createSubscriptionRequest: %s",
2118                                  (const char*)pr.getName().getCString()));
2119                      
2120 venkat.puvvada 1.145         Boolean filterActivated = false;
2121 kumpf          1.92          {
2122 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
2123                      
2124 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
2125 venkat.puvvada 1.160 
2126 venkat.puvvada 1.145             // Call activateFilter() on each subclass name, Check if atleast one
2127                                  // filter can be activated for any of the subclasses.
2128                                  for (Uint32 i = 0, n = request->classNames.size(); i < n; i++)
2129                                  {
2130 thilo.boehm    1.162                 CString subClassName =
2131                                          request->classNames[i].getString().getCString();
2132                      
2133                                      // make target object paths
2134 venkat.puvvada 1.145                 CIMObjectPath classPath(
2135                                          System::getHostName(),
2136                                          request->nameSpace,
2137                                          request->classNames[i]);
2138                      
2139 thilo.boehm    1.162                 SCMOInstance * classPathSCMO =
2140 venkat.puvvada 1.165                     getSCMOClassFromRequest(nameSpace, subClassName);
2141 thilo.boehm    1.162                 classPathSCMO->setHostName(
2142                                          (const char*)System::getHostName().getCString());
2143                                      CMPI_ObjectPathOnStack eRef(classPathSCMO);
2144 venkat.puvvada 1.145 
2145                                      if (pr.getIndMI()->ft->ftVersion >= 100)
2146                                      {
2147                                          rc = pr.getIndMI()->ft->activateFilter(
2148                                              pr.getIndMI(),
2149                                              &eCtx,
2150                                              eSelx,
2151                                              CHARS(className),
2152                                              &eRef,
2153 venkat.puvvada 1.160                         i == 0);
2154 venkat.puvvada 1.145                 }
2155                                      else
2156                                      {
2157                                          // Older version of (pre 1.00) also pass in a CMPIResult
2158 kumpf          1.92  
2159 venkat.puvvada 1.145                     rc = ((CMPIStatus (*)(
2160                                                   CMPIIndicationMI*,
2161                                                   CMPIContext*,
2162                                                   CMPIResult*,
2163                                                   CMPISelectExp*,
2164                                                   const char *,
2165                                                   CMPIObjectPath*,
2166                                                   CMPIBoolean))pr.getIndMI()->ft->activateFilter)
2167                                                       (pr.getIndMI(),
2168                                                        &eCtx,
2169                                                        NULL,
2170                                                        eSelx,
2171                                                        CHARS(className),
2172                                                        &eRef,
2173 venkat.puvvada 1.160                                   i == 0);
2174 venkat.puvvada 1.145                 }
2175 venkat.puvvada 1.160 
2176 venkat.puvvada 1.145                 if (rc.rc == CMPI_RC_OK)
2177                                      {
2178                                          filterActivated = true;
2179                                          eSelx->classNames.append(classPath);
2180 thilo.boehm    1.162                     eSelx->classNamesSCMO.append(*classPathSCMO);
2181 venkat.puvvada 1.145                 }
2182                                      else
2183                                      {
2184                                          PEG_TRACE((
2185                                              TRC_PROVIDERMANAGER,
2186                                              Tracer::LEVEL2,
2187                                              "activateFilter() for class %s in namespace %s "
2188                                                  "failed. Error : %s",
2189                                              CHARS(classPath.getClassName().
2190                                                  getString().getCString()),
2191                                              CHARS(request->nameSpace.getString().getCString()),
2192                                              rc.msg ? CMGetCharsPtr(rc.msg, NULL) : "Unknown"));
2193                                      }
2194 kumpf          1.92              }
2195                              }
2196 marek          1.63  
2197 thilo.boehm    1.143         PEG_TRACE((
2198                                  TRC_PROVIDERMANAGER,
2199                                  Tracer::LEVEL2,
2200                                  "Returning from provider.createSubscriptionRequest: %s",
2201                                  (const char*)pr.getName().getCString()));
2202                      
2203 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
2204 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
2205 dave.sudlik    1.99  //      rc.msg is also localized.
2206                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
2207 kumpf          1.151         CMPIData cldata =
2208 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
2209 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
2210                              {
2211                                  response->operationContext.set(
2212                                      ContentLanguageListContainer(
2213 venkat.puvvada 1.108                 ContentLanguageList(
2214                                      LanguageParser::parseContentLanguageHeader(
2215 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
2216 dave.sudlik    1.99          }
2217                      
2218 venkat.puvvada 1.145         if (!filterActivated)
2219 marek          1.63          {
2220 venkat.puvvada 1.160             //  Remove the select expression from the cache
2221                                  WriteLock lock(rwSemProvTab);
2222                                  Boolean ok = indProvRec->deleteSelectExp(sPath);
2223                                  PEGASUS_ASSERT(ok);
2224                                  delete eSelx;
2225 venkat.puvvada 1.108             throw CIMException((CIMStatusCode)rc.rc,
2226 s.kodali       1.137                 rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY);
2227 marek          1.63          }
2228                              else
2229                              {
2230                                  //
2231                                  //  Increment count of current subscriptions for this provider
2232                                  //
2233                                  if (ph.GetProvider ().testIfZeroAndIncrementSubscriptions ())
2234                                  {
2235                                      //
2236                                      //  If there were no current subscriptions before the increment,
2237                                      //  the first subscription has been created
2238                                      //  Call the provider's enableIndications method
2239                                      //
2240                                      if (_subscriptionInitComplete)
2241                                      {
2242                                          _callEnableIndications (req_provider, _indicationCallback,
2243 marek          1.124                         ph, (const char*)pidc.getRemoteInfo().getCString());
2244 marek          1.63                  }
2245                                  }
2246                              }
2247                          }
2248                          HandlerCatch(handler);
2249                      
2250                          PEG_METHOD_EXIT();
2251                      
2252                          return(response);
2253                      }
2254                      
2255 venkat.puvvada 1.108 Message * CMPIProviderManager::handleDeleteSubscriptionRequest(
2256                          const Message * message)
2257 marek          1.63  {
2258 ms.aruran      1.115     PEG_METHOD_ENTER(
2259                              TRC_PROVIDERMANAGER,
2260                              "CMPIProviderManager::handleDeleteSubscriptionRequest()");
2261 marek          1.63  
2262                          HandlerIntroInd(DeleteSubscription,message,request,response,
2263 venkat.puvvada 1.108         handler);
2264                          try
2265                          {
2266 marek          1.63          String providerName,providerLocation;
2267                      
2268                              CIMInstance req_provider, req_providerModule;
2269 kumpf          1.151         ProviderIdContainer pidc =
2270 venkat.puvvada 1.108             (ProviderIdContainer)request->operationContext.get(
2271                                  ProviderIdContainer::NAME);
2272 marek          1.63          req_provider = pidc.getProvider();
2273                              req_providerModule = pidc.getModule();
2274                      
2275                              LocateIndicationProviderNames(req_provider, req_providerModule,
2276 venkat.puvvada 1.108             providerName,providerLocation);
2277 marek          1.63  
2278 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
2279 marek          1.129             "CMPIProviderManager::handleDeleteSubscriptionRequest"
2280                                  " - Host name: %s  Name space: %s  Provider name(s): %s",
2281                                  (const char*) System::getHostName().getCString(),
2282                                  (const char*) request->nameSpace.getString().getCString(),
2283                                  (const char*) providerName.getCString()));
2284 marek          1.63  
2285                              Boolean remote=false;
2286 venkat.puvvada 1.132         OpProviderHolder ph;
2287 marek          1.157         CString remoteInfo;
2288 thilo.boehm    1.162 
2289 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
2290                                  &(request->operationContext),
2291                                  &ph,
2292                                  &remoteInfo,
2293                                  remote);
2294 marek          1.63  
2295 venkat.puvvada 1.160         const CIMObjectPath &sPath=request->subscriptionInstance.getPath();
2296                              IndProvRecord *indProvRec=NULL;
2297                              CMPI_SelectExp *eSelx=NULL;
2298 marek          1.95          {
2299 venkat.puvvada 1.160             WriteLock lock(rwSemProvTab);
2300                                  indProvTab.lookup(pr.getName(),indProvRec);
2301                                  if (!indProvRec->lookupSelectExp(sPath, eSelx))
2302 venkat.puvvada 1.108             {
2303 venkat.puvvada 1.160                 MessageLoaderParms parms(
2304                                          "ProviderManager.CMPI.CMPIProviderManager."
2305                                              "FAILED_LOCATE_SUBSCRIPTION_FILTER",
2306                                          "Failed to locate the subscription filter.");
2307                                      // failed to get select expression from hash table
2308                                      throw CIMException(CIM_ERR_FAILED, parms);
2309 venkat.puvvada 1.108             }
2310 venkat.puvvada 1.160             Boolean ok = indProvRec->deleteSelectExp(sPath);
2311                                  PEGASUS_ASSERT(ok);
2312 marek          1.95          }
2313 marek          1.63  
2314 venkat.puvvada 1.145         CString className = eSelx->classNames[0].getClassName().
2315                                  getString().getCString();
2316                      
2317 kumpf          1.151         CIMObjectPath subscriptionName =
2318 venkat.puvvada 1.108             request->subscriptionInstance.getPath();
2319 marek          1.63  
2320                              CMPIStatus rc={CMPI_RC_OK,NULL};
2321 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
2322 venkat.puvvada 1.132         CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
2323 thilo.boehm    1.162 
2324 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
2325 marek          1.63  
2326 marek          1.124         // includeQualifiers and includeClassOrigin not of interest for
2327                              // this type of request
2328                              _setupCMPIContexts(
2329 venkat.puvvada 1.108             &eCtx,
2330 marek          1.157             &(request->operationContext),
2331                                  &nameSpace,
2332                                  &remoteInfo,
2333 marek          1.124             remote);
2334 marek          1.63  
2335                              CMPIProvider::pm_service_op_lock op_lock(&pr);
2336                      
2337 thilo.boehm    1.143         PEG_TRACE((
2338                                  TRC_PROVIDERMANAGER,
2339                                  Tracer::LEVEL2,
2340                                  "Calling provider.deleteSubscriptionRequest: %s",
2341                                  (const char*)pr.getName().getCString()));
2342                      
2343 kumpf          1.92          {
2344 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
2345                      
2346 kumpf          1.92              StatProviderTimeMeasurement providerTime(response);
2347                      
2348 venkat.puvvada 1.145             // Call deactivateFilter() for each subclass name those were
2349                                  // activated previously using activateFilter().
2350                                  // Note: Start from Index 1, first name is actual class name in
2351                                  // the FROM clause of filter query.
2352                                  for (Uint32 i = 1, n = eSelx->classNames.size(); i < n ; ++i)
2353                                  {
2354 thilo.boehm    1.162                 CMPI_ObjectPathOnStack eRef(eSelx->classNamesSCMO[i]);
2355 venkat.puvvada 1.145                 if (pr.getIndMI()->ft->ftVersion >= 100)
2356                                      {
2357                                          rc = pr.getIndMI()->ft->deActivateFilter(
2358                                              pr.getIndMI(),
2359                                              &eCtx,
2360                                              eSelx,
2361                                              CHARS(className),
2362                                              &eRef,
2363 venkat.puvvada 1.160                         i == n - 1);
2364 venkat.puvvada 1.145                 }
2365                                      else
2366                                      {
2367                                          // Older version of (pre 1.00) also pass in a CMPIResult
2368 marek          1.63  
2369 venkat.puvvada 1.145                     rc = ((CMPIStatus (*)(
2370                                              CMPIIndicationMI*,
2371                                              CMPIContext*,
2372                                              CMPIResult*,
2373                                              CMPISelectExp*,
2374 kumpf          1.151                         const char *,
2375 venkat.puvvada 1.145                         CMPIObjectPath*,
2376                                              CMPIBoolean)) pr.getIndMI()->ft->deActivateFilter)(
2377                                                  pr.getIndMI(),
2378                                                  &eCtx,
2379                                                  NULL,
2380                                                  eSelx,
2381                                                  CHARS(className),
2382                                                  &eRef,
2383 venkat.puvvada 1.160                             i == n - 1);
2384 venkat.puvvada 1.145                 }
2385                                      if (rc.rc != CMPI_RC_OK)
2386                                      {
2387                                          PEG_TRACE((
2388                                              TRC_PROVIDERMANAGER,
2389                                              Tracer::LEVEL2,
2390                                              "deactivateFilter() for class %s in namespace %s"
2391                                                  "failed. Error : %s",
2392                                              CHARS(eSelx->classNames[i].getClassName().
2393                                                  getString().getCString()),
2394                                              CHARS(request->nameSpace.getString().getCString()),
2395                                              rc.msg ? CMGetCharsPtr(rc.msg, NULL) : "Unknown"));
2396                                      }
2397 kumpf          1.92              }
2398                              }
2399 marek          1.63  
2400 thilo.boehm    1.143         PEG_TRACE((
2401                                  TRC_PROVIDERMANAGER,
2402                                  Tracer::LEVEL2,
2403                                  "Returning from provider.deleteSubscriptionRequest: %s",
2404                                  (const char*)pr.getName().getCString()));
2405                      
2406 venkat.puvvada 1.160         delete eSelx;
2407 marek          1.63  
2408 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
2409 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
2410 dave.sudlik    1.99  //      rc.msg is also localized.
2411                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
2412 kumpf          1.151         CMPIData cldata =
2413 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
2414 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
2415                              {
2416                                  response->operationContext.set(
2417                                      ContentLanguageListContainer(
2418 venkat.puvvada 1.108                 ContentLanguageList(
2419                                      LanguageParser::parseContentLanguageHeader(
2420 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
2421 dave.sudlik    1.99          }
2422                      
2423 marek          1.63          if (rc.rc!=CMPI_RC_OK)
2424                              {
2425 venkat.puvvada 1.108             throw CIMException((CIMStatusCode)rc.rc,
2426 s.kodali       1.137                 rc.msg ? CMGetCharsPtr(rc.msg, NULL) : String::EMPTY);
2427 marek          1.63          }
2428                              else
2429                              {
2430                                  //
2431                                  //  Decrement count of current subscriptions for this provider
2432                                  //
2433 marek          1.157             if (pr.decrementSubscriptionsAndTestIfZero ())
2434 marek          1.63              {
2435 venkat.puvvada 1.160                 Boolean callDisable = false;
2436                                      {
2437                                          WriteLock lock(rwSemProvTab);
2438                                          if (!indProvRec->getSelectExpCount())
2439                                          {
2440                                              indProvTab.remove(pr.getName());
2441                                              delete indProvRec;
2442                                              callDisable = true;
2443                                          }
2444                                      }
2445 thilo.boehm    1.162 
2446 marek          1.63                  //
2447                                      //  If there are no current subscriptions after the decrement,
2448                                      //  the last subscription has been deleted
2449                                      //  Call the provider's disableIndications method
2450                                      //
2451 venkat.puvvada 1.160                 if (_subscriptionInitComplete && callDisable)
2452 marek          1.63                  {
2453 marek          1.124                     _callDisableIndications(
2454                                              ph,
2455                                              (const char*)pidc.getRemoteInfo().getCString());
2456 marek          1.63                  }
2457                                  }
2458                              }
2459                          }
2460                          HandlerCatch(handler);
2461                      
2462                          PEG_METHOD_EXIT();
2463                      
2464                          return(response);
2465                      }
2466                      
2467 venkat.puvvada 1.108 Message * CMPIProviderManager::handleDisableModuleRequest(
2468                          const Message * message)
2469 marek          1.63  {
2470 ms.aruran      1.115     PEG_METHOD_ENTER(
2471                              TRC_PROVIDERMANAGER,
2472                              "CMPIProviderManager::handleDisableModuleRequest()");
2473 marek          1.63  
2474                          CIMDisableModuleRequestMessage * request =
2475 venkat.puvvada 1.108         dynamic_cast<CIMDisableModuleRequestMessage *>(
2476                              const_cast<Message *>(message));
2477 marek          1.63  
2478                          PEGASUS_ASSERT(request != 0);
2479                      
2480 venkat.puvvada 1.133     //Set to false when provider refused to unload due to pending operations.
2481                          Boolean disableModuleOk = true;
2482                      
2483 marek          1.63      //
2484                          // Unload providers
2485                          //
2486                          Array<CIMInstance> _pInstances = request->providers;
2487                          Array <Boolean> _indicationProviders = request->indicationProviders;
2488 kumpf          1.151     /* The CIMInstances on request->providers array is completly _different_
2489 venkat.puvvada 1.108        than the request->providerModule CIMInstance. Hence  */
2490 marek          1.63  
2491 konrad.r       1.69      String physicalName=(request->providerModule.getProperty(
2492 venkat.puvvada 1.108         request->
2493                              providerModule.findProperty("Location")).getValue().toString());
2494 marek          1.63  
2495 venkat.puvvada 1.161     String moduleName= request->providerModule.getProperty(
2496                              request->providerModule.findProperty("Name")).getValue().toString();
2497                      
2498 venkat.puvvada 1.108     for (Uint32 i = 0, n = _pInstances.size(); i < n; i++)
2499 marek          1.63      {
2500                              String providerName;
2501 marek          1.139         _pInstances[i].getProperty(_pInstances [i].findProperty
2502                                  (PEGASUS_PROPERTYNAME_NAME)).getValue().get(providerName);
2503 marek          1.63  
2504 marek          1.139         Uint32 pos = _pInstances[i].findProperty(PEGASUS_PROPERTYNAME_NAME);
2505 marek          1.63  
2506 venkat.puvvada 1.161         if (!providerManager.isProviderActive(providerName, moduleName))
2507 venkat.puvvada 1.128         {
2508                                  continue;
2509 venkat.puvvada 1.133         }
2510 kumpf          1.151 
2511 venkat.puvvada 1.133         Boolean unloadOk = providerManager.unloadProvider(
2512 kumpf          1.151             physicalName,
2513 venkat.puvvada 1.133             _pInstances[i].getProperty(
2514 marek          1.139                 _pInstances[i].findProperty(PEGASUS_PROPERTYNAME_NAME)
2515 venkat.puvvada 1.161                 ).getValue ().toString (),
2516                                  moduleName);
2517 venkat.puvvada 1.133 
2518                              if (!unloadOk)
2519                              {
2520                                  disableModuleOk = false;
2521                                  continue;
2522                              }
2523 marek          1.63          //
2524                              //  Reset the indication provider's count of current
2525                              //  subscriptions since it has been disabled
2526                              //
2527                              if (_indicationProviders [i])
2528                              {
2529 venkat.puvvada 1.164             // Remove from IndProvRecord table
2530                                  IndProvRecord *rec = 0;
2531                                  WriteLock lock(rwSemProvTab);
2532                                  if (indProvTab.lookup(providerName, rec))
2533 marek          1.63              {
2534 venkat.puvvada 1.164                 delete rec;
2535                                      indProvTab.remove(providerName);
2536 marek          1.63              }
2537                              }
2538                          }
2539                      
2540 kumpf          1.123     CIMDisableModuleResponseMessage* response =
2541                              dynamic_cast<CIMDisableModuleResponseMessage*>(
2542                                  request->buildResponse());
2543 marek          1.63      PEGASUS_ASSERT(response != 0);
2544 venkat.puvvada 1.133 
2545                          if (disableModuleOk)
2546                          {
2547                              response->operationalStatus.append(
2548                                  CIM_MSE_OPSTATUS_VALUE_STOPPED);
2549                          }
2550                          else
2551                          {
2552                              response->operationalStatus.append(
2553                                  CIM_MSE_OPSTATUS_VALUE_OK);
2554                          }
2555 marek          1.63  
2556                          PEG_METHOD_EXIT();
2557                      
2558                          return(response);
2559                      }
2560                      
2561 venkat.puvvada 1.108 Message * CMPIProviderManager::handleEnableModuleRequest(
2562                          const Message * message)
2563 marek          1.63  {
2564 ms.aruran      1.115     PEG_METHOD_ENTER(
2565                              TRC_PROVIDERMANAGER,
2566                              "CMPIProviderManager::handleEnableModuleRequest()");
2567 marek          1.63  
2568                          CIMEnableModuleRequestMessage * request =
2569 venkat.puvvada 1.108         dynamic_cast<CIMEnableModuleRequestMessage *>(
2570                              const_cast<Message *>(message));
2571 marek          1.63  
2572                          PEGASUS_ASSERT(request != 0);
2573                      
2574                          Array<Uint16> operationalStatus;
2575                          operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK);
2576                      
2577 kumpf          1.123     CIMEnableModuleResponseMessage* response =
2578                              dynamic_cast<CIMEnableModuleResponseMessage*>(
2579                                  request->buildResponse());
2580 marek          1.63      PEGASUS_ASSERT(response != 0);
2581 kumpf          1.123     response->operationalStatus = operationalStatus;
2582 marek          1.63  
2583                          PEG_METHOD_EXIT();
2584                      
2585                          return(response);
2586                      }
2587                      
2588 venkat.puvvada 1.108 Message * CMPIProviderManager::handleStopAllProvidersRequest(
2589                          const Message * message)
2590 marek          1.63  {
2591 ms.aruran      1.115     PEG_METHOD_ENTER(
2592                              TRC_PROVIDERMANAGER,
2593                              "CMPIProviderManager::handleStopAllProvidersRequest()");
2594 marek          1.63  
2595                          CIMStopAllProvidersRequestMessage * request =
2596 venkat.puvvada 1.108         dynamic_cast<CIMStopAllProvidersRequestMessage *>(
2597                              const_cast<Message *>(message));
2598 marek          1.63  
2599                          PEGASUS_ASSERT(request != 0);
2600                      
2601 kumpf          1.123     CIMStopAllProvidersResponseMessage* response =
2602                              dynamic_cast<CIMStopAllProvidersResponseMessage*>(
2603                                  request->buildResponse());
2604 marek          1.63      PEGASUS_ASSERT(response != 0);
2605                      
2606                          // tell the provider manager to shutdown all the providers
2607                          providerManager.shutdownAllProviders();
2608                      
2609                          PEG_METHOD_EXIT();
2610                      
2611                          return(response);
2612                      }
2613                      
2614 venkat.puvvada 1.155 Message* CMPIProviderManager::handleIndicationServiceDisabledRequest(
2615                          Message* message)
2616                      {
2617                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
2618                              "CMPIProviderManager::_handleIndicationServiceDisabledRequest");
2619                      
2620                          CIMIndicationServiceDisabledRequestMessage* request =
2621                              dynamic_cast<CIMIndicationServiceDisabledRequestMessage*>(message);
2622                          PEGASUS_ASSERT(request != 0);
2623                      
2624                          CIMIndicationServiceDisabledResponseMessage* response =
2625                              dynamic_cast<CIMIndicationServiceDisabledResponseMessage*>(
2626                                  request->buildResponse());
2627                          PEGASUS_ASSERT(response != 0);
2628                      
2629                          _subscriptionInitComplete = false;
2630                      
2631                          PEG_METHOD_EXIT ();
2632                          return response;
2633                      }
2634                      
2635 venkat.puvvada 1.108 Message * CMPIProviderManager::handleSubscriptionInitCompleteRequest(
2636                          const Message * message)
2637 marek          1.63  {
2638 ms.aruran      1.115     PEG_METHOD_ENTER(
2639                              TRC_PROVIDERMANAGER,
2640                              "CMPIProviderManager::handleSubscriptionInitCompleteRequest()");
2641 marek          1.63  
2642                          CIMSubscriptionInitCompleteRequestMessage * request =
2643                              dynamic_cast <CIMSubscriptionInitCompleteRequestMessage *>
2644 venkat.puvvada 1.108         (const_cast <Message *> (message));
2645 marek          1.63  
2646                          PEGASUS_ASSERT (request != 0);
2647                      
2648                          CIMSubscriptionInitCompleteResponseMessage * response =
2649                              dynamic_cast <CIMSubscriptionInitCompleteResponseMessage *>
2650 venkat.puvvada 1.108         (request->buildResponse ());
2651 marek          1.63  
2652                          PEGASUS_ASSERT (response != 0);
2653                      
2654                          //
2655                          //  Set indicator
2656                          //
2657                          _subscriptionInitComplete = true;
2658                      
2659                          //
2660                          //  For each provider that has at least one subscription, call
2661                          //  provider's enableIndications method
2662                          //
2663                          Array <CMPIProvider *> enableProviders;
2664                          enableProviders = providerManager.getIndicationProvidersToEnable ();
2665                      
2666                          Uint32 numProviders = enableProviders.size ();
2667                          for (Uint32 i = 0; i < numProviders; i++)
2668                          {
2669                              try
2670                              {
2671                                  CIMInstance provider;
2672 marek          1.63              provider = enableProviders [i]->getProviderInstance ();
2673                      
2674 venkat.puvvada 1.110             CString info;
2675                      #ifdef PEGASUS_ENABLE_REMOTE_CMPI
2676 venkat.puvvada 1.160             IndProvRecord *provRec = 0;
2677                                  if (indProvTab.lookup (enableProviders [i]->getName(), provRec))
2678 venkat.puvvada 1.110             {
2679 venkat.puvvada 1.160                 if (provRec->getRemoteInfo() != String::EMPTY)
2680 venkat.puvvada 1.110                 {
2681 venkat.puvvada 1.160                     info = provRec->getRemoteInfo().getCString();
2682 venkat.puvvada 1.110                 }
2683                                  }
2684                      #endif
2685 marek          1.63              //
2686                                  //  Get cached or load new provider module
2687                                  //
2688 venkat.puvvada 1.132             OpProviderHolder ph;
2689 venkat.puvvada 1.110             if ((const char*)info)
2690                                  {
2691                                      ph = providerManager.getRemoteProvider
2692                                          (enableProviders [i]->getModule ()->getFileName (),
2693 venkat.puvvada 1.161                     enableProviders [i]->getName (),
2694                                          enableProviders[i]->getModuleName());
2695 venkat.puvvada 1.110             }
2696                                  else
2697                                  {
2698                                      ph = providerManager.getProvider
2699                                          (enableProviders [i]->getModule ()->getFileName (),
2700 venkat.puvvada 1.161                     enableProviders [i]->getName (),
2701                                          enableProviders[i]->getModuleName());
2702 venkat.puvvada 1.110             }
2703 venkat.puvvada 1.108             _callEnableIndications(
2704 kumpf          1.151                 provider,
2705                                      _indicationCallback,
2706                                      ph,
2707 venkat.puvvada 1.108                 (const char*)info);
2708 marek          1.63          }
2709 konrad.r       1.64          catch (const CIMException & e)
2710 marek          1.63          {
2711 thilo.boehm    1.138             PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1,
2712                                      "CIMException: %s",(const char*)e.getMessage().getCString()));
2713 marek          1.63          }
2714 konrad.r       1.64          catch (const Exception & e)
2715 marek          1.63          {
2716 thilo.boehm    1.138             PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL1,
2717                                      "Exception: %s",(const char*)e.getMessage().getCString()));
2718 marek          1.63          }
2719 venkat.puvvada 1.108         catch (...)
2720 marek          1.63          {
2721 ms.aruran      1.115             PEG_TRACE_CSTRING(
2722                                      TRC_PROVIDERMANAGER,
2723 marek          1.131                 Tracer::LEVEL1,
2724 marek          1.63                  "Unknown error in handleSubscriptionInitCompleteRequest");
2725                              }
2726                          }
2727                      
2728                          PEG_METHOD_EXIT ();
2729 venkat.puvvada 1.108     return(response);
2730 marek          1.63  }
2731                      
2732 venkat.puvvada 1.108 Message * CMPIProviderManager::handleGetPropertyRequest(
2733                          const Message * message)
2734 dave.sudlik    1.98  {
2735 ms.aruran      1.115     PEG_METHOD_ENTER(
2736                              TRC_PROVIDERMANAGER,
2737                              "CMPIProviderManager::handleGetPropertyRequest()");
2738 dave.sudlik    1.98  
2739                          HandlerIntro(GetProperty,message,request,response,handler);
2740                      
2741                          // We're only going to be interested in the specific property from this
2742                          // instance.
2743                          Array<CIMName> localPropertyListArray;
2744                          localPropertyListArray.append(request->propertyName);
2745                          CIMPropertyList localPropertyList(localPropertyListArray);
2746                      
2747                          // NOTE: GetProperty will use the CIMInstanceProvider interface, so we
2748 kumpf          1.151     // must manually define a request, response, and handler (emulate
2749 dave.sudlik    1.98      // HandlerIntro macro)
2750 kumpf          1.151     CIMGetInstanceRequestMessage * GI_request =
2751 dave.sudlik    1.98          new CIMGetInstanceRequestMessage(
2752 kumpf          1.151         request->messageId,
2753 venkat.puvvada 1.108         request->nameSpace,
2754                              request->instanceName,
2755                              false,
2756                              false,
2757                              localPropertyList,
2758                              request->queueIds,
2759                              request->authType,
2760                              request->userName
2761                              );
2762 dave.sudlik    1.98  
2763 kumpf          1.151     PEGASUS_ASSERT(GI_request != 0);
2764 dave.sudlik    1.98  
2765 kumpf          1.151     CIMGetInstanceResponseMessage * GI_response =
2766 venkat.puvvada 1.108         dynamic_cast<CIMGetInstanceResponseMessage*>
2767                              (GI_request->buildResponse());
2768 dave.sudlik    1.98  
2769 kumpf          1.151     PEGASUS_ASSERT(GI_response != 0);
2770 dave.sudlik    1.98  
2771 venkat.puvvada 1.108     GetInstanceResponseHandler GI_handler(
2772 kumpf          1.151         GI_request,
2773                              GI_response,
2774 venkat.puvvada 1.108         _responseChunkCallback);
2775 dave.sudlik    1.98  
2776 venkat.puvvada 1.108     try
2777 dave.sudlik    1.98      {
2778 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
2779 marek          1.129             "CMPIProviderManager::handleGetPropertyRequest"
2780                                  " - Host name: %s  Name space: %s  "
2781                                      "Class name: %s  Property name: %s",
2782                                  (const char*) System::getHostName().getCString(),
2783                                  (const char*) request->nameSpace.getString().getCString(),
2784                                  (const char*)
2785                                      request->instanceName.getClassName().getString().getCString(),
2786                                  (const char*) request->propertyName.getString().getCString()));
2787 kumpf          1.151 
2788 dave.sudlik    1.98          Boolean remote=false;
2789 venkat.puvvada 1.132         OpProviderHolder ph;
2790 marek          1.157         CString remoteInfo;
2791 thilo.boehm    1.162 
2792 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
2793                                  &(request->operationContext),
2794                                  &ph,
2795                                  &remoteInfo,
2796                                  remote);
2797 dave.sudlik    1.98  
2798 venkat.puvvada 1.121         AutoPtr<NormalizerContext> tmpNormalizerContext(
2799 venkat.puvvada 1.132             new CIMOMHandleContext(*pr.getCIMOMHandle()));
2800 venkat.puvvada 1.121         request->operationContext.insert(
2801                                  NormalizerContextContainer(tmpNormalizerContext));
2802 dave.sudlik    1.98  
2803                              CMPIStatus rc={CMPI_RC_OK,NULL};
2804 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
2805 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(GI_handler,pr.getBroker());
2806                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
2807 dave.sudlik    1.98  
2808 kumpf          1.151         // For the getInstance provider call, use the property list that we
2809 dave.sudlik    1.98          // created containing the single property from the getProperty call.
2810                              CMPIPropertyList props(localPropertyList);
2811                      
2812 marek          1.157         CString nameSpace = request->nameSpace.getString().getCString();
2813 thilo.boehm    1.162         CString className =
2814                                  request->instanceName.getClassName().getString().getCString();
2815                      
2816 kumpf          1.151         // Leave includeQualifiers and includeClassOrigin as false for this
2817 venkat.puvvada 1.108         // call to getInstance
2818 marek          1.124         _setupCMPIContexts(
2819 venkat.puvvada 1.108             &eCtx,
2820 marek          1.157             &(request->operationContext),
2821                                  &nameSpace,
2822                                  &remoteInfo,
2823 marek          1.124             remote,
2824                                  false,
2825                                  false,
2826                                  true);
2827 dave.sudlik    1.98  
2828 thilo.boehm    1.162         SCMOInstance * objectPath = getSCMOObjectPathFromRequest(
2829                                  nameSpace, className, request->instanceName);
2830                              CMPI_ObjectPathOnStack eRef(objectPath);
2831                      
2832 dave.sudlik    1.98          CMPIProvider::pm_service_op_lock op_lock(&pr);
2833                      
2834 thilo.boehm    1.143         PEG_TRACE((
2835                                  TRC_PROVIDERMANAGER,
2836                                  Tracer::LEVEL2,
2837                                  "Calling provider.getInstance via getProperty: %s",
2838                                  (const char*)pr.getName().getCString()));
2839                      
2840 dave.sudlik    1.98          {
2841 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
2842                      
2843 dave.sudlik    1.98              StatProviderTimeMeasurement providerTime(response);
2844                      
2845 venkat.puvvada 1.132             rc = pr.getInstMI()->ft->getInstance(
2846                                      pr.getInstMI(),
2847                                      &eCtx,
2848                                      &eRes,
2849                                      &eRef,
2850 dave.sudlik    1.98                  (const char **)props.getList());
2851                              }
2852                      
2853 thilo.boehm    1.143         PEG_TRACE((
2854                                  TRC_PROVIDERMANAGER,
2855                                  Tracer::LEVEL2,
2856                                  "Returning from provider.getInstance via getProperty: %s",
2857                                  (const char*)pr.getName().getCString()));
2858                      
2859 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
2860 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
2861 dave.sudlik    1.99  //      rc.msg is also localized.
2862                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
2863 kumpf          1.151         CMPIData cldata =
2864 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
2865 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
2866                              {
2867                                  response->operationContext.set(
2868                                      ContentLanguageListContainer(
2869 venkat.puvvada 1.108                 ContentLanguageList(
2870                                      LanguageParser::parseContentLanguageHeader(
2871 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
2872 dave.sudlik    1.103             handler.setContext(response->operationContext);
2873 dave.sudlik    1.99          }
2874 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
2875 dave.sudlik    1.98  
2876                              // Copy property value from instance to getProperty response
2877 thilo.boehm    1.162         Array<SCMOInstance>& arInstance =
2878                                  GI_response->getResponseData().getSCMO();
2879                              if (arInstance.size() > 0)
2880 dave.sudlik    1.98          {
2881 thilo.boehm    1.162             SCMOInstance& instance = arInstance[0];
2882                                  if(!(instance.isUninitialized()))
2883                                  {
2884                                      CString pName =
2885                                          request->propertyName.getString().getCString();
2886                      
2887                                      // Construct a temporary CMPI Instance object, on which we
2888                                      // can use the encapsulation functions to retrieve the property.
2889                                      CMPI_InstanceOnStack tmpInst(instance);
2890                      
2891                                      CMPIStatus trc;
2892                                      CMPIData data =
2893                                          CMGetProperty(&tmpInst, (const char*)pName, &trc);
2894                      
2895                                      if (trc.rc == CMPI_RC_OK)
2896                                      {
2897                                          // Convert the CMPIData to a CIMValue
2898                                          CIMValue val =
2899                                              value2CIMValue(&(data.value), data.type, &(trc.rc));
2900 dave.sudlik    1.98  
2901 thilo.boehm    1.162                     response->value = val;
2902                                      }
2903                                      // Else property not found. Return CIM_ERR_NO_SUCH_PROPERTY.
2904                                      else
2905                                      {
2906                                          throw PEGASUS_CIM_EXCEPTION(
2907                                              CIM_ERR_NO_SUCH_PROPERTY,
2908                                              request->propertyName.getString());
2909                                      }
2910 dave.sudlik    1.98              }
2911                              }
2912                          }
2913                          HandlerCatch(handler);
2914                      
2915                          delete GI_request;
2916                          delete GI_response;
2917                      
2918                          PEG_METHOD_EXIT();
2919                      
2920                          return(response);
2921                      }
2922                      
2923 venkat.puvvada 1.108 Message * CMPIProviderManager::handleSetPropertyRequest(
2924                          const Message * message)
2925 dave.sudlik    1.98  {
2926 ms.aruran      1.115     PEG_METHOD_ENTER(
2927                              TRC_PROVIDERMANAGER,
2928                              "CMPIProviderManager::handleSetPropertyRequest()");
2929 dave.sudlik    1.98  
2930                          HandlerIntro(SetProperty,message,request,response,handler);
2931                      
2932 kumpf          1.151     // We're only going to be interested in the specific property from this
2933 venkat.puvvada 1.108     // instance.
2934 dave.sudlik    1.98      Array<CIMName> localPropertyListArray;
2935                          localPropertyListArray.append(request->propertyName);
2936                          CIMPropertyList localPropertyList(localPropertyListArray);
2937                      
2938 kumpf          1.151     // Build a modified instance with just the specific property and its
2939 venkat.puvvada 1.108     // new value.
2940 dave.sudlik    1.98      CIMInstance localModifiedInstance(request->instanceName.getClassName());
2941                          localModifiedInstance.setPath(request->instanceName);
2942 venkat.puvvada 1.108     localModifiedInstance.addProperty(
2943                              CIMProperty(request->propertyName, request->newValue));
2944 dave.sudlik    1.98  
2945 venkat.puvvada 1.108     // NOTE: SetProperty will use the CIMInstanceProvider interface, so we must
2946                          // manually define a request, response, and handler.
2947 kumpf          1.151     CIMModifyInstanceRequestMessage * MI_request =
2948 dave.sudlik    1.98          new CIMModifyInstanceRequestMessage(
2949 kumpf          1.151         request->messageId,
2950 venkat.puvvada 1.108         request->nameSpace,
2951                              localModifiedInstance,
2952                              false,
2953                              localPropertyList,
2954                              request->queueIds,
2955                              request->authType,
2956                              request->userName
2957                              );
2958 dave.sudlik    1.98  
2959 kumpf          1.151     PEGASUS_ASSERT(MI_request != 0);
2960 dave.sudlik    1.98  
2961 kumpf          1.151     CIMModifyInstanceResponseMessage * MI_response =
2962 venkat.puvvada 1.108         dynamic_cast<CIMModifyInstanceResponseMessage*>(
2963                              MI_request->buildResponse());
2964 dave.sudlik    1.98  
2965 kumpf          1.151     PEGASUS_ASSERT(MI_response != 0);
2966 dave.sudlik    1.98  
2967 venkat.puvvada 1.108     ModifyInstanceResponseHandler MI_handler(
2968 kumpf          1.151         MI_request,
2969                              MI_response,
2970 venkat.puvvada 1.108         _responseChunkCallback);
2971 dave.sudlik    1.98  
2972 venkat.puvvada 1.108     try
2973 dave.sudlik    1.98      {
2974 thilo.boehm    1.162         CString nameSpace = request->nameSpace.getString().getCString();
2975                              CString className =
2976                                  request->instanceName.getClassName().getString().getCString();
2977                      
2978 thilo.boehm    1.138         PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL3,
2979 marek          1.129             "CMPIProviderManager::handleSetPropertyRequest"
2980                                  " - Host name: %s  Name space: %s  "
2981                                      "Class name: %s  Property name: %s",
2982                                  (const char*) System::getHostName().getCString(),
2983 thilo.boehm    1.162             (const char*) nameSpace,
2984                                  (const char*) className,
2985 marek          1.129             (const char*) request->propertyName.getString().getCString()));
2986 kumpf          1.151 
2987 dave.sudlik    1.98          Boolean remote=false;
2988 venkat.puvvada 1.132         OpProviderHolder ph;
2989 marek          1.157         CString remoteInfo;
2990 thilo.boehm    1.162 
2991 marek          1.157         CMPIProvider & pr = _resolveAndGetProvider(
2992                                  &(request->operationContext),
2993                                  &ph,
2994                                  &remoteInfo,
2995                                  remote);
2996 dave.sudlik    1.98  
2997                              CMPIStatus rc={CMPI_RC_OK,NULL};
2998 marek          1.157         CMPI_ContextOnStack eCtx(request->operationContext);
2999 venkat.puvvada 1.132         CMPI_ResultOnStack eRes(MI_handler,pr.getBroker());
3000                              CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
3001 dave.sudlik    1.98  
3002                              CMPIPropertyList props(localPropertyList);
3003                      
3004                              // Leave includeQualifiers as false for this call to modifyInstance
3005 marek          1.124         _setupCMPIContexts(
3006 venkat.puvvada 1.108             &eCtx,
3007 marek          1.157             &(request->operationContext),
3008                                  &nameSpace,
3009                                  &remoteInfo,
3010 marek          1.124             remote,
3011                                  false,
3012                                  false,
3013                                  true);
3014 dave.sudlik    1.98  
3015 thilo.boehm    1.162 
3016                              SCMOInstance * modInst = getSCMOInstanceFromRequest(
3017                                  nameSpace, className, localModifiedInstance);
3018                              CMPI_InstanceOnStack eInst(modInst);
3019                      
3020                              // This will create a second reference for the same SCMOInstance
3021                              CMPI_ObjectPathOnStack eRef(*modInst);
3022                      
3023 dave.sudlik    1.98          CMPIProvider::pm_service_op_lock op_lock(&pr);
3024                      
3025 thilo.boehm    1.143         PEG_TRACE((
3026                                  TRC_PROVIDERMANAGER,
3027                                  Tracer::LEVEL2,
3028                                  "Calling provider.modifyInstance via setProperty: %s",
3029                                  (const char*)pr.getName().getCString()));
3030                      
3031 dave.sudlik    1.98          {
3032 thilo.boehm    1.144             AutoPThreadSecurity threadLevelSecurity(request->operationContext);
3033                      
3034 dave.sudlik    1.98              StatProviderTimeMeasurement providerTime(response);
3035                      
3036 venkat.puvvada 1.132             rc = pr.getInstMI()->ft->modifyInstance(
3037                                      pr.getInstMI(),
3038                                      &eCtx,
3039                                      &eRes,
3040                                      &eRef,
3041                                      &eInst,
3042 dave.sudlik    1.98                  (const char **)props.getList());
3043                              }
3044                      
3045 thilo.boehm    1.143         PEG_TRACE((
3046                                  TRC_PROVIDERMANAGER,
3047                                  Tracer::LEVEL2,
3048                                  "Returning from provider.modifyInstance via setProperty: %s",
3049                                  (const char*)pr.getName().getCString()));
3050                      
3051 dave.sudlik    1.99  //      Need to save ContentLanguage value into operation context of response
3052 kumpf          1.151 //      Do this before checking rc from provider to throw exception in case
3053 dave.sudlik    1.99  //      rc.msg is also localized.
3054                              CMPIStatus tmprc={CMPI_RC_OK,NULL};
3055 kumpf          1.151         CMPIData cldata =
3056 venkat.puvvada 1.108             eCtx.ft->getEntry (&eCtx, CMPIContentLanguage, &tmprc);
3057 dave.sudlik    1.99          if (tmprc.rc == CMPI_RC_OK)
3058                              {
3059                                  response->operationContext.set(
3060                                      ContentLanguageListContainer(
3061 venkat.puvvada 1.108                 ContentLanguageList(
3062                                      LanguageParser::parseContentLanguageHeader(
3063 s.kodali       1.137                 CMGetCharsPtr(cldata.value.string, NULL)))));
3064 dave.sudlik    1.103             handler.setContext(response->operationContext);
3065 dave.sudlik    1.99          }
3066 kavita.gupta   1.158         _throwCIMException(rc, eRes.resError);
3067 dave.sudlik    1.98      }
3068                          HandlerCatch(handler);
3069                      
3070                          delete MI_request;
3071                          delete MI_response;
3072                      
3073                          PEG_METHOD_EXIT();
3074                      
3075                          return(response);
3076                      }
3077                      
3078 venkat.puvvada 1.108 Message * CMPIProviderManager::handleUnsupportedRequest(
3079                          const Message * message)
3080 marek          1.63  {
3081 ms.aruran      1.115     PEG_METHOD_ENTER(
3082                              TRC_PROVIDERMANAGER,
3083                              "CMPIProviderManager::handleUnsupportedRequest()");
3084 marek          1.63      CIMRequestMessage* request =
3085                              dynamic_cast<CIMRequestMessage *>(const_cast<Message *>(message));
3086                          PEGASUS_ASSERT(request != 0 );
3087                      
3088                          CIMResponseMessage* response = request->buildResponse();
3089                          response->cimException =
3090                              PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY);
3091                      
3092                          PEG_METHOD_EXIT();
3093                          return response;
3094                      }
3095                      
3096                      ProviderName CMPIProviderManager::_resolveProviderName(
3097                          const ProviderIdContainer & providerId)
3098                      {
3099                          String providerName;
3100                          String fileName;
3101                          String location;
3102 dmitry.mikulin 1.114     String moduleName;
3103 marek          1.63      CIMValue genericValue;
3104                      
3105 ms.aruran      1.115     PEG_METHOD_ENTER(
3106                              TRC_PROVIDERMANAGER,
3107                              "CMPIProviderManager::_resolveProviderName()");
3108                      
3109 dmitry.mikulin 1.114     genericValue = providerId.getModule().getProperty(
3110 marek          1.139         providerId.getModule().findProperty(
3111                                  PEGASUS_PROPERTYNAME_NAME)).getValue();
3112 dmitry.mikulin 1.114     genericValue.get(moduleName);
3113                      
3114 marek          1.63      genericValue = providerId.getProvider().getProperty(
3115 marek          1.139         providerId.getProvider().findProperty(
3116                                  PEGASUS_PROPERTYNAME_NAME)).getValue();
3117 marek          1.63      genericValue.get(providerName);
3118                      
3119                          genericValue = providerId.getModule().getProperty(
3120                              providerId.getModule().findProperty("Location")).getValue();
3121                          genericValue.get(location);
3122                          fileName = _resolvePhysicalName(location);
3123                      
3124 kumpf          1.151     // An empty file name is only for interest if we are in the
3125 thilo.boehm    1.89      // local name space. So the message is only issued if not
3126                          // in the remote Name Space.
3127                          if (fileName == String::EMPTY && (!providerId.isRemoteNameSpace()))
3128                          {
3129 venkat.puvvada 1.108         genericValue.get(location);
3130                              String fullName = FileSystem::buildLibraryFileName(location);
3131                              Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
3132 kumpf          1.136             MessageLoaderParms(
3133                                      "ProviderManager.CMPI.CMPIProviderManager.CANNOT_FIND_LIBRARY",
3134 kumpf          1.151                 "For provider $0 library $1 was not found.",
3135 kumpf          1.136                 providerName, fullName));
3136 thilo.boehm    1.89  
3137                          }
3138 dmitry.mikulin 1.114     ProviderName name(moduleName, providerName, fileName);
3139 marek          1.63      name.setLocation(location);
3140 ms.aruran      1.115     PEG_METHOD_EXIT();
3141 marek          1.63      return name;
3142                      }
3143                      
3144                      void CMPIProviderManager::_callEnableIndications
3145                          (CIMInstance & req_provider,
3146 venkat.puvvada 1.108     PEGASUS_INDICATION_CALLBACK_T _indicationCallback,
3147 venkat.puvvada 1.132     OpProviderHolder & ph,
3148 venkat.puvvada 1.108     const char* remoteInfo)
3149 marek          1.63  {
3150 ms.aruran      1.115     PEG_METHOD_ENTER(
3151                              TRC_PROVIDERMANAGER,
3152                              "CMPIProviderManager::_callEnableIndications()");
3153 marek          1.63  
3154                          try
3155                          {
3156 venkat.puvvada 1.160         IndProvRecord *indProvRec =0;
3157 marek          1.95          {
3158                                  WriteLock lock(rwSemProvTab);
3159                      
3160 venkat.puvvada 1.160             if (indProvTab.lookup (ph.GetProvider ().getName (),indProvRec))
3161 venkat.puvvada 1.108             {
3162                                      CIMRequestMessage * request = 0;
3163                                      CIMResponseMessage * response = 0;
3164 venkat.puvvada 1.160                 indProvRec->setHandler(new EnableIndicationsResponseHandler(
3165 venkat.puvvada 1.108                     request,
3166                                          response,
3167                                          req_provider,
3168                                          _indicationCallback,
3169 venkat.puvvada 1.160                     _responseChunkCallback));
3170 venkat.puvvada 1.108             }
3171 marek          1.95          }
3172 marek          1.63  
3173                              CMPIProvider & pr=ph.GetProvider();
3174                      
3175                              //
3176                              //  Versions prior to 86 did not include enableIndications routine
3177                              //
3178 venkat.puvvada 1.132         if (pr.getIndMI()->ft->ftVersion >= 86)
3179 marek          1.63          {
3180                                  OperationContext context;
3181 kumpf          1.112 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
3182 venkat.puvvada 1.108             // For the z/OS security model we always need an Identity container
3183 kumpf          1.151             // in the operation context. Since we don't have a client request
3184                                  // ID here we have to use the cim servers identity for the time
3185 venkat.puvvada 1.108             // being.
3186                                  IdentityContainer idContainer(System::getEffectiveUserName());
3187                                  context.insert(idContainer);
3188 kumpf          1.112 #endif
3189 marek          1.90  
3190 marek          1.63              CMPIStatus rc={CMPI_RC_OK,NULL};
3191                                  CMPI_ContextOnStack eCtx(context);
3192 venkat.puvvada 1.132             CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
3193 marek          1.63  
3194 dave.sudlik    1.100             // Add RemoteInformation -V 5245
3195                                  if (remoteInfo)
3196                                  {
3197                                      eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",
3198 venkat.puvvada 1.108                     (CMPIValue*)(const char*)remoteInfo,CMPI_chars);
3199 dave.sudlik    1.100             }
3200                      
3201 thilo.boehm    1.143             PEG_TRACE((
3202                                      TRC_PROVIDERMANAGER,
3203                                      Tracer::LEVEL2,
3204 thilo.boehm    1.138                 "Calling provider.enableIndications: %s",
3205                                      (const char*)pr.getName().getCString()));
3206 marek          1.63  
3207 venkat.puvvada 1.111             pr.protect();
3208 marek          1.63  
3209 dave.sudlik    1.101             // enableIndications() is defined by the CMPI standard as
3210                                  // returning a CMPIStatus return value. Unfortunately, Pegasus
3211                                  // originally implemented enableIndications() with a void
3212 kumpf          1.151             // return type, and this incompatibility was not detected for
3213                                  // some time. Since exceptions thrown from enableIndications()
3214 dave.sudlik    1.101             // are not reported (other than via logging), it was decided to
3215                                  // discard the returned CMPIStatus here. This will prevent us from
3216                                  // breaking existing CMPI Indication providers. This is ok since
3217                                  // there really isn't a user to which the problem should be
3218                                  // reported.
3219 venkat.puvvada 1.132             pr.getIndMI()->ft->enableIndications(pr.getIndMI(),&eCtx);
3220 thilo.boehm    1.143 
3221                                  PEG_TRACE((
3222                                      TRC_PROVIDERMANAGER,
3223                                      Tracer::LEVEL2,
3224                                      "Returning from provider.enableIndications: %s",
3225                                      (const char*)pr.getName().getCString()));
3226                      
3227 marek          1.63          }
3228                              else
3229                              {
3230 thilo.boehm    1.143             PEG_TRACE((
3231                                      TRC_PROVIDERMANAGER,
3232                                      Tracer::LEVEL2,
3233 thilo.boehm    1.138                 "Not calling provider.enableIndications: %s routine as it is "
3234                                      "an earlier version that does not support this function",
3235                                       (const char*)pr.getName().getCString()));
3236 marek          1.63          }
3237                          }
3238 konrad.r       1.64      catch (const Exception & e)
3239 marek          1.63      {
3240 kumpf          1.136         Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
3241                                  MessageLoaderParms(
3242                                      "ProviderManager.CMPI.CMPIProviderManager."
3243                                          "ENABLE_INDICATIONS_FAILED",
3244                                      "Failed to enable indications for provider $0: $1.",
3245                                      ph.GetProvider().getName(), e.getMessage()));
3246 marek          1.63      }
3247 venkat.puvvada 1.108     catch (...)
3248 marek          1.63      {
3249 kumpf          1.136         Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
3250                                  MessageLoaderParms(
3251                                      "ProviderManager.CMPI.CMPIProviderManager."
3252                                          "ENABLE_INDICATIONS_FAILED_UNKNOWN",
3253                                      "Failed to enable indications for provider $0.",
3254                                      ph.GetProvider().getName()));
3255 marek          1.63      }
3256                      
3257                          PEG_METHOD_EXIT ();
3258                      }
3259                      
3260                      void CMPIProviderManager::_callDisableIndications
3261 venkat.puvvada 1.132     (OpProviderHolder & ph, const char *remoteInfo)
3262 marek          1.63  {
3263 ms.aruran      1.115     PEG_METHOD_ENTER(
3264                              TRC_PROVIDERMANAGER,
3265                              "CMPIProviderManager::_callDisableIndications()");
3266 marek          1.63  
3267 dave.sudlik    1.101     try
3268 marek          1.95      {
3269 dave.sudlik    1.101         CMPIProvider & pr=ph.GetProvider();
3270 marek          1.63  
3271 dave.sudlik    1.101         //
3272                              //  Versions prior to 86 did not include disableIndications routine
3273                              //
3274 venkat.puvvada 1.132         if (pr.getIndMI()->ft->ftVersion >= 86)
3275 dave.sudlik    1.101         {
3276                                  OperationContext context;
3277                                  CMPIStatus rc={CMPI_RC_OK,NULL};
3278                                  CMPI_ContextOnStack eCtx(context);
3279                      
3280                                  if (remoteInfo)
3281                                  {
3282 venkat.puvvada 1.108                 eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",
3283                                          (CMPIValue*)(const char*)remoteInfo,CMPI_chars);
3284 dave.sudlik    1.101             }
3285 venkat.puvvada 1.132             CMPI_ThreadContext thr(pr.getBroker(),&eCtx);
3286 dave.sudlik    1.96  
3287 thilo.boehm    1.143             PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL2,
3288 thilo.boehm    1.138                 "Calling provider.disableIndications: %s",
3289                                      (const char*)pr.getName().getCString()));
3290 dave.sudlik    1.100 
3291 dave.sudlik    1.101             // disableIndications() is defined by the CMPI standard as
3292                                  // returning a CMPIStatus return value. Unfortunately, Pegasus
3293                                  // originally implemented disableIndications() with a void
3294 kumpf          1.151             // return type, and this incompatibility was not detected for
3295 dave.sudlik    1.101             // some time. For consistency with the enableIndications()
3296 kumpf          1.151             // interface, it was decided to discard the returned CMPIStatus
3297                                  // here. This will prevent us from breaking existing CMPI
3298                                  // Indication providers. This is ok since there really isn't a
3299 dave.sudlik    1.101             // user to which the problem should be reported.
3300 venkat.puvvada 1.132             pr.getIndMI()->ft->disableIndications(
3301 kumpf          1.151                 pr.getIndMI(),
3302 venkat.puvvada 1.108                 &eCtx);
3303 marek          1.63  
3304 venkat.puvvada 1.111             pr.unprotect();
3305 thilo.boehm    1.143 
3306                                  PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL2,
3307                                      "Returning from provider.disableIndications: %s",
3308                                      (const char*)pr.getName().getCString()));
3309                      
3310 dave.sudlik    1.101         }
3311                              else
3312                              {
3313 thilo.boehm    1.143             PEG_TRACE((TRC_PROVIDERMANAGER,Tracer::LEVEL2,
3314 thilo.boehm    1.138                 "Not calling provider.disableIndications: %s routine as it is "
3315                                      "an earlier version that does not support this function",
3316                                      (const char*)pr.getName().getCString()));
3317 dave.sudlik    1.101         }
3318                          }
3319                          catch (const Exception & e)
3320                          {
3321 kumpf          1.136         Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
3322                                  MessageLoaderParms(
3323                                      "ProviderManager.CMPI.CMPIProviderManager."
3324                                          "DISABLE_INDICATIONS_FAILED",
3325                                      "Failed to disable indications for provider $0: $1.",
3326                                      ph.GetProvider().getName(), e.getMessage()));
3327 marek          1.63      }
3328 venkat.puvvada 1.108     catch (...)
3329 marek          1.63      {
3330 kumpf          1.136         Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
3331                                  MessageLoaderParms(
3332                                      "ProviderManager.CMPI.CMPIProviderManager."
3333                                          "DISABLE_INDICATIONS_FAILED_UNKNOWN",
3334                                      "Failed to disable indications for provider $0.",
3335                                      ph.GetProvider().getName()));
3336 marek          1.63      }
3337                      
3338                          PEG_METHOD_EXIT ();
3339                      }
3340                      
3341                      PEGASUS_NAMESPACE_END
3342 kumpf          1.151 

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2