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

   1 karl  1.43 //%2004////////////////////////////////////////////////////////////////////////
   2 chip  1.1  //
   3 karl  1.43 // 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.7  // IBM Corp.; EMC Corporation, The Open Group.
   7 karl  1.43 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   9 chip  1.1  //
  10            // Permission is hereby granted, free of charge, to any person obtaining a copy
  11            // of this software and associated documentation files (the "Software"), to
  12            // deal in the Software without restriction, including without limitation the
  13            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  14            // sell copies of the Software, and to permit persons to whom the Software is
  15            // furnished to do so, subject to the following conditions:
  16 karl  1.43 // 
  17 chip  1.1  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
  18            // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
  19            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
  20            // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  21            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  22            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  23            // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  24            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  25            //
  26            //==============================================================================
  27            //
  28            // Author: Chip Vincent (cvincent@us.ibm.com)
  29            //
  30            // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
  31            //                  (carolann_graves@hp.com)
  32            //              Mike Day, IBM (mdday@us.ibm.com)
  33            //              Karl Schopmeyer(k.schopmeyer@opengroup.org) - Fix associators.
  34 kumpf 1.28 //              Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com)
  35 kumpf 1.31 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
  36 se.gupta 1.33 //				Seema Gupta (gseema@in.ibm.com) for PEP135
  37 w.white  1.35 //				Willis White (whiwill@us.ibm.com)
  38 chip     1.1  //
  39               //%/////////////////////////////////////////////////////////////////////////////
  40               
  41               #include "DefaultProviderManager.h"
  42               
  43               #include <Pegasus/Common/CIMMessage.h>
  44               #include <Pegasus/Common/OperationContext.h>
  45               #include <Pegasus/Common/Destroyer.h>
  46               #include <Pegasus/Common/Tracer.h>
  47               #include <Pegasus/Common/StatisticalData.h>
  48               #include <Pegasus/Common/Logger.h>
  49               #include <Pegasus/Common/MessageLoader.h> //l10n
  50 kumpf    1.38 #include <Pegasus/Common/Constants.h>
  51 chip     1.1  
  52 chuck    1.44 #include <Pegasus/Query/QueryExpression/QueryExpression.h>
  53 schuur   1.12 #include <Pegasus/ProviderManager2/QueryExpressionFactory.h>
  54               
  55 chip     1.1  #include <Pegasus/ProviderManager2/Default/Provider.h>
  56 schuur   1.21 #include <Pegasus/ProviderManager2/OperationResponseHandler.h>
  57 chip     1.1  
  58 schuur   1.14 #include <Pegasus/ProviderManager2/ProviderManagerService.h>
  59 kumpf    1.28 #include <Pegasus/ProviderManager2/ProviderType.h>
  60 chip     1.1  
  61               PEGASUS_NAMESPACE_BEGIN
  62               
  63               // auto variable to protect provider during operations
  64               class pm_service_op_lock
  65               {
  66               private:
  67                   pm_service_op_lock(void);
  68               
  69               public:
  70                   pm_service_op_lock(Provider *provider) : _provider(provider)
  71                   {
  72                       _provider->protect();
  73                   }
  74               
  75                   ~pm_service_op_lock(void)
  76                   {
  77                       _provider->unprotect();
  78                   }
  79               
  80                   Provider * _provider;
  81 chip     1.1  };
  82               
  83               //
  84 kumpf    1.31 // Default Provider Manager
  85               //
  86 chip     1.1  DefaultProviderManager::DefaultProviderManager(void)
  87               {
  88               }
  89               
  90               DefaultProviderManager::~DefaultProviderManager(void)
  91               {
  92               }
  93               
  94 dj.gorey 1.25 Message * DefaultProviderManager::processMessage(Message * request)
  95 chip     1.1  {
  96                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
  97                       "DefaultProviderManager::processMessage()");
  98               
  99                   Message * response = 0;
 100               
 101                   // pass the request message to a handler method based on message type
 102                   switch(request->getType())
 103                   {
 104                   case CIM_GET_INSTANCE_REQUEST_MESSAGE:
 105 dj.gorey 1.25         response = handleGetInstanceRequest(request);
 106 chip     1.1  
 107                       break;
 108                   case CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE:
 109 dj.gorey 1.25         response = handleEnumerateInstancesRequest(request);
 110 chip     1.1  
 111                       break;
 112                   case CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE:
 113 dj.gorey 1.25         response = handleEnumerateInstanceNamesRequest(request);
 114 chip     1.1  
 115                       break;
 116                   case CIM_CREATE_INSTANCE_REQUEST_MESSAGE:
 117 dj.gorey 1.25         response = handleCreateInstanceRequest(request);
 118 chip     1.1  
 119                       break;
 120                   case CIM_MODIFY_INSTANCE_REQUEST_MESSAGE:
 121 dj.gorey 1.25         response = handleModifyInstanceRequest(request);
 122 chip     1.1  
 123                       break;
 124                   case CIM_DELETE_INSTANCE_REQUEST_MESSAGE:
 125 dj.gorey 1.25         response = handleDeleteInstanceRequest(request);
 126 chip     1.1  
 127                       break;
 128                   case CIM_EXEC_QUERY_REQUEST_MESSAGE:
 129 dj.gorey 1.25         response = handleExecQueryRequest(request);
 130 chip     1.1  
 131                       break;
 132                   case CIM_ASSOCIATORS_REQUEST_MESSAGE:
 133 dj.gorey 1.25         response = handleAssociatorsRequest(request);
 134 chip     1.1  
 135                       break;
 136                   case CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE:
 137 dj.gorey 1.25         response = handleAssociatorNamesRequest(request);
 138 chip     1.1  
 139                       break;
 140                   case CIM_REFERENCES_REQUEST_MESSAGE:
 141 dj.gorey 1.25         response = handleReferencesRequest(request);
 142 chip     1.1  
 143                       break;
 144                   case CIM_REFERENCE_NAMES_REQUEST_MESSAGE:
 145 dj.gorey 1.25         response = handleReferenceNamesRequest(request);
 146 chip     1.1  
 147                       break;
 148                   case CIM_GET_PROPERTY_REQUEST_MESSAGE:
 149 dj.gorey 1.25         response = handleGetPropertyRequest(request);
 150 chip     1.1  
 151                       break;
 152                   case CIM_SET_PROPERTY_REQUEST_MESSAGE:
 153 dj.gorey 1.25         response = handleSetPropertyRequest(request);
 154 chip     1.1  
 155                       break;
 156                   case CIM_INVOKE_METHOD_REQUEST_MESSAGE:
 157 dj.gorey 1.25         response = handleInvokeMethodRequest(request);
 158 chip     1.1  
 159                       break;
 160                   case CIM_CREATE_SUBSCRIPTION_REQUEST_MESSAGE:
 161 dj.gorey 1.25         response = handleCreateSubscriptionRequest(request);
 162 chip     1.1  
 163                       break;
 164                   case CIM_MODIFY_SUBSCRIPTION_REQUEST_MESSAGE:
 165 dj.gorey 1.25         response = handleModifySubscriptionRequest(request);
 166 chip     1.1  
 167                       break;
 168                   case CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE:
 169 dj.gorey 1.25         response = handleDeleteSubscriptionRequest(request);
 170 chip     1.1  
 171                       break;
 172                   case CIM_ENABLE_INDICATIONS_REQUEST_MESSAGE:
 173 dj.gorey 1.25         response = handleEnableIndicationsRequest(request);
 174 chip     1.1  
 175                       break;
 176                   case CIM_DISABLE_INDICATIONS_REQUEST_MESSAGE:
 177 dj.gorey 1.25         response = handleDisableIndicationsRequest(request);
 178 chip     1.1  
 179                       break;
 180 schuur   1.14     case CIM_EXPORT_INDICATION_REQUEST_MESSAGE:
 181 dj.gorey 1.25         response = handleExportIndicationRequest(request);
 182 schuur   1.14         break;
 183               
 184 chip     1.1      case CIM_DISABLE_MODULE_REQUEST_MESSAGE:
 185 dj.gorey 1.25         response = handleDisableModuleRequest(request);
 186 chip     1.1  
 187                       break;
 188                   case CIM_ENABLE_MODULE_REQUEST_MESSAGE:
 189 dj.gorey 1.25         response = handleEnableModuleRequest(request);
 190 chip     1.1  
 191                       break;
 192                   case CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE:
 193 dj.gorey 1.25         response = handleStopAllProvidersRequest(request);
 194 chip     1.1  
 195                       break;
 196 kumpf    1.30     case CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE:
 197               	response = handleInitializeProviderRequest(request);
 198               
 199               	break;
 200 chip     1.1      default:
 201 dj.gorey 1.25         response = handleUnsupportedRequest(request);
 202 chip     1.1  
 203                       break;
 204                   }
 205               
 206                   PEG_METHOD_EXIT();
 207               
 208                   return(response);
 209               }
 210               
 211 dj.gorey 1.25 Message * DefaultProviderManager::handleUnsupportedRequest(const Message * message)
 212 chip     1.1  {
 213                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleUnsupportedRequest");
 214               
 215                   PEG_METHOD_EXIT();
 216               
 217                   // a null response implies unsupported or unknown operation
 218                   return(0);
 219               }
 220               
 221 kumpf    1.30 Message * DefaultProviderManager::handleInitializeProviderRequest(
 222                   const Message * message)
 223               {
 224                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, 
 225               	"DefaultProviderManager::handleInitializeProviderRequest");
 226               
 227                   CIMInitializeProviderRequestMessage * request =
 228                       dynamic_cast<CIMInitializeProviderRequestMessage *>
 229               	    (const_cast<Message *>(message));
 230               
 231                   PEGASUS_ASSERT(request != 0);
 232               
 233                   CIMInitializeProviderResponseMessage * response =
 234                       new CIMInitializeProviderResponseMessage(
 235                       request->messageId,
 236                       CIMException(),
 237                       request->queueIds.copyAndPop());
 238               
 239                   // preserve message key
 240                   response->setKey(request->getKey());
 241               
 242 kumpf    1.30     //  Set HTTP method in response from request
 243                   response->setHttpMethod(request->getHttpMethod());
 244               
 245                   OperationResponseHandler handler(request, response);
 246               
 247                   try
 248                   {
 249                       // resolve provider name
 250               	ProviderName name = _resolveProviderName(
 251               	    request->operationContext.get(ProviderIdContainer::NAME));
 252               
 253                       // get cached or load new provider module
 254                       OpProviderHolder ph =
 255                           providerManager.getProvider(name.getPhysicalName(), 
 256               		name.getLogicalName(), String::EMPTY);
 257               
 258                   }
 259                   catch(CIMException & e)
 260                   {
 261                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL3,
 262                           "CIMException: " + e.getMessage());
 263 kumpf    1.30 
 264                       handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage());
 265                   }
 266                   catch(Exception & e)
 267                   {
 268                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL3,
 269                           "Exception: " + e.getMessage());
 270               
 271                       handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage());
 272                   }
 273                   catch(...)
 274                   {
 275                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL3,
 276                           "Exception: Unknown");
 277               
 278                       handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
 279                   }
 280               
 281                   PEG_METHOD_EXIT();
 282               
 283                   return(response);
 284 kumpf    1.30 }
 285               
 286 dj.gorey 1.25 Message * DefaultProviderManager::handleGetInstanceRequest(const Message * message)
 287 chip     1.1  {
 288                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleGetInstanceRequest");
 289               
 290                   CIMGetInstanceRequestMessage * request =
 291                       dynamic_cast<CIMGetInstanceRequestMessage *>(const_cast<Message *>(message));
 292               
 293                   PEGASUS_ASSERT(request != 0);
 294               
 295                   CIMGetInstanceResponseMessage * response =
 296                       new CIMGetInstanceResponseMessage(
 297                       request->messageId,
 298                       CIMException(),
 299                       request->queueIds.copyAndPop(),
 300                       CIMInstance());
 301               
 302                   PEGASUS_ASSERT(response != 0);
 303               
 304                   // preserve message key
 305                   response->setKey(request->getKey());
 306               
 307                   //  Set HTTP method in response from request
 308 chip     1.1      response->setHttpMethod(request->getHttpMethod());
 309               
 310                   // create a handler for this request
 311                   GetInstanceResponseHandler handler(request, response);
 312               
 313                   try
 314                   {
 315                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 316                           "DefaultProviderManager::handleGetInstanceRequest - Host name: $0  Name space: $1  Class name: $2",
 317                           System::getHostName(),
 318                           request->nameSpace.getString(),
 319                           request->instanceName.getClassName().getString());
 320               
 321                       // make target object path
 322                       CIMObjectPath objectPath(
 323                           System::getHostName(),
 324                           request->nameSpace,
 325                           request->instanceName.getClassName(),
 326                           request->instanceName.getKeyBindings());
 327               
 328 chip     1.5          // resolve provider name
 329 kumpf    1.28         ProviderName name = _resolveProviderName(
 330                           request->operationContext.get(ProviderIdContainer::NAME));
 331 chip     1.1  
 332                       // get cached or load new provider module
 333                       OpProviderHolder ph =
 334 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
 335 chip     1.1  
 336                       // convert arguments
 337                       OperationContext context;
 338               
 339 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
 340               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 341               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 342 chip     1.1  
 343                       CIMPropertyList propertyList(request->propertyList);
 344               
 345                       // forward request
 346                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 347                           "Calling provider.getInstance: " +
 348                           ph.GetProvider().getName());
 349               
 350                       pm_service_op_lock op_lock(&ph.GetProvider());
 351               
 352                       STAT_GETSTARTTIME;
 353               
 354                       ph.GetProvider().getInstance(
 355                           context,
 356                           objectPath,
 357                           request->includeQualifiers,
 358                           request->includeClassOrigin,
 359                           propertyList,
 360                           handler);
 361               
 362                       STAT_PMS_PROVIDEREND;
 363 chip     1.1      }
 364                   catch(CIMException & e)
 365                   {
 366                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 367                           "Exception: " + e.getMessage());
 368               
 369                       handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
 370                   }
 371                   catch(Exception & e)
 372                   {
 373                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 374                           "Exception: " + e.getMessage());
 375 chip     1.2  
 376 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
 377                   }
 378                   catch(...)
 379                   {
 380                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 381                           "Exception: Unknown");
 382 chip     1.2  
 383 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
 384                   }
 385               
 386                   PEG_METHOD_EXIT();
 387               
 388                   return(response);
 389               }
 390               
 391 dj.gorey 1.25 Message * DefaultProviderManager::handleEnumerateInstancesRequest(const Message * message)
 392 chip     1.1  {
 393                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleEnumerateInstanceRequest");
 394               
 395                   CIMEnumerateInstancesRequestMessage * request =
 396                       dynamic_cast<CIMEnumerateInstancesRequestMessage *>(const_cast<Message *>(message));
 397               
 398                   PEGASUS_ASSERT(request != 0);
 399               
 400                   CIMEnumerateInstancesResponseMessage * response =
 401                       new CIMEnumerateInstancesResponseMessage(
 402                       request->messageId,
 403                       CIMException(),
 404                       request->queueIds.copyAndPop(),
 405                       Array<CIMInstance>());
 406               
 407                   PEGASUS_ASSERT(response != 0);
 408               
 409                   // preserve message key
 410                   response->setKey(request->getKey());
 411               
 412                   //  Set HTTP method in response from request
 413 chip     1.1      response->setHttpMethod (request->getHttpMethod ());
 414               
 415                   // create a handler for this request
 416                   EnumerateInstancesResponseHandler handler(request, response);
 417               
 418                   try
 419                   {
 420                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 421                           "DefaultProviderManager::handleEnumerateInstancesRequest - Host name: $0  Name space: $1  Class name: $2",
 422                           System::getHostName(),
 423                           request->nameSpace.getString(),
 424                           request->className.getString());
 425               
 426                       // make target object path
 427                       CIMObjectPath objectPath(
 428                           System::getHostName(),
 429                           request->nameSpace,
 430                           request->className);
 431               
 432 chip     1.5          // resolve provider name
 433 kumpf    1.28         ProviderName name = _resolveProviderName(
 434                           request->operationContext.get(ProviderIdContainer::NAME));
 435 chip     1.1  
 436                       // get cached or load new provider module
 437 schuur   1.12         OpProviderHolder ph = providerManager.getProvider(name.getPhysicalName(),
 438 dj.gorey 1.25                 name.getLogicalName(), String::EMPTY);
 439 chip     1.1  
 440                       // convert arguments
 441                       OperationContext context;
 442               
 443 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
 444               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 445               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 446 chip     1.1  
 447                       CIMPropertyList propertyList(request->propertyList);
 448               
 449                       // forward request
 450                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 451                           "Calling provider.enumerateInstances: " +
 452                           ph.GetProvider().getName());
 453               
 454                       pm_service_op_lock op_lock(&ph.GetProvider());
 455               
 456                       STAT_GETSTARTTIME;
 457               
 458                       ph.GetProvider().enumerateInstances(
 459                           context,
 460                           objectPath,
 461                           request->includeQualifiers,
 462                           request->includeClassOrigin,
 463                           propertyList,
 464                           handler);
 465               
 466                       STAT_PMS_PROVIDEREND;
 467 chip     1.1      }
 468                   catch(CIMException & e)
 469                   {
 470                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 471                           "Exception: " + e.getMessage());
 472 chip     1.2  
 473 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
 474                   }
 475                   catch(Exception & e)
 476                   {
 477                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 478                           "Exception: " + e.getMessage());
 479 chip     1.2  
 480 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
 481                   }
 482                   catch(...)
 483                   {
 484                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 485                           "Exception: Unknown");
 486 chip     1.2  
 487 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
 488                   }
 489               
 490                   PEG_METHOD_EXIT();
 491               
 492                   return(response);
 493               }
 494               
 495 dj.gorey 1.25 Message * DefaultProviderManager::handleEnumerateInstanceNamesRequest(const Message * message)
 496 chip     1.1  {
 497                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleEnumerateInstanceNamesRequest");
 498               
 499                   CIMEnumerateInstanceNamesRequestMessage * request =
 500                       dynamic_cast<CIMEnumerateInstanceNamesRequestMessage *>(const_cast<Message *>(message));
 501               
 502                   PEGASUS_ASSERT(request != 0);
 503               
 504                   CIMEnumerateInstanceNamesResponseMessage * response =
 505                       new CIMEnumerateInstanceNamesResponseMessage(
 506                       request->messageId,
 507                       CIMException(),
 508                       request->queueIds.copyAndPop(),
 509                       Array<CIMObjectPath>());
 510               
 511                   PEGASUS_ASSERT(response != 0);
 512               
 513                   // preserve message key
 514                   response->setKey(request->getKey());
 515               
 516                   //set HTTP method in response from request
 517 chip     1.1      response->setHttpMethod(request->getHttpMethod());;
 518               
 519                   // create a handler for this request
 520                   EnumerateInstanceNamesResponseHandler handler(request, response);
 521               
 522                   // process the request
 523                   try
 524                   {
 525                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 526                           "DefaultProviderManager::handleEnumerateInstanceNamesRequest - Host name: $0  Name space: $1  Class name: $2",
 527                           System::getHostName(),
 528                           request->nameSpace.getString(),
 529                           request->className.getString());
 530               
 531                       // make target object path
 532                       CIMObjectPath objectPath(
 533                           System::getHostName(),
 534                           request->nameSpace,
 535                           request->className);
 536               
 537 chip     1.5          // resolve provider name
 538 kumpf    1.28         ProviderName name = _resolveProviderName(
 539                           request->operationContext.get(ProviderIdContainer::NAME));
 540 chip     1.1  
 541                       // get cached or load new provider module
 542                       OpProviderHolder ph =
 543 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName());
 544 chip     1.1  
 545                       // convert arguments
 546                       OperationContext context;
 547               
 548 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
 549               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 550               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 551               
 552 chip     1.1          // forward request
 553                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 554                           "Calling provider.enumerateInstanceNames: " +
 555                           ph.GetProvider().getName());
 556               
 557                       pm_service_op_lock op_lock(&ph.GetProvider());
 558               
 559                       STAT_GETSTARTTIME;
 560               
 561                       ph.GetProvider().enumerateInstanceNames(
 562                           context,
 563                           objectPath,
 564                           handler);
 565               
 566                       STAT_PMS_PROVIDEREND;
 567                   }
 568                   catch(CIMException & e)
 569                   {
 570                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 571                           "Exception: " + e.getMessage());
 572 chip     1.2  
 573 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
 574                   }
 575                   catch(Exception & e)
 576                   {
 577                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 578                           "Exception: " + e.getMessage());
 579 chip     1.2  
 580 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
 581                   }
 582                   catch(...)
 583                   {
 584                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 585                           "Exception: Unknown");
 586 chip     1.2  
 587 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
 588                   }
 589               
 590                   PEG_METHOD_EXIT();
 591               
 592                   return(response);
 593               }
 594               
 595 dj.gorey 1.25 Message * DefaultProviderManager::handleCreateInstanceRequest(const Message * message)
 596 chip     1.1  {
 597                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleCreateInstanceRequest");
 598               
 599                   CIMCreateInstanceRequestMessage * request =
 600                       dynamic_cast<CIMCreateInstanceRequestMessage *>(const_cast<Message *>(message));
 601               
 602                   PEGASUS_ASSERT(request != 0);
 603               
 604                   // create response message
 605                   CIMCreateInstanceResponseMessage * response =
 606                       new CIMCreateInstanceResponseMessage(
 607                       request->messageId,
 608                       CIMException(),
 609                       request->queueIds.copyAndPop(),
 610                       CIMObjectPath());
 611               
 612                   PEGASUS_ASSERT(response != 0);
 613               
 614                   // preserve message key
 615                   response->setKey(request->getKey());
 616               
 617 chip     1.1      //  Set HTTP method in response from request
 618                   response->setHttpMethod (request->getHttpMethod ());
 619               
 620                   // create a handler for this request
 621                   CreateInstanceResponseHandler handler(request, response);
 622               
 623                   try
 624                   {
 625                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 626                           "DefaultProviderManager::handleCreateInstanceRequest - Host name: $0  Name space: $1  Class name: $2",
 627                           System::getHostName(),
 628                           request->nameSpace.getString(),
 629                           request->newInstance.getPath().getClassName().getString());
 630               
 631                       // make target object path
 632                       CIMObjectPath objectPath(
 633                           System::getHostName(),
 634                           request->nameSpace,
 635                           request->newInstance.getPath().getClassName(),
 636                           request->newInstance.getPath().getKeyBindings());
 637               
 638 chip     1.5          // resolve provider name
 639 kumpf    1.28         ProviderName name = _resolveProviderName(
 640                           request->operationContext.get(ProviderIdContainer::NAME));
 641 chip     1.1  
 642                       // get cached or load new provider module
 643                       OpProviderHolder ph =
 644 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
 645 chip     1.1  
 646                       // convert arguments
 647                       OperationContext context;
 648               
 649 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
 650               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 651               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 652 chip     1.1  
 653                       // forward request
 654                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 655                           "Calling provider.createInstance: " +
 656                           ph.GetProvider().getName());
 657               
 658                       pm_service_op_lock op_lock(&ph.GetProvider());
 659               
 660                       STAT_GETSTARTTIME;
 661               
 662                       ph.GetProvider().createInstance(
 663                           context,
 664                           objectPath,
 665                           request->newInstance,
 666                           handler);
 667               
 668                       STAT_PMS_PROVIDEREND;
 669                   }
 670                   catch(CIMException & e)
 671                   {
 672                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 673 chip     1.1              "Exception: " + e.getMessage());
 674 chip     1.2  
 675 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
 676                   }
 677                   catch(Exception & e)
 678                   {
 679                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 680                           "Exception: " + e.getMessage());
 681 chip     1.2  
 682 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
 683                   }
 684                   catch(...)
 685                   {
 686                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 687                           "Exception: Unknown");
 688 chip     1.2  
 689 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
 690                   }
 691               
 692                   PEG_METHOD_EXIT();
 693               
 694                   return(response);
 695               }
 696               
 697 dj.gorey 1.25 Message * DefaultProviderManager::handleModifyInstanceRequest(const Message * message)
 698 chip     1.1  {
 699                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleModifyInstanceRequest");
 700               
 701                   CIMModifyInstanceRequestMessage * request =
 702                       dynamic_cast<CIMModifyInstanceRequestMessage *>(const_cast<Message *>(message));
 703               
 704                   PEGASUS_ASSERT(request != 0);
 705               
 706                   // create response message
 707                   CIMModifyInstanceResponseMessage * response =
 708                       new CIMModifyInstanceResponseMessage(
 709                       request->messageId,
 710                       CIMException(),
 711                       request->queueIds.copyAndPop());
 712               
 713                   PEGASUS_ASSERT(response != 0);
 714               
 715                   // preserve message key
 716                   response->setKey(request->getKey());
 717               
 718                   //  Set HTTP method in response from request
 719 chip     1.1      response->setHttpMethod (request->getHttpMethod ());
 720               
 721                   // create a handler for this request
 722                   ModifyInstanceResponseHandler handler(request, response);
 723               
 724                   try
 725                   {
 726                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 727                           "DefaultProviderManager::handleModifyInstanceRequest - Host name: $0  Name space: $1  Class name: $2",
 728                           System::getHostName(),
 729                           request->nameSpace.getString(),
 730                           request->modifiedInstance.getPath().getClassName().getString());
 731               
 732                       // make target object path
 733                       CIMObjectPath objectPath(
 734                           System::getHostName(),
 735                           request->nameSpace,
 736                           request->modifiedInstance.getPath ().getClassName(),
 737                           request->modifiedInstance.getPath ().getKeyBindings());
 738               
 739 chip     1.5          // resolve provider name
 740 kumpf    1.28         ProviderName name = _resolveProviderName(
 741                           request->operationContext.get(ProviderIdContainer::NAME));
 742 chip     1.1  
 743                       // get cached or load new provider module
 744                       OpProviderHolder ph =
 745 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
 746 chip     1.1  
 747                       // convert arguments
 748                       OperationContext context;
 749               
 750 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
 751               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 752               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 753 chip     1.1  
 754                       CIMPropertyList propertyList(request->propertyList);
 755               
 756                       // forward request
 757                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 758                           "Calling provider.modifyInstance: " +
 759                           ph.GetProvider().getName());
 760               
 761                       pm_service_op_lock op_lock(&ph.GetProvider());
 762               
 763                       STAT_GETSTARTTIME;
 764               
 765                       ph.GetProvider().modifyInstance(
 766                           context,
 767                           objectPath,
 768                           request->modifiedInstance,
 769                           request->includeQualifiers,
 770                           propertyList,
 771                           handler);
 772               
 773                       STAT_PMS_PROVIDEREND;
 774 chip     1.1      }
 775                   catch(CIMException & e)
 776                   {
 777                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 778                           "Exception: " + e.getMessage());
 779 chip     1.2  
 780 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
 781                   }
 782                   catch(Exception & e)
 783                   {
 784                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 785                           "Exception: " + e.getMessage());
 786 chip     1.2  
 787 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
 788                   }
 789                   catch(...)
 790                   {
 791                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 792                           "Exception: Unknown");
 793 chip     1.2  
 794 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
 795                   }
 796               
 797                   PEG_METHOD_EXIT();
 798               
 799                   return(response);
 800               }
 801               
 802 dj.gorey 1.25 Message * DefaultProviderManager::handleDeleteInstanceRequest(const Message * message)
 803 chip     1.1  {
 804                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleDeleteInstanceRequest");
 805               
 806                   CIMDeleteInstanceRequestMessage * request =
 807                       dynamic_cast<CIMDeleteInstanceRequestMessage *>(const_cast<Message *>(message));
 808               
 809                   PEGASUS_ASSERT(request != 0);
 810               
 811                   // create response message
 812                   CIMDeleteInstanceResponseMessage * response =
 813                       new CIMDeleteInstanceResponseMessage(
 814                       request->messageId,
 815                       CIMException(),
 816                       request->queueIds.copyAndPop());
 817               
 818                   PEGASUS_ASSERT(response != 0);
 819               
 820                   // preserve message key
 821                   response->setKey(request->getKey());
 822               
 823                   //  Set HTTP method in response from request
 824 chip     1.1      response->setHttpMethod (request->getHttpMethod ());
 825               
 826                   // create a handler for this request
 827                   DeleteInstanceResponseHandler handler(request, response);
 828               
 829                   try
 830                   {
 831                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 832                           "DefaultProviderManager::handleDeleteInstanceRequest - Host name: $0  Name space: $1  Class name: $2",
 833                           System::getHostName(),
 834                           request->nameSpace.getString(),
 835                           request->instanceName.getClassName().getString());
 836               
 837                       // make target object path
 838                       CIMObjectPath objectPath(
 839                           System::getHostName(),
 840                           request->nameSpace,
 841                           request->instanceName.getClassName(),
 842                           request->instanceName.getKeyBindings());
 843               
 844 chip     1.5          // resolve provider name
 845 kumpf    1.28         ProviderName name = _resolveProviderName(
 846                           request->operationContext.get(ProviderIdContainer::NAME));
 847 chip     1.1  
 848                       // get cached or load new provider module
 849                       OpProviderHolder ph =
 850 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
 851 chip     1.1  
 852                       // convert arguments
 853                       OperationContext context;
 854               
 855 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
 856               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 857               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 858 chip     1.1  
 859                       // forward request
 860                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 861                           "Calling provider.deleteInstance: " +
 862                           ph.GetProvider().getName());
 863               
 864                       pm_service_op_lock op_lock(&ph.GetProvider());
 865               
 866                       STAT_GETSTARTTIME;
 867               
 868                       ph.GetProvider().deleteInstance(
 869                           context,
 870                           objectPath,
 871                           handler);
 872               
 873                       STAT_PMS_PROVIDEREND;
 874                   }
 875                   catch(CIMException & e)
 876                   {
 877                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 878                           "Exception: " + e.getMessage());
 879 chip     1.2  
 880 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
 881                   }
 882                   catch(Exception & e)
 883                   {
 884                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 885                           "Exception: " + e.getMessage());
 886 chip     1.2  
 887 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
 888                   }
 889                   catch(...)
 890                   {
 891                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 892                           "Exception: Unknown");
 893 chip     1.2  
 894 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
 895                   }
 896               
 897                   PEG_METHOD_EXIT();
 898               
 899                   return(response);
 900               }
 901               
 902 dj.gorey 1.25 Message * DefaultProviderManager::handleExecQueryRequest(const Message * message)
 903 chip     1.1  {
 904 schuur   1.12     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleExecQueryRequest");
 905 chip     1.1  
 906                   CIMExecQueryRequestMessage * request =
 907                       dynamic_cast<CIMExecQueryRequestMessage *>(const_cast<Message *>(message));
 908               
 909                   PEGASUS_ASSERT(request != 0);
 910               
 911                   CIMExecQueryResponseMessage * response =
 912                       new CIMExecQueryResponseMessage(
 913                       request->messageId,
 914 schuur   1.12         CIMException(),
 915 chip     1.1          request->queueIds.copyAndPop(),
 916                       Array<CIMObject>());
 917               
 918                   PEGASUS_ASSERT(response != 0);
 919               
 920                   // preserve message key
 921                   response->setKey(request->getKey());
 922               
 923                   //  Set HTTP method in response from request
 924 schuur   1.12     response->setHttpMethod (request->getHttpMethod ());
 925               
 926                   // create a handler for this request
 927                   ExecQueryResponseHandler handler(request, response);
 928               
 929                   try
 930                   {
 931                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 932                           "DefaultProviderManager::handleExecQueryRequest - Host name: $0  Name space: $1  Class name: $2",
 933                           System::getHostName(),
 934                           request->nameSpace.getString(),
 935                           request->className.getString());
 936               
 937                       // make target object path
 938                       CIMObjectPath objectPath(
 939                           System::getHostName(),
 940                           request->nameSpace,
 941                           request->className);
 942               
 943                       // resolve provider name
 944 kumpf    1.28         ProviderName name = _resolveProviderName(
 945                           request->operationContext.get(ProviderIdContainer::NAME));
 946 schuur   1.12 
 947                       // get cached or load new provider module
 948                       OpProviderHolder ph =
 949                           providerManager.getProvider(name.getPhysicalName(),
 950 dj.gorey 1.25                                         name.getLogicalName(), String::EMPTY);
 951 schuur   1.12 
 952                       if (dynamic_cast<CIMInstanceQueryProvider*>(ph.GetCIMProvider()) == 0) {
 953                          String errorString = " instance provider is registered supporting execQuery "
 954 dj.gorey 1.25                                 "but is not a CIMQueryInstanceProvider subclass.";
 955 schuur   1.12            throw CIMException(CIM_ERR_FAILED,"ProviderLoadFailure (" + name.getPhysicalName() + ":" +
 956 dj.gorey 1.25                             name.getLogicalName() + "):" + errorString);
 957 schuur   1.12         }
 958               
 959                       // convert arguments
 960                       OperationContext context;
 961               
 962 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
 963               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 964               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 965 schuur   1.12 
 966 chuck    1.44         QueryExpression qx(request->queryLanguage,request->query);
 967 schuur   1.12 
 968                       // forward request
 969                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 970                           "Calling provider.executeQueryRequest: " +
 971                           ph.GetProvider().getName());
 972               
 973                       pm_service_op_lock op_lock(&ph.GetProvider());
 974               
 975                       STAT_GETSTARTTIME;
 976               
 977                       ph.GetProvider().execQuery(
 978                           context,
 979                           objectPath,
 980                           qx,
 981                           handler);
 982               
 983                       STAT_PMS_PROVIDEREND;
 984                   }
 985                   catch(CIMException & e)
 986                   {
 987                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 988 schuur   1.12             "Exception: " + e.getMessage());
 989               
 990                       handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
 991                   }
 992                   catch(Exception & e)
 993                   {
 994                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
 995                           "Exception: " + e.getMessage());
 996               
 997                       handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
 998                   }
 999                   catch(...)
1000                   {
1001                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1002                           "Exception: Unknown");
1003 chip     1.1  
1004 schuur   1.12         handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
1005                   }
1006 chip     1.1  
1007                   PEG_METHOD_EXIT();
1008               
1009                   return(response);
1010               }
1011               
1012 dj.gorey 1.25 Message * DefaultProviderManager::handleAssociatorsRequest(const Message * message)
1013 chip     1.1  {
1014                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleAssociatorsRequest");
1015               
1016                   CIMAssociatorsRequestMessage * request =
1017                       dynamic_cast<CIMAssociatorsRequestMessage *>(const_cast<Message *>(message));
1018               
1019                   PEGASUS_ASSERT(request != 0);
1020               
1021                   CIMAssociatorsResponseMessage * response =
1022                       new CIMAssociatorsResponseMessage(
1023                       request->messageId,
1024                       CIMException(),
1025                       request->queueIds.copyAndPop(),
1026                       Array<CIMObject>());
1027               
1028                   PEGASUS_ASSERT(response != 0);
1029               
1030                   // preserve message key
1031                   response->setKey(request->getKey());
1032               
1033                   // create a handler for this request
1034 chip     1.1      AssociatorsResponseHandler handler(request, response);
1035               
1036                   // process the request
1037                   try
1038                   {
1039                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1040                           "DefaultProviderManager::handleAssociatorsRequest - Host name: $0  Name space: $1  Class name: $2",
1041                           System::getHostName(),
1042                           request->nameSpace.getString(),
1043                           request->objectName.getClassName().getString());
1044               
1045                       // make target object path
1046                       CIMObjectPath objectPath(
1047                           System::getHostName(),
1048                           request->nameSpace,
1049                           request->objectName.getClassName());
1050               
1051                       objectPath.setKeyBindings(request->objectName.getKeyBindings());
1052               
1053 schuur   1.19         CIMObjectPath assocPath(
1054                           System::getHostName(),
1055                           request->nameSpace,
1056                           request->assocClass.getString());
1057               
1058 chip     1.5          // resolve provider name
1059 kumpf    1.28         ProviderName name = _resolveProviderName(
1060                           request->operationContext.get(ProviderIdContainer::NAME));
1061 chip     1.2  
1062                       // get cached or load new provider module
1063                       OpProviderHolder ph =
1064 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
1065 chip     1.2  
1066                       // convert arguments
1067                       OperationContext context;
1068               
1069 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
1070               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
1071               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
1072               
1073 w.white  1.35         STAT_GETSTARTTIME;
1074 chip     1.2          pm_service_op_lock op_lock(&ph.GetProvider());
1075 chip     1.1  
1076 chip     1.2          ph.GetProvider().associators(
1077                           context,
1078                           objectPath,
1079                           request->assocClass,
1080                           request->resultClass,
1081                           request->role,
1082                           request->resultRole,
1083                           request->includeQualifiers,
1084                           request->includeClassOrigin,
1085 a.dunfey 1.39             request->propertyList,
1086 chip     1.2              handler);
1087 chip     1.1  
1088 chip     1.2          STAT_PMS_PROVIDEREND;
1089 chip     1.1      }
1090                   catch(CIMException & e)
1091                   {
1092                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1093                           "Exception: " + e.getMessage());
1094 chip     1.2  
1095 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
1096                   }
1097                   catch(Exception & e)
1098                   {
1099                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1100                           "Exception: " + e.getMessage());
1101 chip     1.2  
1102 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
1103                   }
1104                   catch(...)
1105                   {
1106                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1107                           "Exception: Unknown");
1108 chip     1.2  
1109 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
1110                   }
1111               
1112                   PEG_METHOD_EXIT();
1113               
1114                   return(response);
1115               }
1116               
1117 dj.gorey 1.25 Message * DefaultProviderManager::handleAssociatorNamesRequest(const Message * message)
1118 chip     1.1  {
1119                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleAssociatorNamesRequest");
1120               
1121                   CIMAssociatorNamesRequestMessage * request =
1122                       dynamic_cast<CIMAssociatorNamesRequestMessage *>(const_cast<Message *>(message));
1123               
1124                   PEGASUS_ASSERT(request != 0);
1125               
1126                   CIMAssociatorNamesResponseMessage * response =
1127                       new CIMAssociatorNamesResponseMessage(
1128                       request->messageId,
1129                       CIMException(),
1130                       request->queueIds.copyAndPop(),
1131                       Array<CIMObjectPath>());
1132               
1133                   PEGASUS_ASSERT(response != 0);
1134               
1135                   // preserve message key
1136                   response->setKey(request->getKey());
1137               
1138                   //  Set HTTP method in response from request
1139 chip     1.1      response->setHttpMethod(request->getHttpMethod());
1140               
1141                   // create a handler for this request
1142                   AssociatorNamesResponseHandler handler(request, response);
1143               
1144                   // process the request
1145                   try
1146                   {
1147                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1148                           "DefaultProviderManager::handleAssociationNamesRequest - Host name: $0  Name space: $1  Class name: $2",
1149                           System::getHostName(),
1150                           request->nameSpace.getString(),
1151                           request->objectName.getClassName().getString());
1152               
1153                       // make target object path
1154                       CIMObjectPath objectPath(
1155                           System::getHostName(),
1156                           request->nameSpace,
1157                           request->objectName.getClassName());
1158               
1159                       objectPath.setKeyBindings(request->objectName.getKeyBindings());
1160 chip     1.1  
1161 schuur   1.19         CIMObjectPath assocPath(
1162                           System::getHostName(),
1163                           request->nameSpace,
1164                           request->assocClass.getString());
1165               
1166 chip     1.5          // resolve provider name
1167 kumpf    1.28         ProviderName name = _resolveProviderName(
1168                           request->operationContext.get(ProviderIdContainer::NAME));
1169 chip     1.2  
1170                       // get cached or load new provider module
1171                       OpProviderHolder ph =
1172 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
1173 chip     1.2  
1174                       // convert arguments
1175                       OperationContext context;
1176 chip     1.1  
1177 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
1178               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
1179               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
1180 chip     1.1  
1181 w.white  1.35 		STAT_GETSTARTTIME;
1182 chip     1.2          pm_service_op_lock op_lock(&ph.GetProvider());
1183 chip     1.1  
1184 chip     1.2          ph.GetProvider().associatorNames(
1185                           context,
1186                           objectPath,
1187                           request->assocClass,
1188                           request->resultClass,
1189                           request->role,
1190                           request->resultRole,
1191                           handler);
1192 chip     1.1  
1193 chip     1.2          STAT_PMS_PROVIDEREND;
1194 chip     1.1      }
1195                   catch(CIMException & e)
1196                   {
1197 chip     1.2          PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1198                           "Exception: " + e.getMessage());
1199               
1200 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
1201                   }
1202                   catch(Exception & e)
1203                   {
1204 chip     1.2          PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1205                           "Exception: " + e.getMessage());
1206               
1207 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
1208                   }
1209                   catch(...)
1210                   {
1211                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1212                           "Exception: Unknown");
1213 chip     1.2  
1214 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
1215                   }
1216               
1217                   PEG_METHOD_EXIT();
1218               
1219                   return(response);
1220               }
1221               
1222 dj.gorey 1.25 Message * DefaultProviderManager::handleReferencesRequest(const Message * message)
1223 chip     1.1  {
1224                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleReferencesRequest");
1225               
1226                   CIMReferencesRequestMessage * request =
1227                       dynamic_cast<CIMReferencesRequestMessage *>(const_cast<Message *>(message));
1228               
1229                   PEGASUS_ASSERT(request != 0);
1230               
1231                   CIMReferencesResponseMessage * response =
1232                       new CIMReferencesResponseMessage(
1233                       request->messageId,
1234                       CIMException(),
1235                       request->queueIds.copyAndPop(),
1236                       Array<CIMObject>());
1237               
1238                   PEGASUS_ASSERT(response != 0);
1239               
1240                   // preserve message key
1241                   response->setKey(request->getKey());
1242               
1243                   //  Set HTTP method in response from request
1244 chip     1.1      response->setHttpMethod (request->getHttpMethod ());
1245               
1246                   // create a handler for this request
1247                   ReferencesResponseHandler handler(request, response);
1248               
1249                   // process the request
1250                   try
1251                   {
1252                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1253                           "DefaultProviderManager::handleReferencesRequest - Host name: $0  Name space: $1  Class name: $2",
1254                           System::getHostName(),
1255                           request->nameSpace.getString(),
1256                           request->objectName.getClassName().getString());
1257               
1258                       // make target object path
1259                       CIMObjectPath objectPath(
1260                           System::getHostName(),
1261                           request->nameSpace,
1262                           request->objectName.getClassName());
1263               
1264                       objectPath.setKeyBindings(request->objectName.getKeyBindings());
1265 chip     1.1  
1266 schuur   1.19         CIMObjectPath resultPath(
1267                           System::getHostName(),
1268                           request->nameSpace,
1269                           request->resultClass.getString());
1270               
1271 chip     1.5          // resolve provider name
1272 kumpf    1.28         ProviderName name = _resolveProviderName(
1273                           request->operationContext.get(ProviderIdContainer::NAME));
1274 chip     1.2  
1275                       // get cached or load new provider module
1276                       OpProviderHolder ph =
1277 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
1278 chip     1.2  
1279                       // convert arguments
1280                       OperationContext context;
1281               
1282 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
1283               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
1284               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
1285 chip     1.2  
1286                       STAT_GETSTARTTIME;
1287 chip     1.1  
1288 chip     1.2          PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1289                           "Calling provider.references: " +
1290                           ph.GetProvider().getName());
1291 chip     1.1  
1292 chip     1.2          pm_service_op_lock op_lock(&ph.GetProvider());
1293 chip     1.1  
1294 chip     1.2          ph.GetProvider().references(
1295                           context,
1296                           objectPath,
1297                           request->resultClass,
1298                           request->role,
1299                           request->includeQualifiers,
1300                           request->includeClassOrigin,
1301 a.dunfey 1.42             request->propertyList,
1302 chip     1.2              handler);
1303 chip     1.1  
1304 chip     1.2          STAT_PMS_PROVIDEREND;
1305 chip     1.1      }
1306                   catch(CIMException & e)
1307                   {
1308                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1309                           "Exception: " + e.getMessage());
1310 chip     1.2  
1311 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
1312                   }
1313                   catch(Exception & e)
1314                   {
1315                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1316                           "Exception: " + e.getMessage());
1317 chip     1.2  
1318 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
1319                   }
1320                   catch(...)
1321                   {
1322                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1323                           "Exception: Unknown");
1324 chip     1.2  
1325 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
1326                   }
1327               
1328                   PEG_METHOD_EXIT();
1329               
1330                   return(response);
1331               }
1332               
1333 dj.gorey 1.25 Message * DefaultProviderManager::handleReferenceNamesRequest(const Message * message)
1334 chip     1.1  {
1335                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleReferenceNamesRequest");
1336               
1337                   CIMReferenceNamesRequestMessage * request =
1338                       dynamic_cast<CIMReferenceNamesRequestMessage *>(const_cast<Message *>(message));
1339               
1340                   PEGASUS_ASSERT(request != 0);
1341               
1342                   CIMReferenceNamesResponseMessage * response =
1343                       new CIMReferenceNamesResponseMessage(
1344                       request->messageId,
1345                       CIMException(),
1346                       request->queueIds.copyAndPop(),
1347                       Array<CIMObjectPath>());
1348               
1349                   // preserve message key
1350                   response->setKey(request->getKey());
1351               
1352                   //  Set HTTP method in response from request
1353                   response->setHttpMethod (request->getHttpMethod ());
1354               
1355 chip     1.1      // create a handler for this request
1356                   ReferenceNamesResponseHandler handler(request, response);
1357               
1358                   // process the request
1359                   try
1360                   {
1361                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1362                           "DefaultProviderManager::handleReferenceNamesRequest - Host name: $0  Name space: $1  Class name: $2",
1363                           System::getHostName(),
1364                           request->nameSpace.getString(),
1365                           request->objectName.getClassName().getString());
1366               
1367                       // make target object path
1368                       CIMObjectPath objectPath(
1369                           System::getHostName(),
1370                           request->nameSpace,
1371                           request->objectName.getClassName());
1372               
1373                       objectPath.setKeyBindings(request->objectName.getKeyBindings());
1374               
1375 schuur   1.19         CIMObjectPath resultPath(
1376                           System::getHostName(),
1377                           request->nameSpace,
1378                           request->resultClass.getString());
1379               
1380 chip     1.5          // resolve provider name
1381 kumpf    1.28         ProviderName name = _resolveProviderName(
1382                           request->operationContext.get(ProviderIdContainer::NAME));
1383 chip     1.1  
1384 chip     1.2          // get cached or load new provider module
1385                       OpProviderHolder ph =
1386 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
1387 chip     1.1  
1388 chip     1.2          // convert arguments
1389                       OperationContext context;
1390 chip     1.1  
1391 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
1392               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
1393               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
1394 chip     1.1  
1395 chip     1.2          STAT_GETSTARTTIME;
1396 chip     1.1  
1397 chip     1.2          PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1398                           "Calling provider.referenceNames: " +
1399                           ph.GetProvider().getName());
1400 chip     1.1  
1401 chip     1.2          pm_service_op_lock op_lock(&ph.GetProvider());
1402 chip     1.1  
1403 chip     1.2          ph.GetProvider().referenceNames(
1404                           context,
1405                           objectPath,
1406                           request->resultClass,
1407                           request->role,
1408                           handler);
1409 chip     1.1  
1410 chip     1.2          STAT_PMS_PROVIDEREND;
1411 chip     1.1      }
1412                   catch(CIMException & e)
1413                   {
1414                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1415                           "Exception: " + e.getMessage());
1416 chip     1.2  
1417 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
1418                   }
1419                   catch(Exception & e)
1420                   {
1421                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1422                           "Exception: " + e.getMessage());
1423 chip     1.2  
1424 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
1425                   }
1426                   catch(...)
1427                   {
1428                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1429                           "Exception: Unknown");
1430 chip     1.2  
1431 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
1432                   }
1433               
1434                   PEG_METHOD_EXIT();
1435               
1436                   return(response);
1437               }
1438               
1439 dj.gorey 1.25 Message * DefaultProviderManager::handleGetPropertyRequest(const Message * message)
1440 chip     1.1  {
1441                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleGetPropertyRequest");
1442               
1443                   CIMGetPropertyRequestMessage * request =
1444                       dynamic_cast<CIMGetPropertyRequestMessage *>(const_cast<Message *>(message));
1445               
1446                   PEGASUS_ASSERT(request != 0);
1447               
1448                   // create response message
1449                   CIMGetPropertyResponseMessage * response =
1450                       new CIMGetPropertyResponseMessage(
1451                       request->messageId,
1452                       CIMException(),
1453                       request->queueIds.copyAndPop(),
1454                       CIMValue());
1455               
1456                   PEGASUS_ASSERT(response != 0);
1457               
1458                   // preserve message key
1459                   response->setKey(request->getKey());
1460               
1461 chip     1.1      //  Set HTTP method in response from request
1462                   response->setHttpMethod(request->getHttpMethod());
1463               
1464                   GetPropertyResponseHandler handler(request, response);
1465               
1466                   try
1467                   {
1468                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1469                           "DefaultProviderManager::handleGetPropertyRequest - Host name: $0  Name space: $1  Class name: $2",
1470                           System::getHostName(),
1471                           request->nameSpace.getString(),
1472                           request->instanceName.getClassName().getString());
1473               
1474                       // make target object path
1475                       CIMObjectPath objectPath(
1476                           System::getHostName(),
1477                           request->nameSpace,
1478                           request->instanceName.getClassName(),
1479                           request->instanceName.getKeyBindings());
1480               
1481 chip     1.5          // resolve provider name
1482 kumpf    1.28         ProviderName name = _resolveProviderName(
1483                           request->operationContext.get(ProviderIdContainer::NAME));
1484 chip     1.1  
1485                       // get cached or load new provider module
1486                       OpProviderHolder ph =
1487 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
1488 chip     1.1  
1489                       // convert arguments
1490                       OperationContext context;
1491               
1492 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
1493               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
1494               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
1495 chip     1.1  
1496                       CIMName propertyName = request->propertyName;
1497               
1498                       STAT_GETSTARTTIME;
1499               
1500                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1501                           "Calling provider.getProperty: " +
1502                           ph.GetProvider().getName());
1503               
1504                       // forward request
1505                       pm_service_op_lock op_lock(&ph.GetProvider());
1506               
1507                       ph.GetProvider().getProperty(
1508                           context,
1509                           objectPath,
1510                           propertyName,
1511                           handler);
1512               
1513                       STAT_PMS_PROVIDEREND;
1514                   }
1515                   catch(CIMException & e)
1516 chip     1.1      {
1517                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1518                           "Exception: " + e.getMessage());
1519 chip     1.2  
1520 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
1521                   }
1522                   catch(Exception & e)
1523                   {
1524                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1525                           "Exception: " + e.getMessage());
1526 chip     1.2  
1527 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
1528                   }
1529                   catch(...)
1530                   {
1531                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1532                           "Exception: Unknown");
1533 chip     1.2  
1534 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
1535                   }
1536               
1537                   PEG_METHOD_EXIT();
1538               
1539                   return(response);
1540               }
1541               
1542 dj.gorey 1.25 Message * DefaultProviderManager::handleSetPropertyRequest(const Message * message)
1543 chip     1.1  {
1544                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleSetPropertyRequest");
1545               
1546                   CIMSetPropertyRequestMessage * request =
1547                       dynamic_cast<CIMSetPropertyRequestMessage *>(const_cast<Message *>(message));
1548               
1549                   PEGASUS_ASSERT(request != 0);
1550               
1551                   // create response message
1552                   //l10n
1553                   CIMSetPropertyResponseMessage * response =
1554                       new CIMSetPropertyResponseMessage(
1555                       request->messageId,
1556                       PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms(
1557                       "ProviderManager.DefaultProviderManager.NOT_IMPLEMENTED",
1558                       "not implemented")),
1559                       request->queueIds.copyAndPop());
1560               
1561                   PEGASUS_ASSERT(response != 0);
1562               
1563                   // preserve message key
1564 chip     1.1      response->setKey(request->getKey());
1565               
1566                   //  Set HTTP method in response from request
1567                   response->setHttpMethod(request->getHttpMethod());
1568               
1569                   SetPropertyResponseHandler handler(request, response);
1570               
1571                   try
1572                   {
1573                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1574                           "DefaultProviderManager::handleSetPropertyRequest - Host name: $0  Name space: $1  Class name: $2",
1575                           System::getHostName(),
1576                           request->nameSpace.getString(),
1577                           request->instanceName.getClassName().getString());
1578               
1579                       // make target object path
1580                       CIMObjectPath objectPath(
1581                           System::getHostName(),
1582                           request->nameSpace,
1583                           request->instanceName.getClassName(),
1584                           request->instanceName.getKeyBindings());
1585 chip     1.1  
1586 chip     1.5          // resolve provider name
1587 kumpf    1.28         ProviderName name = _resolveProviderName(
1588                           request->operationContext.get(ProviderIdContainer::NAME));
1589 chip     1.1  
1590                       // get cached or load new provider module
1591                       OpProviderHolder ph =
1592 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
1593 chip     1.1  
1594                       // convert arguments
1595                       OperationContext context;
1596               
1597 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
1598               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
1599               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
1600 chip     1.1  
1601                       CIMName propertyName = request->propertyName;
1602                       CIMValue propertyValue = request->newValue;
1603               
1604                       STAT_GETSTARTTIME;
1605               
1606                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1607                           "Calling provider.setProperty: " +
1608                           ph.GetProvider().getName());
1609               
1610                       // forward request
1611                       pm_service_op_lock op_lock(&ph.GetProvider());
1612               
1613                       ph.GetProvider().setProperty(
1614                           context,
1615                           objectPath,
1616                           propertyName,
1617                           propertyValue,
1618                           handler);
1619               
1620                       STAT_PMS_PROVIDEREND;
1621 chip     1.1      }
1622                   catch(CIMException & e)
1623                   {
1624                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1625                           "Exception: " + e.getMessage());
1626 chip     1.2  
1627 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
1628                   }
1629                   catch(Exception & e)
1630                   {
1631                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1632                           "Exception: " + e.getMessage());
1633 chip     1.2  
1634 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
1635                   }
1636                   catch(...)
1637                   {
1638                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1639                           "Exception: Unknown");
1640 chip     1.2  
1641 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
1642                   }
1643               
1644                   PEG_METHOD_EXIT();
1645               
1646                   return(response);
1647               }
1648               
1649 dj.gorey 1.25 Message * DefaultProviderManager::handleInvokeMethodRequest(const Message * message)
1650 chip     1.1  {
1651                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleInvokeMethodRequest");
1652               
1653                   CIMInvokeMethodRequestMessage * request =
1654                       dynamic_cast<CIMInvokeMethodRequestMessage *>(const_cast<Message *>(message));
1655               
1656                   PEGASUS_ASSERT(request != 0);
1657               
1658                   // create response message
1659                   CIMInvokeMethodResponseMessage * response =
1660                       new CIMInvokeMethodResponseMessage(
1661                       request->messageId,
1662                       CIMException(),
1663                       request->queueIds.copyAndPop(),
1664                       CIMValue(),
1665                       Array<CIMParamValue>(),
1666                       request->methodName);
1667               
1668                   PEGASUS_ASSERT(response != 0);
1669               
1670                   // propagate message key
1671 chip     1.1      response->setKey(request->getKey());
1672               
1673                   //  Set HTTP method in response from request
1674                   response->setHttpMethod (request->getHttpMethod ());
1675               
1676                   // create a handler for this request
1677                   InvokeMethodResponseHandler handler(request, response);
1678               
1679                   try
1680                   {
1681                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1682                           "DefaultProviderManager::handleInvokeMethodRequest - Host name: $0  Name space: $1  Class name: $2",
1683                           System::getHostName(),
1684                           request->nameSpace.getString(),
1685                           request->instanceName.getClassName().getString());
1686               
1687                       // make target object path
1688                       CIMObjectPath objectPath(
1689                           System::getHostName(),
1690                           request->nameSpace,
1691                           request->instanceName.getClassName(),
1692 chip     1.1              request->instanceName.getKeyBindings());
1693               
1694 chip     1.5          // resolve provider name
1695 kumpf    1.28         ProviderName name = _resolveProviderName(
1696                           request->operationContext.get(ProviderIdContainer::NAME));
1697 chip     1.1  
1698                       // get cached or load new provider module
1699                       OpProviderHolder ph =
1700 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
1701 chip     1.1  
1702                       // convert arguments
1703                       OperationContext context;
1704               
1705 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
1706               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
1707               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
1708 chip     1.1  
1709                       CIMObjectPath instanceReference(request->instanceName);
1710               
1711                       // ATTN: propagate namespace
1712                       instanceReference.setNameSpace(request->nameSpace);
1713               
1714                       // forward request
1715                       STAT_GETSTARTTIME;
1716               
1717                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1718                           "Calling provider.invokeMethod: " +
1719                           ph.GetProvider().getName());
1720               
1721                       pm_service_op_lock op_lock(&ph.GetProvider());
1722               
1723                       ph.GetProvider().invokeMethod(
1724                           context,
1725                           instanceReference,
1726                           request->methodName,
1727                           request->inParameters,
1728                           handler);
1729 chip     1.1  
1730                       STAT_PMS_PROVIDEREND;
1731                   }
1732                   catch(CIMException & e)
1733                   {
1734                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1735                           "Exception: " + e.getMessage());
1736 chip     1.2  
1737 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
1738                   }
1739                   catch(Exception & e)
1740                   {
1741                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1742                           "Exception: " + e.getMessage());
1743 chip     1.2  
1744 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
1745                   }
1746                   catch(...)
1747                   {
1748                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1749                           "Exception: Unknown");
1750 chip     1.2  
1751 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown error.");
1752                   }
1753               
1754                   PEG_METHOD_EXIT();
1755               
1756                   return(response);
1757               }
1758               
1759 dj.gorey 1.25 Message * DefaultProviderManager::handleCreateSubscriptionRequest(const Message * message)
1760 chip     1.1  {
1761                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleCreateSubscriptionRequest");
1762               
1763                   CIMCreateSubscriptionRequestMessage * request =
1764                       dynamic_cast<CIMCreateSubscriptionRequestMessage *>(const_cast<Message *>(message));
1765               
1766                   PEGASUS_ASSERT(request != 0);
1767               
1768                   CIMCreateSubscriptionResponseMessage * response =
1769                       new CIMCreateSubscriptionResponseMessage(
1770                       request->messageId,
1771                       CIMException(),
1772                       request->queueIds.copyAndPop());
1773               
1774                   PEGASUS_ASSERT(response != 0);
1775               
1776                   // preserve message key
1777                   response->setKey(request->getKey());
1778               
1779                   //  Set HTTP method in response from request
1780                   response->setHttpMethod (request->getHttpMethod ());
1781 chip     1.1  
1782                   OperationResponseHandler handler(request, response);
1783               
1784                   try
1785                   {
1786 chip     1.2          String temp;
1787               
1788                       for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
1789                       {
1790                           temp.append(request->classNames[i].getString());
1791               
1792                           if(i == (n - 1))
1793                           {
1794                               temp.append(", ");
1795                           }
1796                       }
1797               
1798                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1799                           "DefaultProviderManager::handleCreateSubscriptionRequest - Host name: $0  Name space: $1  Class name(s): $2",
1800                           System::getHostName(),
1801                           request->nameSpace.getString(),
1802                           temp);
1803               
1804 se.gupta 1.33 		CIMInstance req_provider, req_providerModule;
1805 se.gupta 1.34 		ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);
1806               		req_provider = pidc.getProvider();
1807               		req_providerModule = pidc.getModule();
1808 schuur   1.18 
1809 se.gupta 1.33         String physicalName=_resolvePhysicalName( req_providerModule.getProperty(
1810                                                                 req_providerModule.findProperty("Location")).getValue().toString());
1811               
1812                       ProviderName name(req_provider.getProperty(req_provider.findProperty("Name")).getValue ().toString (),
1813                                                 physicalName,
1814                                                 req_providerModule.getProperty(req_providerModule.findProperty
1815                                                 ("InterfaceType")).getValue().toString(),
1816                                                  0);
1817               		// get cached or load new provider module
1818 chip     1.1          OpProviderHolder ph =
1819 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
1820 dj.gorey 1.25 
1821 chip     1.1          // convert arguments
1822                       OperationContext context;
1823               
1824 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
1825               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
1826               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
1827               	    context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));
1828               	    context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME));
1829               	    context.insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME));
1830 humberto 1.45 		 context.insert(request->operationContext.get(SubscriptionFilterQueryContainer::NAME));
1831 chip     1.1  
1832                       CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();
1833               
1834                       Array<CIMObjectPath> classNames;
1835               
1836                       for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
1837                       {
1838                           CIMObjectPath className(
1839                               System::getHostName(),
1840                               request->nameSpace,
1841                               request->classNames[i]);
1842               
1843                           classNames.append(className);
1844                       }
1845               
1846                       CIMPropertyList propertyList = request->propertyList;
1847               
1848                       Uint16 repeatNotificationPolicy = request->repeatNotificationPolicy;
1849               
1850                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1851                           "Calling provider.createSubscription: " +
1852 chip     1.1              ph.GetProvider().getName());
1853               
1854                       pm_service_op_lock op_lock(&ph.GetProvider());
1855               
1856                       ph.GetProvider().createSubscription(
1857                           context,
1858                           subscriptionName,
1859                           classNames,
1860                           propertyList,
1861                           repeatNotificationPolicy);
1862                   }
1863                   catch(CIMException & e)
1864                   {
1865                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1866                           "Exception: " + e.getMessage());
1867 chip     1.2  
1868 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
1869                   }
1870                   catch(Exception & e)
1871                   {
1872                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1873                           "Exception: " + e.getMessage());
1874 chip     1.2  
1875 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
1876                   }
1877                   catch(...)
1878                   {
1879                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1880                           "Exception: Unknown");
1881 chip     1.2  
1882 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown Error");
1883                   }
1884               
1885                   PEG_METHOD_EXIT();
1886               
1887                   return(response);
1888               }
1889               
1890 dj.gorey 1.25 Message * DefaultProviderManager::handleModifySubscriptionRequest( const Message * message)
1891 chip     1.1  {
1892                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleModifySubscriptionRequest");
1893               
1894                   CIMModifySubscriptionRequestMessage * request =
1895                       dynamic_cast<CIMModifySubscriptionRequestMessage *>(const_cast<Message *>(message));
1896               
1897                   PEGASUS_ASSERT(request != 0);
1898               
1899                   CIMModifySubscriptionResponseMessage * response =
1900                       new CIMModifySubscriptionResponseMessage(
1901                       request->messageId,
1902                       CIMException(),
1903                       request->queueIds.copyAndPop());
1904               
1905                   PEGASUS_ASSERT(response != 0);
1906               
1907                   // preserve message key
1908                   response->setKey(request->getKey());
1909               
1910                   //  Set HTTP method in response from request
1911                   response->setHttpMethod (request->getHttpMethod ());
1912 chip     1.1  
1913                   OperationResponseHandler handler(request, response);
1914               
1915                   try
1916                   {
1917 chip     1.2          String temp;
1918               
1919                       for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
1920                       {
1921                           temp.append(request->classNames[i].getString());
1922               
1923                           if(i == (n - 1))
1924                           {
1925                               temp.append(", ");
1926                           }
1927                       }
1928               
1929                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
1930 schuur   1.18             "DefaultProviderManager::handleCreateSubscriptionRequest - Host name: $0  Name space: $1  Class name(s): $2",
1931 chip     1.2              System::getHostName(),
1932                           request->nameSpace.getString(),
1933                           temp);
1934 se.gupta 1.33 			
1935 se.gupta 1.34 		CIMInstance req_provider, req_providerModule;
1936               		ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);
1937               		req_provider = pidc.getProvider();
1938               		req_providerModule = pidc.getModule();
1939               
1940                       String physicalName=_resolvePhysicalName( req_providerModule.getProperty(
1941 se.gupta 1.33                                                   req_providerModule.findProperty("Location")).getValue().toString());
1942               
1943 se.gupta 1.34         ProviderName name(req_provider.getProperty(req_provider.findProperty("Name")).getValue ().toString (),
1944 se.gupta 1.33                                   physicalName,
1945                                                 req_providerModule.getProperty(req_providerModule.findProperty
1946                                                 ("InterfaceType")).getValue().toString(),
1947                                                  0);
1948 chip     1.1  
1949                       // get cached or load new provider module
1950                       OpProviderHolder ph =
1951 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
1952 dj.gorey 1.25 
1953 chip     1.1          // convert arguments
1954                       OperationContext context;
1955 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
1956               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
1957               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
1958               	    context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));
1959               	    context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME));
1960               	    context.insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME));
1961 humberto 1.45 		 context.insert(request->operationContext.get(SubscriptionFilterQueryContainer::NAME));
1962 chip     1.1  
1963                       CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();
1964               
1965                       Array<CIMObjectPath> classNames;
1966               
1967                       for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
1968                       {
1969                           CIMObjectPath className(
1970                               System::getHostName(),
1971                               request->nameSpace,
1972                               request->classNames[i]);
1973               
1974                           classNames.append(className);
1975                       }
1976               
1977                       CIMPropertyList propertyList = request->propertyList;
1978               
1979                       Uint16 repeatNotificationPolicy = request->repeatNotificationPolicy;
1980               
1981                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1982                           "Calling provider.modifySubscription: " +
1983 chip     1.1              ph.GetProvider().getName());
1984               
1985                       pm_service_op_lock op_lock(&ph.GetProvider());
1986               
1987                       ph.GetProvider().modifySubscription(
1988                           context,
1989                           subscriptionName,
1990                           classNames,
1991                           propertyList,
1992                           repeatNotificationPolicy);
1993                   }
1994                   catch(CIMException & e)
1995                   {
1996                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
1997                           "Exception: " + e.getMessage());
1998 chip     1.2  
1999 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
2000                   }
2001                   catch(Exception & e)
2002                   {
2003                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2004                           "Exception: " + e.getMessage());
2005 chip     1.2  
2006 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
2007                   }
2008                   catch(...)
2009                   {
2010                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2011                           "Exception: Unknown");
2012 chip     1.2  
2013 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown Error");
2014                   }
2015               
2016                   PEG_METHOD_EXIT();
2017               
2018                   return(response);
2019               }
2020               
2021 dj.gorey 1.25 Message * DefaultProviderManager::handleDeleteSubscriptionRequest(const Message * message)
2022 chip     1.1  {
2023                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleDeleteSubscriptionRequest");
2024               
2025                   CIMDeleteSubscriptionRequestMessage * request =
2026                       dynamic_cast<CIMDeleteSubscriptionRequestMessage *>(const_cast<Message *>(message));
2027               
2028                   PEGASUS_ASSERT(request != 0);
2029               
2030                   CIMDeleteSubscriptionResponseMessage * response =
2031                       new CIMDeleteSubscriptionResponseMessage(
2032                       request->messageId,
2033                       CIMException(),
2034                       request->queueIds.copyAndPop());
2035               
2036                   PEGASUS_ASSERT(response != 0);
2037               
2038                   // preserve message key
2039                   response->setKey(request->getKey());
2040               
2041                   //  Set HTTP method in response from request
2042                   response->setHttpMethod(request->getHttpMethod());
2043 chip     1.1  
2044                   OperationResponseHandler handler(request, response);
2045               
2046                   try
2047                   {
2048 chip     1.2          String temp;
2049               
2050                       for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
2051                       {
2052                           temp.append(request->classNames[i].getString());
2053               
2054                           if(i == (n - 1))
2055                           {
2056                               temp.append(", ");
2057                           }
2058                       }
2059               
2060                       Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
2061                           "DefaultProviderManager::handleDeleteSubscriptionRequest - Host name: $0  Name space: $1  Class name(s): $2",
2062                           System::getHostName(),
2063                           request->nameSpace.getString(),
2064                           temp);
2065               
2066 se.gupta 1.34 		CIMInstance req_provider, req_providerModule;
2067               		ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);
2068               
2069               		req_provider = pidc.getProvider();
2070               		req_providerModule = pidc.getModule();
2071 se.gupta 1.33         
2072                             String physicalName=_resolvePhysicalName( req_providerModule.getProperty(
2073                                                                 req_providerModule.findProperty("Location")).getValue().toString());
2074               
2075                             ProviderName name(req_provider.getProperty(req_provider.findProperty("Name")).getValue ().toString (),
2076                                                 physicalName,
2077                                                 req_providerModule.getProperty(req_providerModule.findProperty
2078                                                 ("InterfaceType")).getValue().toString(),
2079                                                  0);
2080 chip     1.1  
2081                       // get cached or load new provider module
2082                       OpProviderHolder ph =
2083 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
2084 dj.gorey 1.25 
2085 chip     1.1          // convert arguments
2086                       OperationContext context;
2087               
2088 se.gupta 1.34 		context.insert(request->operationContext.get(IdentityContainer::NAME));
2089               		context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
2090               	    context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
2091               	    context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME));
2092               	    context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME));
2093               
2094 chip     1.1          CIMObjectPath subscriptionName = request->subscriptionInstance.getPath();
2095               
2096                       Array<CIMObjectPath> classNames;
2097               
2098                       for(Uint32 i = 0, n = request->classNames.size(); i < n; i++)
2099                       {
2100                           CIMObjectPath className(
2101                               System::getHostName(),
2102                               request->nameSpace,
2103                               request->classNames[i]);
2104               
2105                           classNames.append(className);
2106                       }
2107               
2108                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2109                           "Calling provider.deleteSubscription: " +
2110                           ph.GetProvider().getName());
2111               
2112                       pm_service_op_lock op_lock(&ph.GetProvider());
2113               
2114                       ph.GetProvider().deleteSubscription(
2115 chip     1.1              context,
2116                           subscriptionName,
2117                           classNames);
2118                   }
2119                   catch(CIMException & e)
2120                   {
2121                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2122                           "Exception: " + e.getMessage());
2123 chip     1.2  
2124 chip     1.1          handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
2125                   }
2126                   catch(Exception & e)
2127                   {
2128                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2129                           "Exception: " + e.getMessage());
2130 chip     1.2  
2131 chip     1.1          handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
2132                   }
2133                   catch(...)
2134                   {
2135                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2136                           "Exception: Unknown");
2137 chip     1.2  
2138 chip     1.1          handler.setStatus(CIM_ERR_FAILED, "Unknown Error");
2139                   }
2140               
2141                   PEG_METHOD_EXIT();
2142               
2143                   return(response);
2144               }
2145               
2146 dj.gorey 1.25 Message * DefaultProviderManager::handleEnableIndicationsRequest(const Message * message)
2147 chip     1.1  {
2148                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager:: handleEnableIndicationsRequest");
2149               
2150                   CIMEnableIndicationsRequestMessage * request =
2151                       dynamic_cast<CIMEnableIndicationsRequestMessage *>(const_cast<Message *>(message));
2152               
2153                   PEGASUS_ASSERT(request != 0);
2154               
2155                   CIMEnableIndicationsResponseMessage * response =
2156                       new CIMEnableIndicationsResponseMessage(
2157                       request->messageId,
2158                       CIMException(),
2159                       request->queueIds.copyAndPop());
2160               
2161                   PEGASUS_ASSERT(response != 0);
2162               
2163                   // preserve message key
2164                   response->setKey(request->getKey());
2165               
2166                   //  Set HTTP method in response from request
2167                   response->setHttpMethod(request->getHttpMethod());
2168 chip     1.1  
2169                   response->dest = request->queueIds.top();
2170               
2171 se.gupta 1.34 	CIMInstance req_provider, req_providerModule;
2172               	ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);
2173               
2174               	req_provider = pidc.getProvider();
2175               	req_providerModule = pidc.getModule();
2176 se.gupta 1.33 
2177 se.gupta 1.37     EnableIndicationsResponseHandler *handler =
2178                       new EnableIndicationsResponseHandler(
2179                           request, response, req_provider, _indicationCallback);
2180               
2181               
2182               
2183 chip     1.1      try
2184                   {
2185 se.gupta 1.33           String physicalName=_resolvePhysicalName( req_providerModule.getProperty(
2186                                                                   req_providerModule.findProperty("Location")).getValue().toString());
2187               
2188                         ProviderName name(req_provider.getProperty(req_provider.findProperty("Name")).getValue ().toString (),
2189                                                 physicalName,
2190                                                 req_providerModule.getProperty(req_providerModule.findProperty
2191                                                 ("InterfaceType")).getValue().toString(),
2192                                                  0);
2193 chip     1.1  
2194                       // get cached or load new provider module
2195                       OpProviderHolder ph =
2196 schuur   1.14             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
2197 chip     1.1  
2198                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2199                           "Calling provider.enableIndications: " +
2200                           ph.GetProvider().getName());
2201 schuur   1.14 
2202                       pm_service_op_lock op_lock(&ph.GetProvider());
2203 schuur   1.23         ph.GetProvider().protect();
2204 schuur   1.14 
2205 chip     1.1          ph.GetProvider().enableIndications(*handler);
2206               
2207               
2208                       // if no exception, store the handler so it is persistent for as
2209                       // long as the provider has indications enabled.
2210                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2211                           "Storing indication handler for " + ph.GetProvider().getName());
2212               
2213                       _insertEntry(ph.GetProvider(), handler);
2214                   }
2215                   catch(CIMException & e)
2216                   {
2217                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2218                           "Exception: " + e.getMessage());
2219 schuur   1.14 
2220 chip     1.1          response->cimException = CIMException(e);
2221                   }
2222                   catch(Exception & e)
2223                   {
2224                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2225                           "Exception: " + e.getMessage());
2226                       response->cimException = CIMException(CIM_ERR_FAILED, MessageLoaderParms(
2227                           "ProviderManager.DefaultProviderManager.INTERNAL_ERROR",
2228                           "Internal Error"));
2229                   }
2230                   catch(...)
2231                   {
2232                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2233                           "Exception: Unknown");
2234                       response->cimException = CIMException(CIM_ERR_FAILED, MessageLoaderParms(
2235                           "ProviderManager.DefaultProviderManager.UNKNOWN_ERROR",
2236                           "Unknown Error"));
2237                   }
2238               
2239                   PEG_METHOD_EXIT();
2240               
2241 chip     1.1      return(response);
2242               }
2243               
2244 dj.gorey 1.25 Message * DefaultProviderManager::handleDisableIndicationsRequest(const Message * message)
2245 chip     1.1  {
2246                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleDisableIndicationsRequest");
2247               
2248                   CIMDisableIndicationsRequestMessage * request =
2249                       dynamic_cast<CIMDisableIndicationsRequestMessage *>(const_cast<Message *>(message));
2250               
2251                   PEGASUS_ASSERT(request != 0);
2252               
2253                   CIMDisableIndicationsResponseMessage * response =
2254                       new CIMDisableIndicationsResponseMessage(
2255                       request->messageId,
2256                       CIMException(),
2257                       request->queueIds.copyAndPop());
2258               
2259                   // preserve message key
2260                   response->setKey(request->getKey());
2261               
2262                   //  Set HTTP method in response from request
2263                   response->setHttpMethod (request->getHttpMethod ());
2264               
2265                   OperationResponseHandler handler(request, response);
2266 chip     1.1  
2267 se.gupta 1.34 	CIMInstance req_provider, req_providerModule;
2268               	ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME);
2269               
2270               	req_provider = pidc.getProvider();
2271               	req_providerModule = pidc.getModule();
2272 se.gupta 1.33      
2273 chip     1.1      try
2274                   {
2275 schuur   1.14        String physicalName=_resolvePhysicalName(
2276 se.gupta 1.33               req_providerModule.getProperty(
2277                               req_providerModule.findProperty("Location")).getValue().toString());
2278 schuur   1.14 
2279 schuur   1.20        ProviderName name(
2280 se.gupta 1.33                req_provider.getProperty(req_provider.findProperty
2281 schuur   1.14                    ("Name")).getValue ().toString (),
2282 dj.gorey 1.25                physicalName,
2283 se.gupta 1.33                 req_providerModule.getProperty(req_providerModule.findProperty
2284 schuur   1.14                     ("InterfaceType")).getValue().toString(),
2285 chip     1.6              0);
2286 chip     1.1          // get cached or load new provider module
2287                       OpProviderHolder ph =
2288 schuur   1.10             providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
2289 chip     1.1  
2290                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2291                           "Calling provider.disableIndications: " +
2292                           ph.GetProvider().getName());
2293               
2294                       ph.GetProvider().disableIndications();
2295               
2296                       ph.GetProvider().unprotect();
2297               
2298                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2299                           "Removing and Destroying indication handler for " +
2300                           ph.GetProvider().getName());
2301               
2302                       delete _removeEntry(_generateKey(ph.GetProvider()));
2303                   }
2304               
2305                   catch(CIMException & e)
2306                   {
2307                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2308                           "Exception: " + e.getMessage());
2309 chip     1.2  
2310 chip     1.1          response->cimException = CIMException(e);
2311                   }
2312                   catch(Exception & e)
2313                   {
2314                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2315                           "Exception: " + e.getMessage());
2316 chip     1.2              response->cimException = CIMException(CIM_ERR_FAILED, MessageLoaderParms(
2317 chip     1.1              "ProviderManager.DefaultProviderManager.INTERNAL_ERROR",
2318                           "Internal Error"));
2319                   }
2320                   catch(...)
2321                   {
2322                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2323                           "Exception: Unknown");
2324 chip     1.2              response->cimException = CIMException(CIM_ERR_FAILED, MessageLoaderParms(
2325 chip     1.1              "ProviderManager.DefaultProviderManager.UNKNOWN_ERROR",
2326                           "Unknown Error"));
2327                   }
2328               
2329                   PEG_METHOD_EXIT();
2330               
2331                   return(response);
2332               }
2333               
2334 dj.gorey 1.25 Message *DefaultProviderManager::handleExportIndicationRequest(const Message *message)
2335 schuur   1.14 {
2336                  PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManagerService::handlExportIndicationRequest");
2337               
2338                   CIMExportIndicationRequestMessage * request =
2339                       dynamic_cast<CIMExportIndicationRequestMessage *>(const_cast<Message *>(message));
2340               
2341                   PEGASUS_ASSERT(request != 0);
2342               
2343                   CIMExportIndicationResponseMessage * response =
2344                       new CIMExportIndicationResponseMessage(
2345                       request->messageId,
2346                       CIMException(),
2347                       request->queueIds.copyAndPop());
2348               
2349                   PEGASUS_ASSERT(response != 0);
2350               
2351                   // preserve message key
2352                   response->setKey(request->getKey());
2353               
2354                   //  Set HTTP method in response from request
2355                   response->setHttpMethod (request->getHttpMethod ());
2356 schuur   1.14 
2357                   OperationResponseHandler handler(request, response);
2358               
2359                   try
2360                   {
2361 kumpf    1.28         // resolve provider name
2362                       ProviderName name = _resolveProviderName(
2363                           request->operationContext.get(ProviderIdContainer::NAME));
2364 schuur   1.14 
2365 kumpf    1.28         // get cached or load new provider module
2366 schuur   1.14         OpProviderHolder ph =
2367                           providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY);
2368               
2369 w.white  1.40 		STAT_GETSTARTTIME
2370               
2371 schuur   1.14         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2372 dj.gorey 1.25                        "Calling provider.: " +
2373                                      ph.GetProvider().getName());
2374 schuur   1.14 
2375                       OperationContext context;
2376               
2377               //L10N_TODO
2378               //l10n
2379               // ATTN-CEC 06/04/03 NOTE: I can't find where the consume msg is sent.  This
2380               // does not appear to be hooked-up.  When it is added, need to
2381               // make sure that Content-Language is set in the consume msg.
2382               // NOTE: A-L is not needed to be set in the consume msg.
2383                     // add the langs to the context
2384 se.gupta 1.33 
2385 se.gupta 1.34       context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
2386 schuur   1.14 
2387                     CIMInstance indication_copy = request->indicationInstance;
2388                     pm_service_op_lock op_lock(&ph.GetProvider());
2389               
2390                     ph.GetProvider().consumeIndication(context,
2391 dj.gorey 1.25                                 request->destinationPath,
2392                                               indication_copy);
2393 schuur   1.14 
2394 w.white  1.40 	  STAT_PMS_PROVIDEREND
2395               
2396 schuur   1.14     }
2397               
2398                   catch(CIMException & e)
2399                   {
2400                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2401                           "Exception: " + e.getMessage());
2402               
2403                       handler.setStatus(e.getCode(), e.getContentLanguages(), e.getMessage()); // l10n
2404                   }
2405                   catch(Exception & e)
2406                   {
2407                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2408                           "Exception: " + e.getMessage());
2409               
2410                       handler.setStatus(CIM_ERR_FAILED, e.getContentLanguages(), e.getMessage()); // l10n
2411                   }
2412                   catch(...)
2413                   {
2414                       PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2415                           "Exception: Unknown");
2416               
2417 schuur   1.14         handler.setStatus(CIM_ERR_FAILED, "Unknown Error");
2418                   }
2419               
2420                   PEG_METHOD_EXIT();
2421               
2422                   return(response);
2423               }
2424               
2425               
2426               
2427               
2428 chip     1.1  //
2429               // This function disables a provider module if disableProviderOnly is not true,
2430               // otherwise, disables a provider. Disable provider module means that
2431               // block all the providers which contain in the module and unload the
2432               // providers.
2433               // Disable provider means unload the provider and the provider is not blocked.
2434               //
2435               // ATTN-YZ-P2-20030519: Provider needs to be blocked when disable a provider.
2436               //
2437 dj.gorey 1.25 Message * DefaultProviderManager::handleDisableModuleRequest(const Message * message)
2438 chip     1.1  {
2439                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleDisableModuleRequest");
2440 schuur   1.19 
2441 chip     1.1      CIMDisableModuleRequestMessage * request =
2442                       dynamic_cast<CIMDisableModuleRequestMessage *>(const_cast<Message *>(message));
2443               
2444                   PEGASUS_ASSERT(request != 0);
2445 dj.gorey 1.25 
2446 schuur   1.18     Array<Uint16> operationalStatus;
2447                   CIMException cimException;
2448 chip     1.1  
2449 schuur   1.18     try
2450 chip     1.1      {
2451 schuur   1.18         // get provider module name
2452                       String moduleName;
2453                       CIMInstance mInstance = request->providerModule;
2454                       Uint32 pos = mInstance.findProperty(CIMName ("Name"));
2455 kumpf    1.28         PEGASUS_ASSERT(pos != PEG_NOT_FOUND);
2456                       mInstance.getProperty(pos).getValue().get(moduleName);
2457 chip     1.1  
2458 schuur   1.18         Boolean disableProviderOnly = request->disableProviderOnly;
2459               
2460 chip     1.1          //
2461 kumpf    1.28         // Unload providers
2462 chip     1.1          //
2463 schuur   1.18         Array<CIMInstance> _pInstances = request->providers;
2464                       Array<Boolean> _indicationProviders = request->indicationProviders;
2465 dj.gorey 1.25 
2466 schuur   1.18         String physicalName=_resolvePhysicalName(
2467                          mInstance.getProperty(
2468                             mInstance.findProperty("Location")).getValue().toString());
2469 dj.gorey 1.25 
2470 schuur   1.18         for(Uint32 i = 0, n = _pInstances.size(); i < n; i++)
2471 chip     1.1          {
2472 schuur   1.18             String pName(_pInstances[i].getProperty(
2473                              _pInstances[i].findProperty("Name")).getValue().toString());
2474 chip     1.1  
2475 schuur   1.18             Sint16 ret_value = providerManager.disableProvider(physicalName,pName);
2476 chip     1.1  
2477 schuur   1.18             if (ret_value == 0)
2478                           {
2479 schuur   1.23                 // disable failed since there are pending requests,
2480 kumpf    1.28                 // stop trying to disable other providers in this module.
2481 kumpf    1.38                 operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK);
2482 kumpf    1.28                 break;
2483 dj.gorey 1.25             }
2484 kumpf    1.28             else if (ret_value == 1)  // Success
2485 dj.gorey 1.25             {
2486 schuur   1.18                 // if It is an indication provider
2487 dj.gorey 1.25                 // remove the entry from the table since the
2488 schuur   1.18                 // provider has been disabled
2489                               if (_indicationProviders[i])
2490 dj.gorey 1.25                 {
2491 kumpf    1.27                     delete _removeEntry(_generateKey(pName,physicalName));
2492 dj.gorey 1.25                 }
2493                           }
2494 schuur   1.18             else
2495                           {
2496 dj.gorey 1.25                 // disable failed for other reason, throw exception
2497 schuur   1.18                 throw PEGASUS_CIM_EXCEPTION_L(
2498                                   CIM_ERR_FAILED,
2499                                   MessageLoaderParms(
2500                                       "ProviderManager.ProviderManagerService."
2501                                           "DISABLE_PROVIDER_FAILED",
2502                                       "Failed to disable the provider."));
2503                           }
2504                       }
2505                   }
2506                   catch(CIMException & e)
2507                   {
2508 dj.gorey 1.25         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2509 schuur   1.18                          "Exception: " + e.getMessage());
2510                       cimException = e;
2511                   }
2512                   catch(Exception & e)
2513                   {
2514 dj.gorey 1.25         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2515 schuur   1.18                          "Exception: " + e.getMessage());
2516                       cimException = CIMException(CIM_ERR_FAILED, e.getMessage());
2517                   }
2518                   catch(...)
2519                   {
2520 dj.gorey 1.25         PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
2521 schuur   1.18                          "Exception: Unknown");
2522                       //l10n
2523                       //response->cimException = CIMException(CIM_ERR_FAILED, "Unknown Error");
2524                       cimException = PEGASUS_CIM_EXCEPTION_L(
2525                           CIM_ERR_FAILED,
2526                           MessageLoaderParms(
2527                               "ProviderManager.ProviderManagerService.UNKNOWN_ERROR",
2528                               "Unknown Error"));
2529 chip     1.1      }
2530               
2531 kumpf    1.28     if (cimException.getCode() == CIM_ERR_SUCCESS)
2532                   {
2533                       // Status is set to OK if a provider was busy
2534                       if (operationalStatus.size() == 0)
2535                       {
2536 kumpf    1.38             operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_STOPPED);
2537 kumpf    1.28         }
2538                   }
2539                   else
2540                   {
2541                       // If exception occurs, module is not stopped
2542 kumpf    1.38         operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK);
2543 kumpf    1.28     }
2544               
2545 chip     1.1      CIMDisableModuleResponseMessage * response =
2546                       new CIMDisableModuleResponseMessage(
2547 kumpf    1.28             request->messageId,
2548                           CIMException(),
2549                           request->queueIds.copyAndPop(),
2550                           operationalStatus);
2551 chip     1.1  
2552                   // preserve message key
2553                   response->setKey(request->getKey());
2554               
2555                   //  Set HTTP method in response from request
2556                   response->setHttpMethod (request->getHttpMethod ());
2557               
2558                   PEG_METHOD_EXIT();
2559               
2560                   return(response);
2561               }
2562               
2563 dj.gorey 1.25 Message * DefaultProviderManager::handleEnableModuleRequest(const Message * message)
2564 chip     1.1  {
2565                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleEnableModuleRequest");
2566               
2567                   CIMEnableModuleRequestMessage * request =
2568                       dynamic_cast<CIMEnableModuleRequestMessage *>(const_cast<Message *>(message));
2569               
2570                   PEGASUS_ASSERT(request != 0);
2571               
2572                   Array<Uint16> operationalStatus;
2573 kumpf    1.38     operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK);
2574 chip     1.1  
2575                   CIMEnableModuleResponseMessage * response =
2576                       new CIMEnableModuleResponseMessage(
2577 kumpf    1.28             request->messageId,
2578                           CIMException(),
2579                           request->queueIds.copyAndPop(),
2580                           operationalStatus);
2581 chip     1.1  
2582                   // preserve message key
2583                   response->setKey(request->getKey());
2584               
2585                   //  Set HTTP method in response from request
2586                   response->setHttpMethod (request->getHttpMethod ());
2587               
2588                   PEG_METHOD_EXIT();
2589                   return(response);
2590               }
2591               
2592 dj.gorey 1.25 Message * DefaultProviderManager::handleStopAllProvidersRequest(const Message * message)
2593 chip     1.1  {
2594                   PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleStopAllProvidersRequest");
2595               
2596                   CIMStopAllProvidersRequestMessage * request =
2597                       dynamic_cast<CIMStopAllProvidersRequestMessage *>(const_cast<Message *>(message));
2598               
2599                   PEGASUS_ASSERT(request != 0);
2600               
2601                   CIMStopAllProvidersResponseMessage * response =
2602                       new CIMStopAllProvidersResponseMessage(
2603                       request->messageId,
2604                       CIMException(),
2605                       request->queueIds.copyAndPop());
2606               
2607                   PEGASUS_ASSERT(response != 0);
2608               
2609                   // preserve message key
2610                   response->setKey(request->getKey());
2611               
2612                   //  Set HTTP method in response from request
2613                   response->setHttpMethod (request->getHttpMethod ());
2614 chip     1.1  
2615                   // tell the provider manager to shutdown all the providers
2616 schuur   1.10     providerManager.shutdownAllProviders();
2617 chip     1.1  
2618                   PEG_METHOD_EXIT();
2619               
2620                   return(response);
2621               }
2622               
2623               void DefaultProviderManager::_insertEntry (
2624                   const Provider & provider,
2625                   const EnableIndicationsResponseHandler *handler)
2626               {
2627 carolann.graves 1.41     PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
2628 chip            1.1          "DefaultProviderManager::_insertEntry");
2629                      
2630                          String tableKey = _generateKey
2631                              (provider);
2632                      
2633                          _responseTable.insert (tableKey, const_cast<EnableIndicationsResponseHandler *>(handler));
2634                      
2635                          PEG_METHOD_EXIT();
2636                      }
2637                      
2638                      EnableIndicationsResponseHandler * DefaultProviderManager::_removeEntry(
2639                          const String & key)
2640                      {
2641 carolann.graves 1.41     PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
2642 chip            1.1          "DefaultProviderManager::_removeEntry");
2643                          EnableIndicationsResponseHandler *ret = 0;
2644                      
2645                          _responseTable.lookup(key, ret);
2646 dj.gorey        1.25     _responseTable.remove(key);         // why is this needed ? - we get killed when removed...
2647 chip            1.1  
2648                          PEG_METHOD_EXIT();
2649                      
2650                          return(ret);
2651                      }
2652                      
2653                      String DefaultProviderManager::_generateKey (
2654                          const Provider & provider)
2655                      {
2656                          String tableKey;
2657                      
2658 carolann.graves 1.41     PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
2659 chip            1.1          "DefaultProviderManager::_generateKey");
2660                      
2661                          //
2662                          //  Append provider key values to key
2663                          //
2664                          String providerName = provider.getName();
2665                          String providerFileName = provider.getModule()->getFileName();
2666                          tableKey.append (providerName);
2667                          tableKey.append (providerFileName);
2668                      
2669                          PEG_METHOD_EXIT();
2670                      
2671                          return(tableKey);
2672 schuur          1.18 }
2673                      
2674                      String DefaultProviderManager::_generateKey (
2675                          const String & providerName,
2676                          const String & providerFileName)
2677                      {
2678                          String tableKey;
2679                      
2680 carolann.graves 1.41     PEG_METHOD_ENTER (TRC_PROVIDERMANAGER,
2681 schuur          1.18                       "DefaultProviderManagerService::_generateKey");
2682                      
2683                          //
2684                          //  Append providerName and providerFileName to key
2685                          //
2686                          tableKey.append (providerName);
2687                          tableKey.append (providerFileName);
2688                      
2689                          PEG_METHOD_EXIT ();
2690                          return tableKey;
2691 chip            1.5  }
2692                      
2693 kumpf           1.28 ProviderName DefaultProviderManager::_resolveProviderName(
2694                          const ProviderIdContainer & providerId)
2695 chip            1.5  {
2696 kumpf           1.28     String providerName;
2697                          String fileName;
2698                          String interfaceName;
2699                          CIMValue genericValue;
2700                      
2701                          genericValue = providerId.getProvider().getProperty(
2702                              providerId.getProvider().findProperty("Name")).getValue();
2703                          genericValue.get(providerName);
2704                      
2705                          genericValue = providerId.getModule().getProperty(
2706                              providerId.getModule().findProperty("Location")).getValue();
2707                          genericValue.get(fileName);
2708                          fileName = _resolvePhysicalName(fileName);
2709                      
2710                          // ATTN: This attribute is probably not required
2711                          genericValue = providerId.getModule().getProperty(
2712                              providerId.getModule().findProperty("InterfaceType")).getValue();
2713                          genericValue.get(interfaceName);
2714 chip            1.5  
2715 kumpf           1.28     return ProviderName(providerName, fileName, interfaceName, 0);
2716 schuur          1.23 }
2717                      
2718 kumpf           1.31 Boolean DefaultProviderManager::hasActiveProviders()
2719                      {
2720                          return providerManager.hasActiveProviders();
2721                      }
2722                      
2723                      void DefaultProviderManager::unloadIdleProviders()
2724 schuur          1.23 {
2725 kumpf           1.31     providerManager.unloadIdleProviders();
2726 chip            1.1  }
2727                      
2728 kumpf           1.26 PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2