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

   1 karl  1.54 //%2005////////////////////////////////////////////////////////////////////////
   2 chip  1.1  //
   3 karl  1.47 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
   4            // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
   5            // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
   6 karl  1.3  // IBM Corp.; EMC Corporation, The Open Group.
   7 karl  1.47 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   9 karl  1.54 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
  10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
  11 chip  1.1  //
  12            // Permission is hereby granted, free of charge, to any person obtaining a copy
  13            // of this software and associated documentation files (the "Software"), to
  14            // deal in the Software without restriction, including without limitation the
  15            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  16            // sell copies of the Software, and to permit persons to whom the Software is
  17            // furnished to do so, subject to the following conditions:
  18 r.kieninger 1.60 //
  19 chip        1.1  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
  20                  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
  21                  // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
  22                  // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  23                  // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  24                  // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  25                  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  26                  // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  27                  //
  28                  //==============================================================================
  29                  //
  30 schuur      1.4  // Author:      Adrian Schuur, schuur@de.ibm.com
  31 chip        1.1  //
  32 se.gupta    1.36 // Modified By:	Seema Gupta (gseema@in.ibm.com) for PEP135
  33 r.kieninger 1.48 //              Robert Kieninger (kieningr@de.ibm.com) for Bugzilla 2320
  34 joyce.j     1.55 //              Josephine Eskaline Joyce(jojustin@in.ibm.com) for PEP#101
  35 chip        1.1  //
  36                  //%/////////////////////////////////////////////////////////////////////////////
  37                  
  38 schuur      1.14 #include "CMPI_Version.h"
  39 schuur      1.6  
  40 chip        1.1  #include "CMPIProviderManager.h"
  41                  
  42 schuur      1.4  #include "CMPI_Object.h"
  43                  #include "CMPI_ContextArgs.h"
  44                  #include "CMPI_Instance.h"
  45                  #include "CMPI_ObjectPath.h"
  46                  #include "CMPI_Result.h"
  47                  #include "CMPI_SelectExp.h"
  48                  
  49                  #include <Pegasus/Common/CIMMessage.h>
  50                  #include <Pegasus/Common/OperationContext.h>
  51                  #include <Pegasus/Common/Tracer.h>
  52                  #include <Pegasus/Common/StatisticalData.h>
  53                  #include <Pegasus/Common/Logger.h>
  54                  #include <Pegasus/Common/MessageLoader.h> //l10n
  55 kumpf       1.42 #include <Pegasus/Common/Constants.h>
  56 schuur      1.4  
  57                  #include <Pegasus/Config/ConfigManager.h>
  58 schuur      1.14 #include <Pegasus/Server/CIMServer.h>
  59 schuur      1.4  
  60 konrad.r    1.58 #include <Pegasus/Provider/CIMOMHandleQueryContext.h>
  61 schuur      1.13 #include <Pegasus/ProviderManager2/ProviderType.h>
  62 schuur      1.4  #include <Pegasus/ProviderManager2/ProviderName.h>
  63 carolann.graves 1.57 #include <Pegasus/ProviderManager2/CMPI/CMPIProviderModule.h>
  64 schuur          1.4  #include <Pegasus/ProviderManager2/CMPI/CMPIProvider.h>
  65                      #include <Pegasus/ProviderManager2/ProviderManagerService.h>
  66 schuur          1.19 //#include <Pegasus/ProviderManager2/Default/OperationResponseHandler.h>
  67 schuur          1.4  
  68 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
  69                      #include <Pegasus/ProviderManager2/ProviderManagerzOS_inline.h>
  70                      #endif
  71                      
  72 konrad.r        1.59 #include <Pegasus/Provider/CMPI/cmpi_cql.h>
  73                      
  74 schuur          1.7  PEGASUS_USING_STD;
  75 chip            1.1  PEGASUS_NAMESPACE_BEGIN
  76                      
  77 schuur          1.4  int _cmpi_trace=0;
  78                      
  79                      #define DDD(x) if (_cmpi_trace) x;
  80                      
  81                      CMPIProviderManager::IndProvTab    CMPIProviderManager::provTab;
  82                      CMPIProviderManager::IndSelectTab  CMPIProviderManager::selxTab;
  83                      CMPIProviderManager::ProvRegistrar CMPIProviderManager::provReg;
  84                      
  85 schuur          1.17 class CMPIPropertyList {
  86                         char **props;
  87                         int pCount;
  88 dj.gorey        1.25   public:
  89 schuur          1.17    CMPIPropertyList(CIMPropertyList &propertyList) {
  90                            if (!propertyList.isNull()) {
  91                              Array<CIMName> p=propertyList.getPropertyNameArray();
  92                              pCount=p.size();
  93                              props=(char**)malloc((1+pCount)*sizeof(char*));
  94                              for (int i=0; i<pCount; i++) {
  95                                 props[i]=strdup(p[i].getString().getCString());
  96                              }
  97                              props[pCount]=NULL;
  98                            }
  99                            else props=NULL;
 100                         }
 101                         ~CMPIPropertyList() {
 102                            if (props) {
 103                               for (int i=0; i<pCount; i++)
 104                                  free(props[i]);
 105 dj.gorey        1.25          free(props);
 106 schuur          1.17       }
 107                         }
 108                         char **getList() {
 109                            return props;
 110                         }
 111                      };
 112                      
 113 schuur          1.4  CMPIProviderManager::CMPIProviderManager(Mode m)
 114 chip            1.1  {
 115 schuur          1.4     mode=m;
 116                         if (getenv("CMPI_TRACE")) _cmpi_trace=1;
 117                         else _cmpi_trace=0;
 118 carolann.graves 1.57    _subscriptionInitComplete = false;
 119 chip            1.1  }
 120                      
 121                      CMPIProviderManager::~CMPIProviderManager(void)
 122                      {
 123 konrad.r        1.51 	/* Clean up the hash-tables */
 124                          indProvRecord *prec=NULL;
 125                      	for (IndProvTab::Iterator i = provTab.start(); i; i++)
 126                      	{
 127                              provTab.lookup(i.key(),prec);
 128 konrad.r        1.52 		if (prec->handler)
 129                      			delete prec->handler;
 130 konrad.r        1.51 		delete prec;
 131                              provTab.remove(i.key());
 132                              prec=NULL;
 133                      	}
 134                      	indSelectRecord *selx=NULL;
 135                      	for (IndSelectTab::Iterator i = selxTab.start(); i; i++)
 136                      	{
 137                      		selxTab.lookup(i.key(), selx);
 138                      		if (selx->eSelx)
 139                      			delete selx->eSelx;
 140 konrad.r        1.58         if (selx->qContext)
 141                      			delete selx->qContext;
 142 konrad.r        1.51 		delete selx;
 143                      		selxTab.remove(i.key());
 144                      		selx=NULL;
 145                      	}
 146 chip            1.1  }
 147                      
 148 schuur          1.7  Boolean CMPIProviderManager::insertProvider(const ProviderName & name,
 149 schuur          1.4              const String &ns, const String &cn)
 150                      {
 151                          String key(ns+String("::")+cn+String("::")+CIMValue(name.getCapabilitiesMask()).toString());
 152                          return provReg.insert(key,name);
 153                      }
 154 schuur          1.7  
 155                      
 156 dj.gorey        1.29 Message * CMPIProviderManager::processMessage(Message * request)
 157 chip            1.1  {
 158 schuur          1.4        PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
 159                              "CMPIProviderManager::processMessage()");
 160                      
 161                          Message * response = 0;
 162 dj.gorey        1.25 
 163 schuur          1.4      // pass the request message to a handler method based on message type
 164                          switch(request->getType())
 165                          {
 166                          case CIM_GET_INSTANCE_REQUEST_MESSAGE:
 167 dj.gorey        1.29         response = handleGetInstanceRequest(request);
 168 schuur          1.4  
 169                              break;
 170                          case CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE:
 171 dj.gorey        1.29         response = handleEnumerateInstancesRequest(request);
 172 schuur          1.4  
 173                              break;
 174                          case CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE:
 175 dj.gorey        1.29         response = handleEnumerateInstanceNamesRequest(request);
 176 schuur          1.4  
 177                              break;
 178                          case CIM_CREATE_INSTANCE_REQUEST_MESSAGE:
 179 dj.gorey        1.29         response = handleCreateInstanceRequest(request);
 180 schuur          1.4  
 181                              break;
 182                          case CIM_MODIFY_INSTANCE_REQUEST_MESSAGE:
 183 dj.gorey        1.29         response = handleModifyInstanceRequest(request);
 184 schuur          1.4  
 185                              break;
 186                          case CIM_DELETE_INSTANCE_REQUEST_MESSAGE:
 187 dj.gorey        1.29         response = handleDeleteInstanceRequest(request);
 188 schuur          1.4  
 189                              break;
 190                          case CIM_EXEC_QUERY_REQUEST_MESSAGE:
 191 dj.gorey        1.29         response = handleExecQueryRequest(request);
 192 schuur          1.4  
 193                              break;
 194                          case CIM_ASSOCIATORS_REQUEST_MESSAGE:
 195 dj.gorey        1.29         response = handleAssociatorsRequest(request);
 196 schuur          1.4  
 197                              break;
 198                          case CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE:
 199 dj.gorey        1.29         response = handleAssociatorNamesRequest(request);
 200 schuur          1.4  
 201                              break;
 202                          case CIM_REFERENCES_REQUEST_MESSAGE:
 203 dj.gorey        1.29         response = handleReferencesRequest(request);
 204 schuur          1.4  
 205                              break;
 206                          case CIM_REFERENCE_NAMES_REQUEST_MESSAGE:
 207 dj.gorey        1.29         response = handleReferenceNamesRequest(request);
 208 schuur          1.4  
 209                              break;
 210                          case CIM_INVOKE_METHOD_REQUEST_MESSAGE:
 211 dj.gorey        1.29         response = handleInvokeMethodRequest(request);
 212 schuur          1.4  
 213                              break;
 214                          case CIM_CREATE_SUBSCRIPTION_REQUEST_MESSAGE:
 215 dj.gorey        1.29         response = handleCreateSubscriptionRequest(request);
 216 schuur          1.4  
 217                              break;
 218                      /*    case CIM_MODIFY_SUBSCRIPTION_REQUEST_MESSAGE:
 219 dj.gorey        1.29         response = handleModifySubscriptionRequest(request);
 220 schuur          1.4  
 221                              break;
 222                      */  case CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE:
 223 dj.gorey        1.29         response = handleDeleteSubscriptionRequest(request);
 224 schuur          1.4  
 225                              break;
 226 kumpf           1.35 /*    case CIM_EXPORT_INDICATION_REQUEST_MESSAGE:
 227                              response = handleExportIndicationRequest(request);
 228 schuur          1.4          break;
 229 schuur          1.16 */
 230 schuur          1.4      case CIM_DISABLE_MODULE_REQUEST_MESSAGE:
 231 dj.gorey        1.29         response = handleDisableModuleRequest(request);
 232 schuur          1.4  
 233                              break;
 234                          case CIM_ENABLE_MODULE_REQUEST_MESSAGE:
 235 dj.gorey        1.29         response = handleEnableModuleRequest(request);
 236 schuur          1.4  
 237 dj.gorey        1.25         break;
 238 schuur          1.4      case CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE:
 239 dj.gorey        1.29         response = handleStopAllProvidersRequest(request);
 240 schuur          1.4  
 241 schuur          1.5          break;
 242 kumpf           1.32     case CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE:
 243                      	response = handleInitializeProviderRequest(request);
 244                      
 245                      	break;
 246 carolann.graves 1.57     case CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE:
 247                              response = handleSubscriptionInitCompleteRequest (request);
 248                      
 249                              break;
 250 schuur          1.4      default:
 251 dj.gorey        1.29         response = handleUnsupportedRequest(request);
 252 schuur          1.4  
 253                              break;
 254                          }
 255 dj.gorey        1.25 
 256 schuur          1.4      PEG_METHOD_EXIT();
 257                      
 258                          return(response);
 259                      }
 260                      
 261 kumpf           1.34 Boolean CMPIProviderManager::hasActiveProviders()
 262                      {
 263                           return providerManager.hasActiveProviders();
 264                      }
 265                      
 266                      void CMPIProviderManager::unloadIdleProviders()
 267 schuur          1.4  {
 268 kumpf           1.34      providerManager.unloadIdleProviders();
 269 schuur          1.4  }
 270                      
 271                      
 272                      #define CHARS(cstring) (char*)(strlen(cstring)?(const char*)cstring:NULL)
 273                      
 274                      
 275                      #define HandlerIntroBase(type,type1,message,request,response,handler,respType) \
 276                          CIM##type##RequestMessage * request = \
 277                              dynamic_cast<CIM##type##RequestMessage *>(const_cast<Message *>(message)); \
 278                          PEGASUS_ASSERT(request != 0); \
 279                          CIM##type##ResponseMessage * response = \
 280                              new CIM##type##ResponseMessage( \
 281                              request->messageId, \
 282                              CIMException(), \
 283                              request->queueIds.copyAndPop() \
 284                              respType \
 285                          PEGASUS_ASSERT(response != 0); \
 286                          response->setKey(request->getKey()); \
 287                          response->setHttpMethod(request->getHttpMethod()); \
 288 dj.gorey        1.25     type1##ResponseHandler handler(request, response);
 289 schuur          1.4  
 290                      #define VOIDINTRO );
 291                      #define NOVOIDINTRO(type) ,type);
 292                      #define METHODINTRO ,CIMValue(), Array<CIMParamValue>(), request->methodName );
 293                      
 294                      
 295                      #define HandlerIntroVoid(type,message,request,response,handler) \
 296                           HandlerIntroBase(type,type,message,request,response,handler,VOIDINTRO)
 297                      
 298                      #define HandlerIntroMethod(type,message,request,response,handler) \
 299                           HandlerIntroBase(type,type,message,request,response,handler,METHODINTRO)
 300                      
 301                      #define HandlerIntroInd(type,message,request,response,handler) \
 302                           HandlerIntroBase(type,Operation,message,request,response,handler,VOIDINTRO)
 303                      
 304 kumpf           1.32 #define HandlerIntroInit(type,message,request,response,handler) \
 305                           HandlerIntroBase(type,Operation,message,request,response,handler,VOIDINTRO)
 306                      
 307 schuur          1.4  #define HandlerIntro(type,message,request,response,handler,respType) \
 308                           HandlerIntroBase(type,type,message,request,response,handler,NOVOIDINTRO(respType))
 309 dj.gorey        1.25 
 310 schuur          1.4  #define HandlerCatch(handler) \
 311                          catch(CIMException & e)  \
 312                          { PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \
 313                                      "Exception: " + e.getMessage()); \
 314                              handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); \
 315                          } \
 316                          catch(Exception & e) \
 317                          { PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \
 318                                      "Exception: " + e.getMessage()); \
 319                              handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); \
 320                          } \
 321                          catch(...) \
 322                          { PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, \
 323                                      "Exception: Unknown"); \
 324                              handler.setStatus(CIM_ERR_FAILED, "Unknown error."); \
 325                          }
 326                      
 327                      
 328                      
 329 dj.gorey        1.29 Message * CMPIProviderManager::handleGetInstanceRequest(const Message * message)
 330 schuur          1.4  {
 331                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
 332                              "CMPIProviderManager::handleGetInstanceRequest");
 333                      
 334                          HandlerIntro(GetInstance,message,request,response,handler,CIMInstance());
 335                      
 336                          try {
 337 dj.gorey        1.25         Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 338 schuur          1.4              "CmpiProviderManager::handleGetInstanceRequest - Host name: $0  Name space: $1  Class name: $2",
 339                                  System::getHostName(),
 340                                  request->nameSpace.getString(),
 341                                  request->instanceName.getClassName().getString());
 342                      
 343                              // make target object path
 344                              CIMObjectPath objectPath(
 345                                  System::getHostName(),
 346                                  request->nameSpace,
 347                                  request->instanceName.getClassName(),
 348                                  request->instanceName.getKeyBindings());
 349                      
 350 schuur          1.39         Boolean remote=false;
 351                              CMPIProvider::OpProviderHolder ph;
 352 schuur          1.40 
 353 schuur          1.4          // resolve provider name
 354 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
 355                              ProviderName name = _resolveProviderName(pidc);
 356 schuur          1.4  
 357 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
 358 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
 359                      	}
 360                      	else {
 361 schuur          1.4          // get cached or load new provider module
 362 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
 363 schuur          1.40         }
 364 schuur          1.4  
 365                              // convert arguments
 366                              OperationContext context;
 367                      
 368 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
 369                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
 370                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
 371 schuur          1.4          // forward request
 372 schuur          1.17         CMPIProvider & pr=ph.GetProvider();
 373 schuur          1.4  
 374                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 375                                  "Calling provider.getInstance: " + pr.getName());
 376                      
 377 schuur          1.7          DDD(cerr<<"--- CMPIProviderManager::getInstance"<<endl);
 378 schuur          1.4  
 379 schuur          1.17         CMPIStatus rc={CMPI_RC_OK,NULL};
 380 schuur          1.4          CMPI_ContextOnStack eCtx(context);
 381                              CMPI_ObjectPathOnStack eRef(objectPath);
 382                              CMPI_ResultOnStack eRes(handler,&pr.broker);
 383                              CMPI_ThreadContext thr(&pr.broker,&eCtx);
 384                      
 385 schuur          1.17         CMPIPropertyList props(request->propertyList);
 386 dj.gorey        1.25 
 387 schuur          1.4          CMPIFlags flgs=0;
 388                              if (request->includeQualifiers) flgs|=CMPI_FLAG_IncludeQualifiers;
 389                              if (request->includeClassOrigin) flgs|=CMPI_FLAG_IncludeClassOrigin;
 390                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
 391                      
 392 r.kieninger     1.48         const IdentityContainer container =
 393                                 request->operationContext.get(IdentityContainer::NAME);
 394                              eCtx.ft->addEntry(&eCtx,
 395                                                CMPIPrincipal,
 396                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
 397                                                CMPI_chars);
 398                      
 399 schuur          1.39         if (remote) {
 400 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
 401 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
 402                              }
 403                      
 404 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
 405                      
 406 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 407 dj.gorey        1.29                 CIMGetInstanceRequestMessage * req = dynamic_cast<CIMGetInstanceRequestMessage *>(const_cast<Message *>(message));
 408 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
 409 dj.gorey        1.29                 if (err_num!=0)
 410                                      {
 411                                              // need a new CIMException for this
 412                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
 413                                      }
 414 marek           1.26 #endif
 415                      
 416 schuur          1.17         STAT_GETSTARTTIME;
 417 schuur          1.4  
 418                              rc=pr.miVector.instMI->ft->getInstance
 419 schuur          1.17         (pr.miVector.instMI,&eCtx,&eRes,&eRef,props.getList());
 420 schuur          1.4  
 421                              STAT_PMS_PROVIDEREND;
 422                      
 423 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 424 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
 425 marek           1.26 #endif
 426 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
 427 schuur          1.23            throw CIMException((CIMStatusCode)rc.rc,
 428 dj.gorey        1.25                rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
 429 schuur          1.21     }
 430 schuur          1.4      HandlerCatch(handler);
 431 dj.gorey        1.25 
 432 schuur          1.4      PEG_METHOD_EXIT();
 433                      
 434                          return(response);
 435                      }
 436                      
 437 dj.gorey        1.29 Message * CMPIProviderManager::handleEnumerateInstancesRequest(const Message * message)
 438 schuur          1.4  {
 439                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
 440                              "CMPIProviderManager::handleEnumerateInstanceRequest");
 441                      
 442                          HandlerIntro(EnumerateInstances,message,request,response,
 443                                       handler,Array<CIMInstance>());
 444 dj.gorey        1.25     try {
 445 schuur          1.4        Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 446                                  "CMPIProviderManager::handleEnumerateInstancesRequest - Host name: $0  Name space: $1  Class name: $2",
 447                                  System::getHostName(),
 448                                  request->nameSpace.getString(),
 449                                  request->className.getString());
 450                      
 451                              // make target object path
 452                              CIMObjectPath objectPath(
 453                                  System::getHostName(),
 454                                  request->nameSpace,
 455                                  request->className);
 456                      
 457 schuur          1.39         Boolean remote=false;
 458                              CMPIProvider::OpProviderHolder ph;
 459 schuur          1.40 
 460 schuur          1.4          // resolve provider name
 461 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
 462                              ProviderName name = _resolveProviderName(pidc);
 463 schuur          1.4  
 464 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
 465 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
 466                      	}
 467                      	else {
 468 schuur          1.4          // get cached or load new provider module
 469 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
 470 schuur          1.40         }
 471 schuur          1.4  
 472 dj.gorey        1.25         // convert arguments
 473 schuur          1.4          OperationContext context;
 474                      
 475 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
 476                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
 477                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
 478 schuur          1.4  
 479                              CIMPropertyList propertyList(request->propertyList);
 480                      
 481                              // forward request
 482 schuur          1.17         CMPIProvider & pr=ph.GetProvider();
 483 schuur          1.4  
 484                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 485                                  "Calling provider.enumerateInstances: " + pr.getName());
 486                      
 487 schuur          1.7          DDD(cerr<<"--- CMPIProviderManager::enumerateInstances"<<endl);
 488 schuur          1.4  
 489 schuur          1.17         CMPIStatus rc={CMPI_RC_OK,NULL};
 490 schuur          1.4          CMPI_ContextOnStack eCtx(context);
 491                              CMPI_ObjectPathOnStack eRef(objectPath);
 492                              CMPI_ResultOnStack eRes(handler,&pr.broker);
 493                              CMPI_ThreadContext thr(&pr.broker,&eCtx);
 494                      
 495 schuur          1.17         CMPIPropertyList props(propertyList);
 496 schuur          1.4  
 497                              CMPIFlags flgs=0;
 498                              if (request->includeQualifiers) flgs|=CMPI_FLAG_IncludeQualifiers;
 499                              if (request->includeClassOrigin) flgs|=CMPI_FLAG_IncludeClassOrigin;
 500                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
 501                      
 502 r.kieninger     1.48         const IdentityContainer container =
 503                                 request->operationContext.get(IdentityContainer::NAME);
 504                              eCtx.ft->addEntry(&eCtx,
 505                                                CMPIPrincipal,
 506                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
 507                                                CMPI_chars);
 508                      
 509 schuur          1.39         if (remote) {
 510 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
 511 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
 512                              }
 513                      
 514 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
 515                      
 516 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 517 dj.gorey        1.29                 CIMEnumerateInstancesRequestMessage * req = dynamic_cast<CIMEnumerateInstancesRequestMessage *>(const_cast<Message *>(message));
 518 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
 519 dj.gorey        1.29                 if (err_num!=0)
 520                                      {
 521                                              // need a new CIMException for this
 522                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
 523                                      }
 524 marek           1.26 #endif
 525                      
 526 schuur          1.4          STAT_GETSTARTTIME;
 527                      
 528                              rc=pr.miVector.instMI->ft->enumInstances
 529 dj.gorey        1.25         (pr.miVector.instMI,&eCtx,&eRes,&eRef,props.getList());
 530 schuur          1.4  
 531                              STAT_PMS_PROVIDEREND;
 532                      
 533 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 534 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
 535 marek           1.26 #endif
 536                      
 537 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
 538 schuur          1.23         throw CIMException((CIMStatusCode)rc.rc,
 539 dj.gorey        1.25                rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
 540 schuur          1.4  
 541                          }
 542                          HandlerCatch(handler);
 543 dj.gorey        1.25 
 544 schuur          1.4      PEG_METHOD_EXIT();
 545                      
 546                          return(response);
 547                      }
 548                      
 549 dj.gorey        1.29 Message * CMPIProviderManager::handleEnumerateInstanceNamesRequest(const Message * message)
 550 schuur          1.4  {
 551                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "CMPIProviderManager::handleEnumerateInstanceNamesRequest");
 552                      
 553                          HandlerIntro(EnumerateInstanceNames,message,request,response,
 554                                       handler,Array<CIMObjectPath>());
 555                          try {
 556                              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 557                                  "CMPIProviderManager::handleEnumerateInstanceNamesRequest - Host name: $0  Name space: $1  Class name: $2",
 558                                  System::getHostName(),
 559                                  request->nameSpace.getString(),
 560                                  request->className.getString());
 561 dj.gorey        1.25 
 562 schuur          1.4         // make target object path
 563                              CIMObjectPath objectPath(
 564                                  System::getHostName(),
 565                                  request->nameSpace,
 566                                  request->className);
 567                      
 568 schuur          1.39         Boolean remote=false;
 569                              CMPIProvider::OpProviderHolder ph;
 570                      
 571 schuur          1.4          // resolve provider name
 572 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
 573                              ProviderName name = _resolveProviderName(pidc);
 574 schuur          1.4  
 575 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
 576 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
 577                              }
 578                              else {
 579 schuur          1.4          // get cached or load new provider module
 580 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
 581                              }
 582 schuur          1.4  
 583                              // convert arguments
 584                              OperationContext context;
 585                      
 586 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
 587                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
 588                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
 589 dj.gorey        1.25         CMPIProvider & pr=ph.GetProvider();
 590 schuur          1.4  
 591 dj.gorey        1.25         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 592 schuur          1.4              "Calling provider.enumerateInstanceNames: " + pr.getName());
 593                      
 594 schuur          1.7          DDD(cerr<<"--- CMPIProviderManager::enumerateInstanceNames"<<endl);
 595 schuur          1.4  
 596                              CMPIStatus rc={CMPI_RC_OK,NULL};
 597                              CMPI_ContextOnStack eCtx(context);
 598                              CMPI_ObjectPathOnStack eRef(objectPath);
 599                              CMPI_ResultOnStack eRes(handler,&pr.broker);
 600                              CMPI_ThreadContext thr(&pr.broker,&eCtx);
 601                      
 602                              CMPIFlags flgs=0;
 603                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
 604                      
 605 r.kieninger     1.48         const IdentityContainer container =
 606                                 request->operationContext.get(IdentityContainer::NAME);
 607                              eCtx.ft->addEntry(&eCtx,
 608                                                CMPIPrincipal,
 609                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
 610                                                CMPI_chars);
 611                      
 612 schuur          1.39         if (remote) {
 613 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
 614 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
 615                              }
 616                      
 617 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
 618                      
 619 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 620 dj.gorey        1.29                 CIMEnumerateInstanceNamesRequestMessage * req = dynamic_cast<CIMEnumerateInstanceNamesRequestMessage *>(const_cast<Message *>(message));
 621 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
 622 dj.gorey        1.29                 if (err_num!=0)
 623                                      {
 624                                              // need a new CIMException for this
 625                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
 626                                      }
 627 marek           1.26 #endif
 628 schuur          1.4          STAT_GETSTARTTIME;
 629                      
 630                              rc=pr.miVector.instMI->ft->enumInstanceNames(pr.miVector.instMI,&eCtx,&eRes,&eRef);
 631                      
 632                              STAT_PMS_PROVIDEREND;
 633                      
 634 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 635 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
 636 marek           1.26 #endif
 637                      
 638 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
 639 dj.gorey        1.25            throw CIMException((CIMStatusCode)rc.rc,
 640                                     rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
 641 schuur          1.4      }
 642                          HandlerCatch(handler);
 643 dj.gorey        1.25 
 644 schuur          1.4  
 645                          PEG_METHOD_EXIT();
 646                      
 647                          return(response);
 648                      }
 649                      
 650 dj.gorey        1.29 Message * CMPIProviderManager::handleCreateInstanceRequest(const Message * message)
 651 schuur          1.4  {
 652                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
 653                             "CMPIProviderManager::handleCreateInstanceRequest");
 654                      
 655                          HandlerIntro(CreateInstance,message,request,response,
 656                                       handler,CIMObjectPath());
 657                          try {
 658                              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 659                                  "CMPIProviderManager::handleCreateInstanceRequest - Host name: $0  Name space: $1  Class name: $2",
 660                                  System::getHostName(),
 661                                  request->nameSpace.getString(),
 662                                  request->newInstance.getPath().getClassName().getString());
 663                      
 664                              // make target object path
 665                              CIMObjectPath objectPath(
 666                                  System::getHostName(),
 667                                  request->nameSpace,
 668                                  request->newInstance.getPath().getClassName(),
 669                                  request->newInstance.getPath().getKeyBindings());
 670 schuur          1.39 	request->newInstance.setPath(objectPath);
 671                      
 672                              Boolean remote=false;
 673                              CMPIProvider::OpProviderHolder ph;
 674 schuur          1.4  
 675                              // resolve provider name
 676 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
 677                              ProviderName name = _resolveProviderName(pidc);
 678 schuur          1.4  
 679 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
 680 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
 681                      	}
 682                      	else {
 683 schuur          1.4          // get cached or load new provider module
 684 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
 685 schuur          1.40         }
 686 schuur          1.4  
 687                              // convert arguments
 688                              OperationContext context;
 689                      
 690 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
 691                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
 692                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
 693 schuur          1.4          // forward request
 694 dj.gorey        1.25         CMPIProvider & pr=ph.GetProvider();
 695 schuur          1.4  
 696                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 697                                  "Calling provider.createInstance: " +
 698                                  ph.GetProvider().getName());
 699                      
 700 schuur          1.7          DDD(cerr<<"--- CMPIProviderManager::createInstances"<<endl);
 701 dj.gorey        1.25         CMPIStatus rc={CMPI_RC_OK,NULL};
 702 schuur          1.4          CMPI_ContextOnStack eCtx(context);
 703                              CMPI_ObjectPathOnStack eRef(objectPath);
 704                              CMPI_ResultOnStack eRes(handler,&pr.broker);
 705                              CMPI_InstanceOnStack eInst(request->newInstance);
 706                              CMPI_ThreadContext thr(&pr.broker,&eCtx);
 707                      
 708                              CMPIFlags flgs=0;
 709                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
 710                      
 711 r.kieninger     1.48         const IdentityContainer container =
 712                                 request->operationContext.get(IdentityContainer::NAME);
 713                              eCtx.ft->addEntry(&eCtx,
 714                                                CMPIPrincipal,
 715                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
 716                                                CMPI_chars);
 717                      
 718 schuur          1.39         if (remote) {
 719 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
 720 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
 721                              }
 722                      
 723 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
 724                      
 725 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 726 dj.gorey        1.29                 CIMCreateInstanceRequestMessage * req = dynamic_cast<CIMCreateInstanceRequestMessage *>(const_cast<Message *>(message));
 727 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
 728 dj.gorey        1.29                 if (err_num!=0)
 729                                      {
 730                                              // need a new CIMException for this
 731                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
 732                                      }
 733 marek           1.26 #endif
 734                      
 735 schuur          1.4          STAT_GETSTARTTIME;
 736                      
 737                              rc=pr.miVector.instMI->ft->createInstance
 738 dj.gorey        1.25            (pr.miVector.instMI,&eCtx,&eRes,&eRef,&eInst);
 739 schuur          1.4  
 740                              STAT_PMS_PROVIDEREND;
 741                      
 742 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 743 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
 744 marek           1.26 #endif
 745                      
 746 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
 747 dj.gorey        1.25            throw CIMException((CIMStatusCode)rc.rc,
 748                                     rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
 749 schuur          1.4      }
 750                          HandlerCatch(handler);
 751 dj.gorey        1.25 
 752 schuur          1.4      PEG_METHOD_EXIT();
 753                      
 754                          return(response);
 755                      }
 756                      
 757 dj.gorey        1.29 Message * CMPIProviderManager::handleModifyInstanceRequest(const Message * message)
 758 schuur          1.4  {
 759                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
 760                             "CMPIProviderManager::handleModifyInstanceRequest");
 761                      
 762                          HandlerIntroVoid(ModifyInstance,message,request,response,
 763                                       handler);
 764                          try {
 765                              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 766 schuur          1.14             "CMPIProviderManager::handleModifyInstanceRequest - Host name: $0  Name space: $1  Class name: $2",
 767 schuur          1.4              System::getHostName(),
 768                                  request->nameSpace.getString(),
 769                                  request->modifiedInstance.getPath().getClassName().getString());
 770                      
 771                              // make target object path
 772                              CIMObjectPath objectPath(
 773                                  System::getHostName(),
 774                                  request->nameSpace,
 775                                  request->modifiedInstance.getPath ().getClassName(),
 776                                  request->modifiedInstance.getPath ().getKeyBindings());
 777                      
 778 schuur          1.39         Boolean remote=false;
 779                              CMPIProvider::OpProviderHolder ph;
 780                      
 781 schuur          1.4          // resolve provider name
 782 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
 783                              ProviderName name = _resolveProviderName(pidc);
 784 schuur          1.4  
 785 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
 786 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
 787                              }
 788                              else {
 789 schuur          1.4          // get cached or load new provider module
 790 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
 791                              }
 792 schuur          1.4  
 793                              // convert arguments
 794                              OperationContext context;
 795                      
 796 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
 797                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
 798                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
 799 schuur          1.4          // forward request
 800 schuur          1.17         CMPIProvider & pr=ph.GetProvider();
 801 schuur          1.4  
 802                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 803                                  "Calling provider.modifyInstance: " + pr.getName());
 804                      
 805 schuur          1.7          DDD(cerr<<"--- CMPIProviderManager::modifyInstance"<<endl);
 806 schuur          1.4  
 807 schuur          1.17         CMPIStatus rc={CMPI_RC_OK,NULL};
 808 schuur          1.4          CMPI_ContextOnStack eCtx(context);
 809                              CMPI_ObjectPathOnStack eRef(objectPath);
 810                              CMPI_ResultOnStack eRes(handler,&pr.broker);
 811                              CMPI_InstanceOnStack eInst(request->modifiedInstance);
 812                              CMPI_ThreadContext thr(&pr.broker,&eCtx);
 813                      
 814 schuur          1.17         CMPIPropertyList props(request->propertyList);
 815 dj.gorey        1.25 
 816 schuur          1.4          CMPIFlags flgs=0;
 817                              if (request->includeQualifiers) flgs|=CMPI_FLAG_IncludeQualifiers;
 818                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
 819                      
 820 r.kieninger     1.48         const IdentityContainer container =
 821                                 request->operationContext.get(IdentityContainer::NAME);
 822                              eCtx.ft->addEntry(&eCtx,
 823                                                CMPIPrincipal,
 824                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
 825                                                CMPI_chars);
 826                      
 827 schuur          1.39         if (remote) {
 828 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
 829 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
 830                              }
 831                      
 832 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
 833                      
 834 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 835 dj.gorey        1.29                 CIMModifyInstanceRequestMessage * req = dynamic_cast<CIMModifyInstanceRequestMessage *>(const_cast<Message *>(message));
 836 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
 837 dj.gorey        1.29                 if (err_num!=0)
 838                                      {
 839                                              // need a new CIMException for this
 840                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
 841                                      }
 842 marek           1.26 #endif
 843                      
 844 schuur          1.4          STAT_GETSTARTTIME;
 845                      
 846                              rc=pr.miVector.instMI->ft->setInstance
 847 schuur          1.17         (pr.miVector.instMI,&eCtx,&eRes,&eRef,&eInst,props.getList());
 848 schuur          1.4  
 849                              STAT_PMS_PROVIDEREND;
 850                      
 851 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 852 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
 853 marek           1.26 #endif
 854                      
 855 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
 856 dj.gorey        1.25            throw CIMException((CIMStatusCode)rc.rc,
 857                                     rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
 858 schuur          1.4      }
 859                          HandlerCatch(handler);
 860 dj.gorey        1.25 
 861 schuur          1.4      PEG_METHOD_EXIT();
 862                      
 863                          return(response);
 864                      }
 865                      
 866 dj.gorey        1.29 Message * CMPIProviderManager::handleDeleteInstanceRequest(const Message * message)
 867 schuur          1.4  {
 868                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
 869                             "CMPIProviderManager::handleDeleteInstanceRequest");
 870                      
 871                          HandlerIntroVoid(DeleteInstance,message,request,response,
 872                                       handler);
 873                          try {
 874                              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 875 schuur          1.14             "CMPIProviderManager::handleDeleteInstanceRequest - Host name: $0  Name space: $1  Class name: $2",
 876 schuur          1.4              System::getHostName(),
 877                                  request->nameSpace.getString(),
 878                                  request->instanceName.getClassName().getString());
 879                      
 880                              // make target object path
 881                              CIMObjectPath objectPath(
 882                                  System::getHostName(),
 883                                  request->nameSpace,
 884                                  request->instanceName.getClassName(),
 885                                  request->instanceName.getKeyBindings());
 886                      
 887 schuur          1.39         Boolean remote=false;
 888                              CMPIProvider::OpProviderHolder ph;
 889 schuur          1.40 
 890 schuur          1.4          // resolve provider name
 891 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
 892                              ProviderName name = _resolveProviderName(pidc);
 893 schuur          1.4  
 894 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
 895 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
 896                              }
 897                              else {
 898 schuur          1.4          // get cached or load new provider module
 899 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
 900                              }
 901 schuur          1.4  
 902                              // convert arguments
 903                              OperationContext context;
 904                      
 905 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
 906                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
 907                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
 908 schuur          1.4          // forward request
 909 dj.gorey        1.25         CMPIProvider & pr=ph.GetProvider();
 910 schuur          1.4  
 911                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 912                                  "Calling provider.deleteInstance: " + pr.getName());
 913                      
 914 dj.gorey        1.25         CMPIStatus rc={CMPI_RC_OK,NULL};
 915 schuur          1.4          CMPI_ContextOnStack eCtx(context);
 916                              CMPI_ObjectPathOnStack eRef(objectPath);
 917                              CMPI_ResultOnStack eRes(handler,&pr.broker);
 918                              CMPI_ThreadContext thr(&pr.broker,&eCtx);
 919                      
 920                              CMPIFlags flgs=0;
 921                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
 922                      
 923 r.kieninger     1.48         const IdentityContainer container =
 924                                 request->operationContext.get(IdentityContainer::NAME);
 925                              eCtx.ft->addEntry(&eCtx,
 926                                                CMPIPrincipal,
 927                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
 928                                                CMPI_chars);
 929                      
 930 schuur          1.39         if (remote) {
 931 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
 932 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
 933                              }
 934                      
 935 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
 936                      
 937 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 938 dj.gorey        1.29                 CIMDeleteInstanceRequestMessage * req = dynamic_cast<CIMDeleteInstanceRequestMessage *>(const_cast<Message *>(message));
 939 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
 940 dj.gorey        1.29                 if (err_num!=0)
 941                                      {
 942                                              // need a new CIMException for this
 943                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
 944                                      }
 945 marek           1.26 #endif
 946                      
 947 schuur          1.4          STAT_GETSTARTTIME;
 948                      
 949                              rc=pr.miVector.instMI->ft->deleteInstance
 950 dj.gorey        1.25            (pr.miVector.instMI,&eCtx,&eRes,&eRef);
 951 schuur          1.4  
 952                              STAT_PMS_PROVIDEREND;
 953                      
 954 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
 955 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
 956 marek           1.26 #endif
 957                      
 958 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
 959 dj.gorey        1.25            throw CIMException((CIMStatusCode)rc.rc,
 960                                     rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
 961 schuur          1.4      }
 962                          HandlerCatch(handler);
 963 dj.gorey        1.25 
 964 schuur          1.4      PEG_METHOD_EXIT();
 965                      
 966                          return(response);
 967                      }
 968                      
 969 dj.gorey        1.29 Message * CMPIProviderManager::handleExecQueryRequest(const Message * message)
 970 schuur          1.4  {
 971                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
 972 schuur          1.14        "CMPIProviderManager::handleExecQueryRequest");
 973 schuur          1.4  
 974 schuur          1.14     HandlerIntro(ExecQuery,message,request,response,
 975                                       handler,Array<CIMObject>());
 976                      
 977 dj.gorey        1.25     try {
 978 schuur          1.14       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 979                                  "CMPIProviderManager::ExecQueryRequest - Host name: $0  Name space: $1  Class name: $2",
 980                                  System::getHostName(),
 981                                  request->nameSpace.getString(),
 982                                  request->className.getString());
 983                      
 984                              // make target object path
 985                              CIMObjectPath objectPath(
 986                                  System::getHostName(),
 987                                  request->nameSpace,
 988                                  request->className);
 989                      
 990 schuur          1.39         Boolean remote=false;
 991 schuur          1.40 
 992 schuur          1.39         CMPIProvider::OpProviderHolder ph;
 993 schuur          1.40 
 994 schuur          1.14         // resolve provider name
 995 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
 996                              ProviderName name = _resolveProviderName(pidc);
 997 schuur          1.14 
 998 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
 999 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
1000                              }
1001                              else {
1002 schuur          1.14         // get cached or load new provider module
1003 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
1004                              }
1005 schuur          1.4  
1006 dj.gorey        1.25         // convert arguments
1007 schuur          1.14         OperationContext context;
1008 schuur          1.4  
1009 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
1010                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1011                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
1012 schuur          1.14 
1013                              // forward request
1014 dj.gorey        1.25         CMPIProvider & pr=ph.GetProvider();
1015 schuur          1.14 
1016                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1017                                  "Calling provider.execQuery: " + pr.getName());
1018                      
1019                              DDD(cerr<<"--- CMPIProviderManager::execQuery"<<endl);
1020                      
1021                              const char **props=NULL;
1022                      
1023 dj.gorey        1.25         CMPIStatus rc={CMPI_RC_OK,NULL};
1024 schuur          1.14         CMPI_ContextOnStack eCtx(context);
1025                              CMPI_ObjectPathOnStack eRef(objectPath);
1026                              CMPI_ResultOnStack eRes(handler,&pr.broker);
1027                              CMPI_ThreadContext thr(&pr.broker,&eCtx);
1028 konrad.r        1.61 
1029                              const CString queryLan=request->queryLanguage.getCString();
1030 schuur          1.14         const CString query=request->query.getCString();
1031                      
1032                              CMPIFlags flgs=0;
1033                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
1034                      
1035 r.kieninger     1.48         const IdentityContainer container =
1036                                 request->operationContext.get(IdentityContainer::NAME);
1037                              eCtx.ft->addEntry(&eCtx,
1038                                                CMPIPrincipal,
1039                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
1040                                                CMPI_chars);
1041 r.kieninger     1.60 		eCtx.ft->addEntry(&eCtx,
1042 konrad.r        1.59 						  CMPINamespace,
1043                      						  (CMPIValue*)(const char*)request->nameSpace.getString().getCString(),
1044                      						  CMPI_chars);
1045 schuur          1.39         if (remote) {
1046 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
1047 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
1048                              }
1049                      
1050 schuur          1.14         CMPIProvider::pm_service_op_lock op_lock(&pr);
1051                      
1052 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1053 dj.gorey        1.29                 CIMExecQueryRequestMessage * req = dynamic_cast<CIMExecQueryRequestMessage *>(const_cast<Message *>(message));
1054 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
1055 dj.gorey        1.29                 if (err_num!=0)
1056                                      {
1057                                              // need a new CIMException for this
1058                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
1059                                      }
1060 marek           1.26 #endif
1061                      
1062 schuur          1.14         STAT_GETSTARTTIME;
1063                      
1064                              rc=pr.miVector.instMI->ft->execQuery
1065 dj.gorey        1.25            (pr.miVector.instMI,&eCtx,&eRes,&eRef,CHARS(queryLan),CHARS(query));
1066 schuur          1.14 
1067                              STAT_PMS_PROVIDEREND;
1068                      
1069 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1070 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
1071 marek           1.26 #endif
1072                      
1073 schuur          1.14         if (rc.rc!=CMPI_RC_OK)
1074 dj.gorey        1.25            throw CIMException((CIMStatusCode)rc.rc,
1075                                     rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1076 schuur          1.14 
1077 r.kieninger     1.48 
1078 schuur          1.14     }
1079                          HandlerCatch(handler);
1080 schuur          1.4  
1081                          PEG_METHOD_EXIT();
1082                      
1083                          return(response);
1084                      }
1085                      
1086 dj.gorey        1.29 Message * CMPIProviderManager::handleAssociatorsRequest(const Message * message)
1087 schuur          1.4  {
1088                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
1089                             "CMPIProviderManager::handleAssociatorsRequest");
1090                      
1091                          HandlerIntro(Associators,message,request,response,
1092                                       handler,Array<CIMObject>());
1093                          try {
1094                              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1095                                  "CMPIProviderManager::handleAssociatorsRequest - Host name: $0  Name space: $1  Class name: $2",
1096                                  System::getHostName(),
1097                                  request->nameSpace.getString(),
1098                                  request->objectName.getClassName().getString());
1099                      
1100                              // make target object path
1101                              CIMObjectPath objectPath(
1102                                  System::getHostName(),
1103                                  request->nameSpace,
1104                                  request->objectName.getClassName());
1105                      
1106                              objectPath.setKeyBindings(request->objectName.getKeyBindings());
1107                      
1108 schuur          1.4          CIMObjectPath assocPath(
1109                                  System::getHostName(),
1110                                  request->nameSpace,
1111                                  request->assocClass.getString());
1112                      
1113 schuur          1.39         Boolean remote=false;
1114 schuur          1.40 
1115 schuur          1.39         CMPIProvider::OpProviderHolder ph;
1116 schuur          1.40 
1117 schuur          1.4          // resolve provider name
1118 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
1119                              ProviderName name = _resolveProviderName(pidc);
1120 schuur          1.4  
1121 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
1122 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
1123                              }
1124                              else {
1125 schuur          1.4          // get cached or load new provider module
1126 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
1127                              }
1128 schuur          1.4  
1129                             // convert arguments
1130                              OperationContext context;
1131                      
1132 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
1133                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1134                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
1135 schuur          1.4  
1136                              // forward request
1137 schuur          1.17         CMPIProvider & pr=ph.GetProvider();
1138 schuur          1.4  
1139                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1140                                  "Calling provider.associators: " + pr.getName());
1141                      
1142 schuur          1.7          DDD(cerr<<"--- CMPIProviderManager::associators"<<" role: >"<<request->role<<"< aCls "<<
1143 schuur          1.17         request->assocClass<<endl);
1144 schuur          1.4  
1145 schuur          1.17         CMPIStatus rc={CMPI_RC_OK,NULL};
1146 schuur          1.4          CMPI_ContextOnStack eCtx(context);
1147                              CMPI_ObjectPathOnStack eRef(objectPath);
1148 schuur          1.17         CMPI_ResultOnStack eRes(handler,&pr.broker);
1149 schuur          1.4          CMPI_ThreadContext thr(&pr.broker,&eCtx);
1150                              const CString aClass=request->assocClass.getString().getCString();
1151                              const CString rClass=request->resultClass.getString().getCString();
1152                              const CString rRole=request->role.getCString();
1153                              const CString resRole=request->resultRole.getCString();
1154                      
1155 schuur          1.17         CMPIPropertyList props(request->propertyList);
1156 dj.gorey        1.25 
1157 schuur          1.4          CMPIFlags flgs=0;
1158                              if (request->includeQualifiers) flgs|=CMPI_FLAG_IncludeQualifiers;
1159                              if (request->includeClassOrigin) flgs|=CMPI_FLAG_IncludeClassOrigin;
1160                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
1161                      
1162 r.kieninger     1.48         const IdentityContainer container =
1163                                 request->operationContext.get(IdentityContainer::NAME);
1164                              eCtx.ft->addEntry(&eCtx,
1165                                                CMPIPrincipal,
1166                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
1167                                                CMPI_chars);
1168                      
1169 schuur          1.39         if (remote) {
1170 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
1171 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
1172                              }
1173                      
1174 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
1175                      
1176 dj.gorey        1.29 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1177                                      CIMAssociatorsRequestMessage * req = dynamic_cast<CIMAssociatorsRequestMessage *>(const_cast<Message *>(message));
1178 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
1179 dj.gorey        1.29                 if (err_num!=0)
1180                                      {
1181                                              // need a new CIMException for this
1182                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
1183                                      }
1184 marek           1.26 #endif
1185                      
1186 schuur          1.4          STAT_GETSTARTTIME;
1187                      
1188                              rc=pr.miVector.assocMI->ft->associators(
1189                                               pr.miVector.assocMI,&eCtx,&eRes,&eRef,CHARS(aClass),
1190 schuur          1.17                          CHARS(rClass),CHARS(rRole),CHARS(resRole),props.getList());
1191 schuur          1.4  
1192                              STAT_PMS_PROVIDEREND;
1193                      
1194 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1195 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
1196 marek           1.26 #endif
1197                      
1198 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
1199 dj.gorey        1.25            throw CIMException((CIMStatusCode)rc.rc,
1200                                     rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1201 schuur          1.4      }
1202                          HandlerCatch(handler);
1203 dj.gorey        1.25 
1204 schuur          1.4      PEG_METHOD_EXIT();
1205                      
1206                          return(response);
1207                      }
1208                      
1209 dj.gorey        1.29 Message * CMPIProviderManager::handleAssociatorNamesRequest(const Message * message)
1210 schuur          1.4  {
1211                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
1212                             "CMPIProviderManager::handleAssociatorNamesRequest");
1213                      
1214                          HandlerIntro(AssociatorNames,message,request,response,
1215                                       handler,Array<CIMObjectPath>());
1216                          try {
1217                              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1218                                  "CMPIProviderManager::handleAssociatorNamesRequest - Host name: $0  Name space: $1  Class name: $2",
1219                                  System::getHostName(),
1220                                  request->nameSpace.getString(),
1221                                  request->objectName.getClassName().getString());
1222                      
1223                              // make target object path
1224                              CIMObjectPath objectPath(
1225                                  System::getHostName(),
1226                                  request->nameSpace,
1227                                  request->objectName.getClassName());
1228                      
1229                              objectPath.setKeyBindings(request->objectName.getKeyBindings());
1230                      
1231 schuur          1.4          CIMObjectPath assocPath(
1232                                  System::getHostName(),
1233                                  request->nameSpace,
1234                                  request->assocClass.getString());
1235 schuur          1.21 
1236 schuur          1.39         Boolean remote=false;
1237                              CMPIProvider::OpProviderHolder ph;
1238 schuur          1.40 
1239 schuur          1.4          // resolve provider name
1240 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
1241                              ProviderName name = _resolveProviderName(pidc);
1242 schuur          1.4  
1243 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
1244 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
1245                              }
1246                              else {
1247 schuur          1.4          // get cached or load new provider module
1248 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
1249                              }
1250 schuur          1.4  
1251                              // convert arguments
1252                              OperationContext context;
1253                      
1254 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
1255                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1256                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
1257 schuur          1.4  
1258                              // forward request
1259 dj.gorey        1.25         CMPIProvider & pr=ph.GetProvider();
1260 schuur          1.4  
1261                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1262                                  "Calling provider.associatorNames: " + pr.getName());
1263                      
1264 schuur          1.7          DDD(cerr<<"--- CMPIProviderManager::associatorNames"<<" role: >"<<request->role<<"< aCls "<<
1265 dj.gorey        1.25            request->assocClass<<endl);
1266 schuur          1.4  
1267 dj.gorey        1.25         CMPIStatus rc={CMPI_RC_OK,NULL};
1268 schuur          1.4          CMPI_ContextOnStack eCtx(context);
1269                              CMPI_ObjectPathOnStack eRef(objectPath);
1270 dj.gorey        1.25         CMPI_ResultOnStack eRes(handler,&pr.broker);
1271 schuur          1.4          CMPI_ThreadContext thr(&pr.broker,&eCtx);
1272                              const CString aClass=request->assocClass.getString().getCString();
1273                              const CString rClass=request->resultClass.getString().getCString();
1274                              const CString rRole=request->role.getCString();
1275                              const CString resRole=request->resultRole.getCString();
1276                      
1277                              CMPIFlags flgs=0;
1278                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
1279                      
1280 r.kieninger     1.48         const IdentityContainer container =
1281                                 request->operationContext.get(IdentityContainer::NAME);
1282                              eCtx.ft->addEntry(&eCtx,
1283                                                CMPIPrincipal,
1284                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
1285                                                CMPI_chars);
1286                      
1287 schuur          1.39         if (remote) {
1288 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
1289 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
1290                              }
1291                      
1292 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
1293                      
1294 dj.gorey        1.29 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1295                                      CIMAssociatorNamesRequestMessage * req = dynamic_cast<CIMAssociatorNamesRequestMessage *>(const_cast<Message *>(message));
1296 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
1297 dj.gorey        1.29                 if (err_num!=0)
1298                                      {
1299                                              // need a new CIMException for this
1300                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
1301                                      }
1302 marek           1.26 #endif
1303                      
1304 schuur          1.4          STAT_GETSTARTTIME;
1305                      
1306                              rc=pr.miVector.assocMI->ft->associatorNames(
1307                                               pr.miVector.assocMI,&eCtx,&eRes,&eRef,CHARS(aClass),
1308                                               CHARS(rClass),CHARS(rRole),CHARS(resRole));
1309                      
1310                              STAT_PMS_PROVIDEREND;
1311                      
1312 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1313 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
1314 marek           1.26 #endif
1315                      
1316 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
1317 dj.gorey        1.25            throw CIMException((CIMStatusCode)rc.rc,
1318                                     rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1319 schuur          1.4      }
1320                          HandlerCatch(handler);
1321 dj.gorey        1.25 
1322 schuur          1.4      PEG_METHOD_EXIT();
1323                      
1324                          return(response);
1325                      }
1326                      
1327 dj.gorey        1.29 Message * CMPIProviderManager::handleReferencesRequest(const Message * message)
1328 schuur          1.4  {
1329                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
1330                             "CMPIProviderManager::handleReferencesRequest");
1331                      
1332                          HandlerIntro(References,message,request,response,
1333                                       handler,Array<CIMObject>());
1334                          try {
1335                              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1336 schuur          1.14             "CMPIProviderManager::handleReferencesRequest - Host name: $0  Name space: $1  Class name: $2",
1337 schuur          1.4              System::getHostName(),
1338                                  request->nameSpace.getString(),
1339                                  request->objectName.getClassName().getString());
1340                      
1341                              // make target object path
1342                              CIMObjectPath objectPath(
1343                                  System::getHostName(),
1344                                  request->nameSpace,
1345                                  request->objectName.getClassName());
1346                      
1347                              objectPath.setKeyBindings(request->objectName.getKeyBindings());
1348                      
1349                              CIMObjectPath resultPath(
1350                                  System::getHostName(),
1351                                  request->nameSpace,
1352                                  request->resultClass.getString());
1353                      
1354 schuur          1.39         Boolean remote=false;
1355                              CMPIProvider::OpProviderHolder ph;
1356 schuur          1.40 
1357 schuur          1.4          // resolve provider name
1358 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
1359                              ProviderName name = _resolveProviderName(pidc);
1360 schuur          1.4  
1361 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
1362 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
1363                              }
1364                              else {
1365 schuur          1.4          // get cached or load new provider module
1366 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
1367                              }
1368 schuur          1.4  
1369                              // convert arguments
1370                              OperationContext context;
1371                      
1372 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
1373                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1374                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
1375 schuur          1.4          // forward request
1376 schuur          1.17         CMPIProvider & pr=ph.GetProvider();
1377 schuur          1.4  
1378                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1379                                  "Calling provider.references: " + pr.getName());
1380                      
1381 schuur          1.7          DDD(cerr<<"--- CMPIProviderManager::references"<<" role: >"<<request->role<<"< aCls "<<
1382 schuur          1.17         request->resultClass<<endl);
1383 schuur          1.4  
1384 schuur          1.17         CMPIStatus rc={CMPI_RC_OK,NULL};
1385 schuur          1.4          CMPI_ContextOnStack eCtx(context);
1386                              CMPI_ObjectPathOnStack eRef(objectPath);
1387 schuur          1.17         CMPI_ResultOnStack eRes(handler,&pr.broker);
1388 schuur          1.4          CMPI_ThreadContext thr(&pr.broker,&eCtx);
1389                              const CString rClass=request->resultClass.getString().getCString();
1390                              const CString rRole=request->role.getCString();
1391                      
1392 schuur          1.17         CMPIPropertyList props(request->propertyList);
1393 dj.gorey        1.25 
1394 schuur          1.4          CMPIFlags flgs=0;
1395                              if (request->includeQualifiers) flgs|=CMPI_FLAG_IncludeQualifiers;
1396                              if (request->includeClassOrigin) flgs|=CMPI_FLAG_IncludeClassOrigin;
1397                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
1398                      
1399 r.kieninger     1.48         const IdentityContainer container =
1400                                 request->operationContext.get(IdentityContainer::NAME);
1401                              eCtx.ft->addEntry(&eCtx,
1402                                                CMPIPrincipal,
1403                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
1404                                                CMPI_chars);
1405                      
1406 schuur          1.39         if (remote) {
1407 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
1408 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
1409                              }
1410                      
1411 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
1412                      
1413 dj.gorey        1.29 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1414                                      CIMReferencesRequestMessage * req = dynamic_cast<CIMReferencesRequestMessage *>(const_cast<Message *>(message));
1415 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
1416 dj.gorey        1.29                 if (err_num!=0)
1417                                      {
1418                                              // need a new CIMException for this
1419                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
1420                                      }
1421 marek           1.26 #endif
1422                      
1423 schuur          1.4          STAT_GETSTARTTIME;
1424                      
1425                              rc=pr.miVector.assocMI->ft->references(
1426                                               pr.miVector.assocMI,&eCtx,&eRes,&eRef,
1427 schuur          1.17                          CHARS(rClass),CHARS(rRole),props.getList());
1428 schuur          1.4  
1429                              STAT_PMS_PROVIDEREND;
1430                      
1431 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1432 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
1433 marek           1.26 #endif
1434                      
1435 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
1436 schuur          1.23             throw CIMException((CIMStatusCode)rc.rc,
1437 dj.gorey        1.25                rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1438 schuur          1.4      }
1439                          HandlerCatch(handler);
1440 dj.gorey        1.25 
1441 schuur          1.4      PEG_METHOD_EXIT();
1442                      
1443                          return(response);
1444                      }
1445                      
1446 dj.gorey        1.29 Message * CMPIProviderManager::handleReferenceNamesRequest(const Message * message)
1447 schuur          1.4  {
1448                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
1449                              "CMPIProviderManager::handleReferenceNamesRequest");
1450                      
1451                          HandlerIntro(ReferenceNames,message,request,response,
1452                                       handler,Array<CIMObjectPath>());
1453                          try {
1454                              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1455                                  "CMPIProviderManager::handleReferenceNamesRequest - Host name: $0  Name space: $1  Class name: $2",
1456                                  System::getHostName(),
1457                                  request->nameSpace.getString(),
1458                                  request->objectName.getClassName().getString());
1459                      
1460                              // make target object path
1461                              CIMObjectPath objectPath(
1462                                  System::getHostName(),
1463                                  request->nameSpace,
1464                                  request->objectName.getClassName());
1465                      
1466                              objectPath.setKeyBindings(request->objectName.getKeyBindings());
1467                      
1468 schuur          1.4          CIMObjectPath resultPath(
1469                                  System::getHostName(),
1470                                  request->nameSpace,
1471                                  request->resultClass.getString());
1472                      
1473 schuur          1.39         Boolean remote=false;
1474                              CMPIProvider::OpProviderHolder ph;
1475 schuur          1.40 
1476 schuur          1.4          // resolve provider name
1477 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
1478                              ProviderName name = _resolveProviderName(pidc);
1479 schuur          1.4  
1480 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
1481 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
1482                              }
1483                              else {
1484 schuur          1.4          // get cached or load new provider module
1485 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
1486                              }
1487 schuur          1.4  
1488                              // convert arguments
1489                              OperationContext context;
1490                      
1491 se.gupta        1.37 		context.insert(request->operationContext.get(IdentityContainer::NAME));
1492 schuur          1.40 		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1493                      	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
1494 dj.gorey        1.25         CMPIProvider & pr=ph.GetProvider();
1495 schuur          1.4  
1496                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1497                                  "Calling provider.referenceNames: " + pr.getName());
1498                      
1499 schuur          1.7          DDD(cerr<<"--- CMPIProviderManager::referenceNames"<<" role: >"<<request->role<<"< aCls "<<
1500 dj.gorey        1.25            request->resultClass<<endl);
1501 schuur          1.4  
1502 dj.gorey        1.25         CMPIStatus rc={CMPI_RC_OK,NULL};
1503 schuur          1.4          CMPI_ContextOnStack eCtx(context);
1504                              CMPI_ObjectPathOnStack eRef(objectPath);
1505 dj.gorey        1.25         CMPI_ResultOnStack eRes(handler,&pr.broker);
1506 schuur          1.4          CMPI_ThreadContext thr(&pr.broker,&eCtx);
1507                              const CString rClass=request->resultClass.getString().getCString();
1508                              const CString rRole=request->role.getCString();
1509                      
1510                              CMPIFlags flgs=0;
1511                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
1512                      
1513 r.kieninger     1.48         const IdentityContainer container =
1514                                 request->operationContext.get(IdentityContainer::NAME);
1515                              eCtx.ft->addEntry(&eCtx,
1516                                                CMPIPrincipal,
1517                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
1518                                                CMPI_chars);
1519                      
1520 schuur          1.39         if (remote) {
1521 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
1522 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
1523                              }
1524                      
1525 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
1526                      
1527 dj.gorey        1.29 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1528                                      CIMReferenceNamesRequestMessage * req = dynamic_cast<CIMReferenceNamesRequestMessage *>(const_cast<Message *>(message));
1529 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
1530 dj.gorey        1.29                 if (err_num!=0)
1531                                      {
1532                                              // need a new CIMException for this
1533                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
1534                                      }
1535 marek           1.26 #endif
1536                      
1537 schuur          1.4          STAT_GETSTARTTIME;
1538                      
1539                              rc=pr.miVector.assocMI->ft->referenceNames(
1540                                               pr.miVector.assocMI,&eCtx,&eRes,&eRef,
1541                                               CHARS(rClass),CHARS(rRole));
1542                      
1543                              STAT_PMS_PROVIDEREND;
1544                      
1545 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1546 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
1547 marek           1.26 #endif
1548                      
1549 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
1550 dj.gorey        1.25            throw CIMException((CIMStatusCode)rc.rc,
1551                                     rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1552 schuur          1.4      }
1553                          HandlerCatch(handler);
1554 dj.gorey        1.25 
1555 schuur          1.4      PEG_METHOD_EXIT();
1556                      
1557                          return(response);
1558                      }
1559                      
1560 dj.gorey        1.29 Message * CMPIProviderManager::handleInvokeMethodRequest(const Message * message)
1561 schuur          1.4  {
1562                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
1563                              "CMPIProviderManager::handleInvokeMethodRequest");
1564                      
1565                          HandlerIntroMethod(InvokeMethod,message,request,response,
1566                                       handler);
1567                          try {
1568                              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1569                                  "CMPIProviderManager::handleInvokeMethodRequest - Host name: $0  Name space: $1  Class name: $2",
1570                                  System::getHostName(),
1571                                  request->nameSpace.getString(),
1572                                  request->instanceName.getClassName().getString());
1573                      
1574                              // make target object path
1575                              CIMObjectPath objectPath(
1576                                  System::getHostName(),
1577                                  request->nameSpace,
1578                                  request->instanceName.getClassName(),
1579                                  request->instanceName.getKeyBindings());
1580                      
1581 schuur          1.39         Boolean remote=false;
1582                              CMPIProvider::OpProviderHolder ph;
1583 schuur          1.40 
1584 schuur          1.4          // resolve provider name
1585 schuur          1.40         ProviderIdContainer pidc = request->operationContext.get(ProviderIdContainer::NAME);
1586                              ProviderName name = _resolveProviderName(pidc);
1587 schuur          1.4  
1588 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
1589 schuur          1.39            ph = providerManager.getRemoteProvider(name.getLocation(), name.getLogicalName());
1590                              }
1591                              else {
1592 schuur          1.4          // get cached or load new provider module
1593 schuur          1.39            ph = providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
1594                              }
1595 schuur          1.4  
1596                              // convert arguments
1597                              OperationContext context;
1598                      
1599 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
1600                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1601                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
1602 schuur          1.4  
1603                              CIMObjectPath instanceReference(request->instanceName);
1604                      
1605                              // ATTN: propagate namespace
1606                              instanceReference.setNameSpace(request->nameSpace);
1607                      
1608                              // forward request
1609 dj.gorey        1.25         CMPIProvider & pr=ph.GetProvider();
1610 schuur          1.4  
1611                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1612                                  "Calling provider.invokeMethod: " + pr.getName());
1613                      
1614 dj.gorey        1.25         CMPIStatus rc={CMPI_RC_OK,NULL};
1615 schuur          1.4          CMPI_ContextOnStack eCtx(context);
1616                              CMPI_ObjectPathOnStack eRef(objectPath);
1617                              CMPI_ResultOnStack eRes(handler,&pr.broker);
1618                              CMPI_ThreadContext thr(&pr.broker,&eCtx);
1619                              CMPI_ArgsOnStack eArgsIn(request->inParameters);
1620                              Array<CIMParamValue> outArgs;
1621                              CMPI_ArgsOnStack eArgsOut(outArgs);
1622                              CString mName=request->methodName.getString().getCString();
1623                      
1624                              CMPIFlags flgs=0;
1625                              eCtx.ft->addEntry(&eCtx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32);
1626                      
1627 r.kieninger     1.48         const IdentityContainer container =
1628                                 request->operationContext.get(IdentityContainer::NAME);
1629                              eCtx.ft->addEntry(&eCtx,
1630                                                CMPIPrincipal,
1631                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
1632                                                CMPI_chars);
1633                      
1634 schuur          1.39         if (remote) {
1635 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
1636 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
1637                              }
1638                      
1639 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
1640                      
1641 dj.gorey        1.29 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1642                                      CIMInvokeMethodRequestMessage * req = dynamic_cast<CIMInvokeMethodRequestMessage *>(const_cast<Message *>(message));
1643 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
1644 dj.gorey        1.29                 if (err_num!=0)
1645                                      {
1646                                              // need a new CIMException for this
1647                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
1648                                      }
1649 marek           1.26 #endif
1650 schuur          1.4          STAT_GETSTARTTIME;
1651                      
1652                              rc=pr.miVector.methMI->ft->invokeMethod(
1653                                 pr.miVector.methMI,&eCtx,&eRes,&eRef,CHARS(mName),&eArgsIn,&eArgsOut);
1654                      
1655                              STAT_PMS_PROVIDEREND;
1656                      
1657 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1658 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
1659 marek           1.26 #endif
1660                      
1661 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
1662 dj.gorey        1.25            throw CIMException((CIMStatusCode)rc.rc,
1663                                     rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1664 schuur          1.4  
1665                             for (int i=0,s=outArgs.size(); i<s; i++)
1666                                 handler.deliverParamValue(outArgs[i]);
1667                             handler.complete();
1668                          }
1669                          HandlerCatch(handler);
1670 dj.gorey        1.25 
1671 schuur          1.4      PEG_METHOD_EXIT();
1672                      
1673 dj.gorey        1.25     return(response);
1674 schuur          1.4  }
1675 schuur          1.18 
1676 schuur          1.4  int LocateIndicationProviderNames(const CIMInstance& pInstance, const CIMInstance& pmInstance,
1677                                                        String& providerName, String& location)
1678                      {
1679                          Uint32 pos = pInstance.findProperty(CIMName ("Name"));
1680                          pInstance.getProperty(pos).getValue().get(providerName);
1681                      
1682                          pos = pmInstance.findProperty(CIMName ("Location"));
1683 dj.gorey        1.25     pmInstance.getProperty(pos).getValue().get(location);
1684 schuur          1.4      return 0;
1685                      }
1686                      
1687 dj.gorey        1.29 Message * CMPIProviderManager::handleCreateSubscriptionRequest(const Message * message)
1688 schuur          1.4  {
1689 schuur          1.14     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "CMPIProviderManager::handleCreateSubscriptionRequest");
1690 schuur          1.4  
1691                          HandlerIntroInd(CreateSubscription,message,request,response,
1692                                       handler);
1693                          try {
1694                              const CIMObjectPath &x=request->subscriptionInstance.getPath();
1695 schuur          1.40         CIMInstance req_provider, req_providerModule;
1696                              ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);
1697                              req_provider = pidc.getProvider();
1698                              req_providerModule = pidc.getModule();
1699 se.gupta        1.36 
1700 schuur          1.17         String providerName,providerLocation;
1701 se.gupta        1.36         LocateIndicationProviderNames(req_provider, req_providerModule,
1702 schuur          1.17         providerName,providerLocation);
1703 schuur          1.4  
1704                              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1705                                  "CMPIProviderManager::handleCreateSubscriptionRequest - Host name: $0  Name space: $1  Provider name(s): $2",
1706                                  System::getHostName(),
1707                                  request->nameSpace.getString(),
1708                                  providerName);
1709                      
1710 schuur          1.39         Boolean remote=false;
1711                              CMPIProvider::OpProviderHolder ph;
1712 schuur          1.40 
1713 schuur          1.15         String fileName = _resolvePhysicalName(providerLocation);
1714 schuur          1.4  
1715 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
1716 schuur          1.39            ph = providerManager.getProvider("CMPIRProxyProvider", providerName);
1717                              }
1718                              else {
1719 schuur          1.4          // get cached or load new provider module
1720 schuur          1.39            ph = providerManager.getProvider(fileName, providerName);
1721                              }
1722 schuur          1.4  
1723                              indProvRecord *prec=NULL;
1724 schuur          1.17         provTab.lookup(providerName,prec);
1725                              if (prec) prec->count++;
1726 schuur          1.4          else {
1727 schuur          1.17            prec=new indProvRecord();
1728                                 provTab.insert(providerName,prec);
1729                              }
1730 schuur          1.4  
1731 carolann.graves 1.57         //
1732                              //  Save the provider instance from the request
1733                              //
1734                              ph.GetProvider ().setProviderInstance (req_provider);
1735                      
1736 schuur          1.4          indSelectRecord *srec=new indSelectRecord();
1737                              const CIMObjectPath &sPath=request->subscriptionInstance.getPath();
1738 konrad.r        1.53 
1739 schuur          1.17         selxTab.insert(sPath.toString(),srec);
1740 schuur          1.4  
1741                              // convert arguments
1742 konrad.r        1.51         OperationContext context;
1743                              context.insert(request->operationContext.get(IdentityContainer::NAME));
1744                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1745                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
1746                              context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));
1747                              context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME));
1748                              context.insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME));
1749 schuur          1.4  
1750 schuur          1.40         CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();
1751 schuur          1.4  
1752 schuur          1.17         CMPIProvider & pr=ph.GetProvider();
1753 schuur          1.4  
1754 schuur          1.17         CMPIStatus rc={CMPI_RC_OK,NULL};
1755 konrad.r        1.51         CMPI_ContextOnStack eCtx(context);
1756 r.kieninger     1.48 
1757 se.gupta        1.43 		SubscriptionFilterConditionContainer sub_cntr =  request->operationContext.get
1758                      								(SubscriptionFilterConditionContainer::NAME);
1759                      
1760 konrad.r        1.58 		CIMOMHandleQueryContext *_context= new CIMOMHandleQueryContext(CIMNamespaceName(request->nameSpace.getString()),
1761                      										*pr._cimom_handle);
1762                      
1763 konrad.r        1.51 		CMPI_SelectExp *eSelx=new CMPI_SelectExp(context,
1764 konrad.r        1.58 						_context,
1765 konrad.r        1.53         				request->query,
1766                              				sub_cntr.getQueryLanguage());
1767                      
1768 schuur          1.17         srec->eSelx=eSelx;
1769 konrad.r        1.58 	    srec->qContext=_context;
1770                      
1771 schuur          1.4          CMPI_ThreadContext thr(&pr.broker,&eCtx);
1772                      
1773                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1774                                  "Calling provider.createSubscriptionRequest: " + pr.getName());
1775                      
1776 schuur          1.7          DDD(cerr<<"--- CMPIProviderManager::createSubscriptionRequest"<<endl);
1777 schuur          1.4  
1778                              for(Uint32 i = 0, n = request->classNames.size(); i < n; i++) {
1779                                  CIMObjectPath className(
1780                                      System::getHostName(),
1781                                      request->nameSpace,
1782                                      request->classNames[i]);
1783                                  eSelx->classNames.append(className);
1784                              }
1785                              CMPI_ObjectPathOnStack eRef(eSelx->classNames[0]);
1786                      
1787                              CIMPropertyList propertyList = request->propertyList;
1788 schuur          1.17         if (!propertyList.isNull()) {
1789 schuur          1.4             Array<CIMName> p=propertyList.getPropertyNameArray();
1790                                 int pCount=p.size();
1791                                 eSelx->props=(const char**)malloc((1+pCount)*sizeof(char*));
1792                                 for (int i=0; i<pCount; i++) {
1793                                    eSelx->props[i]=strdup(p[i].getString().getCString());
1794 schuur          1.17            }
1795 schuur          1.4             eSelx->props[pCount]=NULL;
1796                              }
1797                      
1798                              Uint16 repeatNotificationPolicy = request->repeatNotificationPolicy;
1799                      
1800 r.kieninger     1.48         const IdentityContainer container =
1801                                 request->operationContext.get(IdentityContainer::NAME);
1802                              eCtx.ft->addEntry(&eCtx,
1803                                                CMPIPrincipal,
1804                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
1805                                                CMPI_chars);
1806                      
1807 r.kieninger     1.60 		eCtx.ft->addEntry(&eCtx,
1808 konrad.r        1.59 						  CMPINamespace,
1809                      						  (CMPIValue*)(const char*)request->nameSpace.getString().getCString(),
1810                      						  CMPI_chars);
1811 r.kieninger     1.60 
1812 schuur          1.39         if (remote) {
1813 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
1814 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
1815                              }
1816                      
1817 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
1818                      
1819 dj.gorey        1.29 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1820                                      CIMCreateSubscriptionRequestMessage * req = dynamic_cast<CIMCreateSubscriptionRequestMessage *>(const_cast<Message *>(message));
1821 r.kieninger     1.60                 int err_num=enablePThreadSecurity(*context);
1822 dj.gorey        1.29                 if (err_num!=0)
1823                                      {
1824                                              // need a new CIMException for this
1825                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
1826                                      }
1827 marek           1.26 #endif
1828 schuur          1.4          STAT_GETSTARTTIME;
1829                      
1830                              rc=pr.miVector.indMI->ft->activateFilter(
1831                                 pr.miVector.indMI,&eCtx,NULL,eSelx,
1832 schuur          1.22            CHARS(eSelx->classNames[0].getClassName().getString().getCString()),
1833 dj.gorey        1.25            &eRef,false);
1834 schuur          1.4  
1835                             STAT_PMS_PROVIDEREND;
1836                      
1837 marek           1.26 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1838 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
1839 marek           1.26 #endif
1840                      
1841 schuur          1.4          if (rc.rc!=CMPI_RC_OK)
1842 carolann.graves 1.57         {
1843 schuur          1.23            throw CIMException((CIMStatusCode)rc.rc,
1844 dj.gorey        1.25                rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1845 carolann.graves 1.57         }
1846                              else
1847                              {
1848                                  //
1849                                  //  Increment count of current subscriptions for this provider
1850                                  //
1851                                  if (ph.GetProvider ().testIfZeroAndIncrementSubscriptions ())
1852                                  {
1853                                      //
1854                                      //  If there were no current subscriptions before the increment,
1855                                      //  the first subscription has been created
1856                                      //  Call the provider's enableIndications method
1857                                      //
1858                                      if (_subscriptionInitComplete)
1859                                      {
1860 r.kieninger     1.60                     _callEnableIndications (req_provider, _indicationCallback,
1861 carolann.graves 1.57                         ph);
1862                                      }
1863                                  }
1864                              }
1865 schuur          1.4      }
1866                          HandlerCatch(handler);
1867 dj.gorey        1.25 
1868 schuur          1.4      PEG_METHOD_EXIT();
1869                      
1870                          return(response);
1871                      }
1872                      
1873 dj.gorey        1.29 Message * CMPIProviderManager::handleDeleteSubscriptionRequest(const Message * message)
1874 schuur          1.4  {
1875                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "CMPIProviderManager::handleDeleteSubscriptionRequest");
1876                      
1877                          HandlerIntroInd(DeleteSubscription,message,request,response,
1878                                       handler);
1879                          try {
1880 dj.gorey        1.25         String providerName,providerLocation;
1881 se.gupta        1.36 
1882 schuur          1.40         CIMInstance req_provider, req_providerModule;
1883                              ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);
1884                              req_provider = pidc.getProvider();
1885                              req_providerModule = pidc.getModule();
1886 se.gupta        1.36 
1887                              LocateIndicationProviderNames(req_provider, req_providerModule,
1888 dj.gorey        1.25            providerName,providerLocation);
1889 schuur          1.4  
1890                              Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1891                                  "CMPIProviderManager::handleDeleteSubscriptionRequest - Host name: $0  Name space: $1  Provider name(s): $2",
1892                                  System::getHostName(),
1893                                  request->nameSpace.getString(),
1894                                  providerName);
1895                      
1896 schuur          1.39         Boolean remote=false;
1897                              CMPIProvider::OpProviderHolder ph;
1898 schuur          1.40 
1899 schuur          1.15         String fileName = _resolvePhysicalName(providerLocation);
1900 schuur          1.4  
1901 schuur          1.40         if ((remote=pidc.isRemoteNameSpace())) {
1902 schuur          1.39            ph = providerManager.getProvider("CMPIRProxyProvider", providerName);
1903                              }
1904                              else {
1905 schuur          1.4          // get cached or load new provider module
1906 schuur          1.39            ph = providerManager.getProvider(fileName, providerName);
1907                              }
1908 schuur          1.4  
1909                      
1910                              indProvRecord *prec=NULL;
1911 dj.gorey        1.25         provTab.lookup(providerName,prec);
1912                              if (--prec->count<=0) {
1913 konrad.r        1.52 		   if (prec->handler)
1914                      				   delete prec->handler;
1915 konrad.r        1.51 		   delete prec;
1916 dj.gorey        1.25            provTab.remove(providerName);
1917                                 prec=NULL;
1918                              }
1919 schuur          1.4  
1920                              indSelectRecord *srec=NULL;
1921                              const CIMObjectPath &sPath=request->subscriptionInstance.getPath();
1922 dj.gorey        1.25         String sPathString=sPath.toString();
1923                              selxTab.lookup(sPathString,srec);
1924 schuur          1.4  
1925                              CMPI_SelectExp *eSelx=srec->eSelx;
1926 konrad.r        1.58 		CIMOMHandleQueryContext *qContext=srec->qContext;
1927                      
1928 schuur          1.4          CMPI_ObjectPathOnStack eRef(eSelx->classNames[0]);
1929 dj.gorey        1.25         selxTab.remove(sPathString);
1930 schuur          1.4  
1931 dj.gorey        1.25         // convert arguments
1932 schuur          1.4          OperationContext context;
1933 schuur          1.40         context.insert(request->operationContext.get(IdentityContainer::NAME));
1934                              context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME));
1935                              context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));
1936                              context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));
1937                              context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME));
1938 schuur          1.4  
1939                              CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();
1940                      
1941 dj.gorey        1.25         CMPIProvider & pr=ph.GetProvider();
1942 schuur          1.4  
1943 dj.gorey        1.25         CMPIStatus rc={CMPI_RC_OK,NULL};
1944 schuur          1.4          CMPI_ContextOnStack eCtx(context);
1945                              CMPI_ThreadContext thr(&pr.broker,&eCtx);
1946                      
1947                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1948                                  "Calling provider.deleteSubscriptionRequest: " + pr.getName());
1949                      
1950 schuur          1.7          DDD(cerr<<"--- CMPIProviderManager::deleteSubscriptionRequest"<<endl);
1951 schuur          1.4  
1952 r.kieninger     1.48         const IdentityContainer container =
1953                                 request->operationContext.get(IdentityContainer::NAME);
1954                              eCtx.ft->addEntry(&eCtx,
1955                                                CMPIPrincipal,
1956                                                (CMPIValue*)(const char*)container.getUserName().getCString(),
1957                                                CMPI_chars);
1958                      
1959 r.kieninger     1.60 		eCtx.ft->addEntry(&eCtx,
1960 konrad.r        1.59 						  CMPINamespace,
1961                      						  (CMPIValue*)(const char*)request->nameSpace.getString().getCString(),
1962                      						  CMPI_chars);
1963 schuur          1.39         if (remote) {
1964 schuur          1.40            CString info=pidc.getRemoteInfo().getCString();
1965 schuur          1.39            eCtx.ft->addEntry(&eCtx,"CMPIRRemoteInfo",(CMPIValue*)(const char*)info,CMPI_chars);
1966                              }
1967                      
1968 schuur          1.4          CMPIProvider::pm_service_op_lock op_lock(&pr);
1969                      
1970 dj.gorey        1.29 #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1971                                      CIMDeleteSubscriptionRequestMessage * req = dynamic_cast<CIMDeleteSubscriptionRequestMessage *>(const_cast<Message *>(message));
1972 r.kieninger     1.60                 int err_num=enablePThreadSecurity(context);
1973 dj.gorey        1.29                 if (err_num!=0)
1974                                      {
1975                                              // need a new CIMException for this
1976                                              throw CIMException(CIM_ERR_ACCESS_DENIED,String(strerror(err_num)));
1977                                      }
1978 marek           1.26 #endif
1979 schuur          1.4          STAT_GETSTARTTIME;
1980                              rc=pr.miVector.indMI->ft->deActivateFilter(
1981                                 pr.miVector.indMI,&eCtx,NULL,eSelx,
1982 schuur          1.22            CHARS(eSelx->classNames[0].getClassName().getString().getCString()),
1983 dj.gorey        1.25            &eRef,prec==NULL);
1984 schuur          1.4  
1985                             STAT_PMS_PROVIDEREND;
1986 konrad.r        1.58 
1987 r.kieninger     1.60 	   delete qContext;
1988 konrad.r        1.51 	   delete eSelx;
1989                      	   delete srec;
1990 marek           1.26 
1991                      #ifdef PEGASUS_ZOS_THREADLEVEL_SECURITY
1992 dj.gorey        1.29                 disablePThreadSecurity(req->userName);
1993 marek           1.26 #endif
1994 schuur          1.4  
1995                              if (rc.rc!=CMPI_RC_OK)
1996 carolann.graves 1.57         {
1997 dj.gorey        1.25            throw CIMException((CIMStatusCode)rc.rc,
1998                                     rc.msg ? CMGetCharsPtr(rc.msg,NULL) : String::EMPTY);
1999 schuur          1.4          }
2000 carolann.graves 1.57         else
2001                              {
2002                                  //
2003                                  //  Decrement count of current subscriptions for this provider
2004                                  //
2005                                  if (ph.GetProvider ().decrementSubscriptionsAndTestIfZero ())
2006                                  {
2007                                      //
2008                                      //  If there are no current subscriptions after the decrement,
2009                                      //  the last subscription has been deleted
2010                                      //  Call the provider's disableIndications method
2011                                      //
2012                                      if (_subscriptionInitComplete)
2013                                      {
2014                                          _callDisableIndications (ph);
2015                                      }
2016                                  }
2017 schuur          1.39         }
2018 schuur          1.4      }
2019                          HandlerCatch(handler);
2020 dj.gorey        1.25 
2021 schuur          1.4      PEG_METHOD_EXIT();
2022                      
2023                          return(response);
2024                      }
2025                      
2026 dj.gorey        1.29 Message * CMPIProviderManager::handleDisableModuleRequest(const Message * message)
2027 schuur          1.4  {
2028                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "CMPIProviderManager::handleDisableModuleRequest");
2029                      
2030                          CIMDisableModuleRequestMessage * request =
2031                              dynamic_cast<CIMDisableModuleRequestMessage *>(const_cast<Message *>(message));
2032                      
2033                          PEGASUS_ASSERT(request != 0);
2034                      
2035                          // get provider module name
2036                          Boolean disableProviderOnly = request->disableProviderOnly;
2037 r.kieninger     1.60 
2038 schuur          1.4      Array<Uint16> operationalStatus;
2039 kumpf           1.30     // Assume success.
2040 kumpf           1.42     operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_STOPPED);
2041 schuur          1.4  
2042 kumpf           1.30     //
2043 schuur          1.4      // Unload providers
2044 kumpf           1.30     //
2045 schuur          1.4      Array<CIMInstance> _pInstances = request->providers;
2046 carolann.graves 1.57     Array <Boolean> _indicationProviders = request->indicationProviders;
2047 konrad.r        1.56 	/* The CIMInstances on request->providers array is completly _different_ than
2048                      	   the request->providerModule CIMInstance. Hence  */
2049                      
2050 schuur          1.16     String physicalName=_resolvePhysicalName(request->providerModule.getProperty(
2051 dj.gorey        1.25               request->providerModule.findProperty("Location")).getValue().toString());
2052 schuur          1.4  
2053                          for(Uint32 i = 0, n = _pInstances.size(); i < n; i++)
2054                          {
2055 carolann.graves 1.57         String providerName;
2056 r.kieninger     1.60         _pInstances [i].getProperty (_pInstances [i].findProperty
2057 carolann.graves 1.57             (CIMName ("Name"))).getValue ().get (providerName);
2058                      
2059 konrad.r        1.56 		Uint32 pos = _pInstances[i].findProperty("Name");
2060 schuur          1.16         providerManager.unloadProvider(_pInstances[i].getProperty(
2061 konrad.r        1.56 											_pInstances[i].findProperty("Name")
2062 r.kieninger     1.60 										).getValue ().toString (),
2063 schuur          1.16                                        physicalName);
2064 carolann.graves 1.57 
2065                              //
2066                              //  Reset the indication provider's count of current
2067                              //  subscriptions since it has been disabled
2068                              //
2069                              if (_indicationProviders [i])
2070                              {
2071                                  if (physicalName.size () > 0)
2072                                  {
2073                                      CMPIProvider::OpProviderHolder ph = providerManager.getProvider
2074                                          (physicalName, providerName);
2075                      
2076                                      ph.GetProvider ().resetSubscriptions ();
2077                                  }
2078                              }
2079 schuur          1.4      }
2080                      
2081                          CIMDisableModuleResponseMessage * response =
2082                              new CIMDisableModuleResponseMessage(
2083                              request->messageId,
2084                              CIMException(),
2085                              request->queueIds.copyAndPop(),
2086                              operationalStatus);
2087                      
2088                          PEGASUS_ASSERT(response != 0);
2089                      
2090                          // preserve message key
2091                          response->setKey(request->getKey());
2092                      
2093                          //
2094                          //  Set HTTP method in response from request
2095                          //
2096                          response->setHttpMethod (request->getHttpMethod ());
2097                      
2098                          PEG_METHOD_EXIT();
2099                      
2100 schuur          1.4      return(response);
2101                      }
2102                      
2103 dj.gorey        1.29 Message * CMPIProviderManager::handleEnableModuleRequest(const Message * message)
2104 schuur          1.4  {
2105                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "CMPIProviderManager::handleEnableModuleRequest");
2106                      
2107                          CIMEnableModuleRequestMessage * request =
2108                              dynamic_cast<CIMEnableModuleRequestMessage *>(const_cast<Message *>(message));
2109                      
2110                          PEGASUS_ASSERT(request != 0);
2111                      
2112                          Array<Uint16> operationalStatus;
2113 kumpf           1.42     operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK);
2114 schuur          1.4  
2115                          CIMEnableModuleResponseMessage * response =
2116                              new CIMEnableModuleResponseMessage(
2117                              request->messageId,
2118                              CIMException(),
2119                              request->queueIds.copyAndPop(),
2120                              operationalStatus);
2121                      
2122                          PEGASUS_ASSERT(response != 0);
2123                      
2124                          // preserve message key
2125                          response->setKey(request->getKey());
2126                      
2127                          //  Set HTTP method in response from request
2128                          response->setHttpMethod (request->getHttpMethod ());
2129                      
2130                          PEG_METHOD_EXIT();
2131                      
2132                          return(response);
2133                      }
2134                      
2135 dj.gorey        1.29 Message * CMPIProviderManager::handleStopAllProvidersRequest(const Message * message)
2136 schuur          1.4  {
2137                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "CMPIProviderManager::handleStopAllProvidersRequest");
2138                      
2139                          CIMStopAllProvidersRequestMessage * request =
2140                              dynamic_cast<CIMStopAllProvidersRequestMessage *>(const_cast<Message *>(message));
2141                      
2142                          PEGASUS_ASSERT(request != 0);
2143                      
2144                          CIMStopAllProvidersResponseMessage * response =
2145                              new CIMStopAllProvidersResponseMessage(
2146                              request->messageId,
2147                              CIMException(),
2148                              request->queueIds.copyAndPop());
2149                      
2150                          PEGASUS_ASSERT(response != 0);
2151                      
2152                          // preserve message key
2153                          response->setKey(request->getKey());
2154                      
2155                          //  Set HTTP method in response from request
2156                          response->setHttpMethod (request->getHttpMethod ());
2157 schuur          1.4  
2158                          // tell the provider manager to shutdown all the providers
2159 schuur          1.10     providerManager.shutdownAllProviders();
2160 schuur          1.4  
2161                          PEG_METHOD_EXIT();
2162                      
2163                          return(response);
2164                      }
2165                      
2166 kumpf           1.32 Message * CMPIProviderManager::handleInitializeProviderRequest(const Message * message)
2167                      {
2168                          PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "CMPIProviderManager::handleInitializeProviderRequest");
2169                      
2170                          HandlerIntroInit(InitializeProvider,message,request,response,handler);
2171                      
2172                          try
2173                          {
2174                              // resolve provider name
2175                      	ProviderName name = _resolveProviderName(
2176                      	    request->operationContext.get(ProviderIdContainer::NAME));
2177                      
2178                              // get cached or load new provider module
2179                              CMPIProvider::OpProviderHolder ph =
2180 schuur          1.39            providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
2181 kumpf           1.32 
2182                          }
2183                          HandlerCatch(handler);
2184                      
2185                          PEG_METHOD_EXIT();
2186                      
2187                          return(response);
2188                      }
2189                      
2190 carolann.graves 1.57 Message * CMPIProviderManager::handleSubscriptionInitCompleteRequest
2191                          (const Message * message)
2192                      {
2193                          PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
2194                           "CMPIProviderManager::handleSubscriptionInitCompleteRequest");
2195                      
2196                          CIMSubscriptionInitCompleteRequestMessage * request =
2197                              dynamic_cast <CIMSubscriptionInitCompleteRequestMessage *>
2198                                  (const_cast <Message *> (message));
2199                      
2200                          PEGASUS_ASSERT (request != 0);
2201                      
2202                          CIMSubscriptionInitCompleteResponseMessage * response =
2203                              dynamic_cast <CIMSubscriptionInitCompleteResponseMessage *>
2204                                  (request->buildResponse ());
2205                      
2206                          PEGASUS_ASSERT (response != 0);
2207                      
2208                          //
2209                          //  Set indicator
2210                          //
2211 carolann.graves 1.57     _subscriptionInitComplete = true;
2212                      
2213                          //
2214                          //  For each provider that has at least one subscription, call
2215                          //  provider's enableIndications method
2216                          //
2217                          Array <CMPIProvider *> enableProviders;
2218                          enableProviders = providerManager.getIndicationProvidersToEnable ();
2219                      
2220                          Uint32 numProviders = enableProviders.size ();
2221                          for (Uint32 i = 0; i < numProviders; i++)
2222                          {
2223                              try
2224                              {
2225                                  CIMInstance provider;
2226                                  provider = enableProviders [i]->getProviderInstance ();
2227                      
2228                                  //
2229                                  //  Get cached or load new provider module
2230                                  //
2231                                  CMPIProvider::OpProviderHolder ph = providerManager.getProvider
2232 carolann.graves 1.57                 (enableProviders [i]->getModule ()->getFileName (),
2233                                       enableProviders [i]->getName ());
2234                      
2235                                  _callEnableIndications (provider, _indicationCallback, ph);
2236                              }
2237                              catch (CIMException & e)
2238                              {
2239                                  PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2240                                      "CIMException: " + e.getMessage ());
2241                              }
2242                              catch (Exception & e)
2243                              {
2244                                  PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2245                                      "Exception: " + e.getMessage ());
2246                              }
2247                              catch(...)
2248                              {
2249                                  PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2250                                      "Unknown error in handleSubscriptionInitCompleteRequest");
2251                              }
2252                          }
2253 carolann.graves 1.57 
2254                          PEG_METHOD_EXIT ();
2255                          return (response);
2256                      }
2257                      
2258 dj.gorey        1.29 Message * CMPIProviderManager::handleUnsupportedRequest(const Message * message)
2259 schuur          1.4  {
2260 konrad.r        1.46     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
2261                              "CMPIProviderManager::handleUnsupportedRequest");
2262                          CIMRequestMessage* request =
2263                              dynamic_cast<CIMRequestMessage *>(const_cast<Message *>(message));
2264                          PEGASUS_ASSERT(request != 0 );
2265                      
2266                          CIMResponseMessage* response = request->buildResponse();
2267                          response->cimException =
2268                              PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY);
2269 schuur          1.4  
2270                          PEG_METHOD_EXIT();
2271 konrad.r        1.46     return response;
2272 schuur          1.4  }
2273                      
2274 kumpf           1.30 ProviderName CMPIProviderManager::_resolveProviderName(
2275                          const ProviderIdContainer & providerId)
2276 schuur          1.4  {
2277 kumpf           1.30     String providerName;
2278                          String fileName;
2279 schuur          1.39     String location;
2280 kumpf           1.30     CIMValue genericValue;
2281                      
2282                          genericValue = providerId.getProvider().getProperty(
2283                              providerId.getProvider().findProperty("Name")).getValue();
2284                          genericValue.get(providerName);
2285                      
2286                          genericValue = providerId.getModule().getProperty(
2287                              providerId.getModule().findProperty("Location")).getValue();
2288 schuur          1.39     genericValue.get(location);
2289                          fileName = _resolvePhysicalName(location);
2290 dj.gorey        1.29 
2291 schuur          1.39     ProviderName name(providerName, fileName, String::EMPTY, 0);
2292                          name.setLocation(location);
2293                          return name;
2294                      //    return ProviderName(providerName, fileName, interfaceName, 0);
2295 chip            1.1  }
2296                      
2297 carolann.graves 1.57 void CMPIProviderManager::_callEnableIndications
2298                          (CIMInstance & req_provider,
2299                           PEGASUS_INDICATION_CALLBACK _indicationCallback,
2300                           CMPIProvider::OpProviderHolder & ph)
2301                      {
2302                          PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
2303                              "CMPIProviderManager::_callEnableIndications");
2304                      
2305                          try
2306                          {
2307                              indProvRecord *provRec;
2308                              if (provTab.lookup (ph.GetProvider ().getName (), provRec))
2309                              {
2310                                  provRec->enabled = true;
2311                                  CIMRequestMessage * request = 0;
2312                                  CIMResponseMessage * response = 0;
2313                                  provRec->handler=new EnableIndicationsResponseHandler
2314                                      (request, response, req_provider, _indicationCallback);
2315                              }
2316                      
2317                              CMPIProvider & pr=ph.GetProvider();
2318 carolann.graves 1.57 
2319                              //
2320                              //  Versions prior to 86 did not include enableIndications routine
2321                              //
2322                              if (pr.miVector.indMI->ft->ftVersion >= 86)
2323                              {
2324                                  OperationContext context;
2325                                  CMPIStatus rc={CMPI_RC_OK,NULL};
2326                                  CMPI_ContextOnStack eCtx(context);
2327                                  CMPI_ThreadContext thr(&pr.broker,&eCtx);
2328                      
2329                                  PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2330                                      "Calling provider.enableIndications: " + pr.getName());
2331                      
2332                                  DDD(cerr<<"--- provider.enableIndications"<<endl);
2333                      
2334                                  CMPIProvider::pm_service_op_lock op_lock(&pr);
2335                                  ph.GetProvider().protect();
2336                      
2337                                  pr.miVector.indMI->ft->enableIndications(pr.miVector.indMI);
2338                              }
2339 carolann.graves 1.57         else
2340                              {
2341                                  PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2342                                      "Not calling provider.enableIndications: " + pr.getName() +
2343                                      " routine as it is an earlier version that does not support this function");
2344                      
2345                                  DDD(cerr<<"--- provider.enableIndications " \
2346                                      "cannot be called as the provider uses an earlier version " \
2347                                      "that does not support this function"<<endl);
2348                              }
2349                          }
2350                          catch (CIMException & e)
2351                          {
2352                              PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2353                                  "CIMException: " + e.getMessage ());
2354                      
2355                              Logger::put_l (Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
2356                                  "ProviderManager.CMPI.CMPIProviderManager."
2357                                      "ENABLE_INDICATIONS_FAILED",
2358                                  "Failed to enable indications for provider $0: $1.",
2359                                  ph.GetProvider ().getName (), e.getMessage ());
2360 carolann.graves 1.57     }
2361                          catch (Exception & e)
2362                          {
2363                              PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2364                                  "Exception: " + e.getMessage ());
2365                      
2366                              Logger::put_l (Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
2367                                  "ProviderManager.CMPI.CMPIProviderManager."
2368                                      "ENABLE_INDICATIONS_FAILED",
2369                                  "Failed to enable indications for provider $0: $1.",
2370                                  ph.GetProvider ().getName (), e.getMessage ());
2371                          }
2372                          catch(...)
2373                          {
2374                              PEG_TRACE_STRING (TRC_PROVIDERMANAGER, Tracer::LEVEL2,
2375                                  "Unexpected error in _callEnableIndications");
2376                      
2377                              Logger::put_l (Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
2378                                  "ProviderManager.CMPI.CMPIProviderManager."
2379                                      "ENABLE_INDICATIONS_FAILED_UNKNOWN",
2380                                  "Failed to enable indications for provider $0.",
2381 carolann.graves 1.57             ph.GetProvider ().getName ());
2382                          }
2383                      
2384                          PEG_METHOD_EXIT ();
2385                      }
2386                      
2387                      void CMPIProviderManager::_callDisableIndications
2388                          (CMPIProvider::OpProviderHolder & ph)
2389                      {
2390                          PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
2391                              "CMPIProviderManager::_callDisableIndications");
2392                      
2393                          indProvRecord * provRec;
2394                          if (provTab.lookup (ph.GetProvider ().getName (), provRec))
2395                          {
2396                              provRec->enabled = false;
2397                              if (provRec->handler) delete provRec->handler;
2398                              provRec->handler = NULL;
2399                          }
2400                      
2401                          CMPIProvider & pr=ph.GetProvider();
2402 carolann.graves 1.57 
2403                          //
2404                          //  Versions prior to 86 did not include disableIndications routine
2405                          //
2406                          if (pr.miVector.indMI->ft->ftVersion >= 86)
2407                          {
2408                              OperationContext context;
2409                              CMPIStatus rc={CMPI_RC_OK,NULL};
2410                              CMPI_ContextOnStack eCtx(context);
2411                              CMPI_ThreadContext thr(&pr.broker,&eCtx);
2412                      
2413                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2414                                  "Calling provider.disableIndications: " + pr.getName());
2415                      
2416                              DDD(cerr<<"--- provider.disableIndications"<<endl);
2417                      
2418                              CMPIProvider::pm_service_op_lock op_lock(&pr);
2419                      
2420                              pr.miVector.indMI->ft->disableIndications(pr.miVector.indMI);
2421                      
2422                              ph.GetProvider().unprotect();
2423 carolann.graves 1.57     }
2424                          else
2425                          {
2426                              PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2427                                  "Not calling provider.disableIndications: "
2428                                  + pr.getName() +
2429                                  " routine as it is an earlier version that does not support this function");
2430                      
2431                              DDD(cerr<<"--- provider.disableIndications " \
2432                                  "cannot be called as the provider uses an earlier version " \
2433                                  "that does not support this function"<<endl);
2434                      
2435                          }
2436                      
2437                          PEG_METHOD_EXIT ();
2438                      }
2439                      
2440 chip            1.1  PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2