(file) Return to ProviderMessageFacade.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Server

   1 karl  1.49 //%2006////////////////////////////////////////////////////////////////////////
   2 kumpf 1.1  //
   3 karl  1.39 // 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.31 // IBM Corp.; EMC Corporation, The Open Group.
   7 karl  1.39 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   9 karl  1.41 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
  10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
  11 karl  1.49 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
  12            // EMC Corporation; Symantec Corporation; The Open Group.
  13 kumpf 1.1  //
  14            // Permission is hereby granted, free of charge, to any person obtaining a copy
  15            // of this software and associated documentation files (the "Software"), to
  16            // deal in the Software without restriction, including without limitation the
  17            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  18            // sell copies of the Software, and to permit persons to whom the Software is
  19            // furnished to do so, subject to the following conditions:
  20 karl  1.31 // 
  21 kumpf 1.1  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
  22            // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
  23            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
  24            // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  25            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  26            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  27            // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29            //
  30            //==============================================================================
  31            //
  32 karl  1.44 // This module provides the calling facade for control providers.
  33            // Accepting CIMMessages on the input side it provides calls for each of
  34            // the CIM provider operations to control providers setting up the
  35            // appropriate context for each call and processing handler responses.
  36            // NOTE: Today the execquery is NOT SUPPORTED by this facade.
  37            //
  38 kumpf 1.1  // Author: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
  39            //
  40            // Modified By:
  41 kumpf 1.14 //               Carol Ann Krug Graves, Hewlett-Packard Company
  42            //                   (carolann_graves@hp.com)
  43 dj.gorey 1.32 //               Dan Gorey, IBM (djgorey@us.ibm.com)
  44 a.arora  1.35 //               Amit K Arora, IBM (amita@in.ibm.com) for PEP#101
  45 se.gupta 1.36 //				 Seema Gupta (gseema@in.ibm.com) for PEP135
  46 se.gupta 1.38 //				 Seema Gupta (gseema@in.ibm.com) for Bug#1441
  47 aruran.ms 1.45 //               Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3766
  48 j.alex    1.46 //               John Alex, IBM (johnalex@us.ibm.com) - Bug#2290
  49 kumpf     1.1  //
  50                //%/////////////////////////////////////////////////////////////////////////////
  51                
  52                #include "ProviderMessageFacade.h"
  53 chip      1.29 
  54 kumpf     1.1  #include <Pegasus/Common/CIMMessage.h>
  55                #include <Pegasus/Common/OperationContext.h>
  56                #include <Pegasus/Common/Tracer.h>
  57 humberto  1.34 #include <Pegasus/Common/Thread.h>
  58 humberto  1.27 // l10n
  59                #include <Pegasus/Common/MessageLoader.h>
  60 a.arora   1.35 #include <Pegasus/Common/AutoPtr.h>
  61 humberto  1.27 
  62 schuur    1.33 #include <Pegasus/ProviderManager2/SimpleResponseHandler.h>
  63 chip      1.29 
  64 kumpf     1.11 PEGASUS_USING_STD;
  65                
  66 kumpf     1.1  PEGASUS_NAMESPACE_BEGIN
  67                
  68 kumpf     1.25 ProviderMessageFacade::ProviderMessageFacade(CIMProvider* provider)
  69 kumpf     1.1      : ProviderFacade(provider)
  70                {
  71                }
  72                
  73                ProviderMessageFacade::~ProviderMessageFacade(void)
  74 konrad.r  1.43 {  
  75                   // Terminate the control provider. The 'terminate' calls the control
  76                   // provider 'terminiate' function which should delete the object.
  77                  terminate();
  78 kumpf     1.1  }
  79                
  80                
  81                Message * ProviderMessageFacade::handleRequestMessage(Message * message) throw()
  82                {
  83 kumpf     1.13    Message * response = 0;
  84 humberto  1.34 
  85                   CIMMessage * msg = dynamic_cast<CIMMessage *>(message);
  86                
  87                   if(msg != NULL)
  88                   {
  89 kumpf     1.48    	AcceptLanguageList *langs = new AcceptLanguageList(((AcceptLanguageListContainer)msg->operationContext.get
  90 se.gupta  1.36 		   (AcceptLanguageListContainer:: NAME)).getLanguages());
  91                	Thread::setLanguages(langs);
  92 humberto  1.34    }
  93                   else
  94                   {
  95                   	Thread::clearLanguages();
  96                   }
  97 kumpf     1.13 
  98 chip      1.10    try
  99 mday      1.9     {
 100 chip      1.10 
 101 kumpf     1.1      // pass the request message to a handler method based on message type
 102                    switch(message->getType())
 103                    {
 104                    case CIM_GET_INSTANCE_REQUEST_MESSAGE:
 105 kumpf     1.13         response = _handleGetInstanceRequest(message);
 106 kumpf     1.1          break;
 107                    case CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE:
 108 kumpf     1.13 	response = _handleEnumerateInstancesRequest(message);
 109 kumpf     1.1  	break;
 110                    case CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE:
 111 kumpf     1.13 	response = _handleEnumerateInstanceNamesRequest(message);
 112 kumpf     1.1  	break;
 113                    case CIM_CREATE_INSTANCE_REQUEST_MESSAGE:
 114 kumpf     1.13 	response = _handleCreateInstanceRequest(message);
 115 kumpf     1.1  	break;
 116 mday      1.9         case CIM_MODIFY_INSTANCE_REQUEST_MESSAGE:
 117                       {
 118 chip      1.10 	
 119 kumpf     1.19        //cout << " ProviderMessageFacade::handleRequestMessage " << endl;
 120 chip      1.10 
 121 mday      1.9         Message *ret = _handleModifyInstanceRequest(message);
 122 kumpf     1.19        //cout << " modify instance response " << "type " << ret->getType() << " dest " << ret->dest << endl;
 123 chip      1.10 
 124 kumpf     1.19        //cout << " leaving ProviderMessageFacade::handleRequestMessage " << endl;
 125 kumpf     1.13        response = ret;
 126 mday      1.9         }
 127 chip      1.10 
 128 mday      1.9         break;
 129                
 130 kumpf     1.1      case CIM_DELETE_INSTANCE_REQUEST_MESSAGE:
 131 kumpf     1.13        response = _handleDeleteInstanceRequest(message);
 132 kumpf     1.1  	break;
 133                    case CIM_EXEC_QUERY_REQUEST_MESSAGE:
 134 kumpf     1.13 	response = _handleExecuteQueryRequest(message);
 135 kumpf     1.1  	break;
 136                    case CIM_ASSOCIATORS_REQUEST_MESSAGE:
 137 kumpf     1.13 	response = _handleAssociatorsRequest(message);
 138 kumpf     1.1  	break;
 139                    case CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE:
 140 kumpf     1.13 	response = _handleAssociatorNamesRequest(message);
 141 kumpf     1.1  	break;
 142                    case CIM_REFERENCES_REQUEST_MESSAGE:
 143 kumpf     1.13 	response = _handleReferencesRequest(message);
 144 kumpf     1.1  	break;
 145                    case CIM_REFERENCE_NAMES_REQUEST_MESSAGE:
 146 kumpf     1.13 	response = _handleReferenceNamesRequest(message);
 147 kumpf     1.1  	break;
 148                    case CIM_GET_PROPERTY_REQUEST_MESSAGE:
 149 kumpf     1.13 	response = _handleGetPropertyRequest(message);
 150 kumpf     1.1  	break;
 151                    case CIM_SET_PROPERTY_REQUEST_MESSAGE:
 152 kumpf     1.13 	response = _handleSetPropertyRequest(message);
 153 kumpf     1.1  	break;
 154                    case CIM_INVOKE_METHOD_REQUEST_MESSAGE:
 155 kumpf     1.13 	response = _handleInvokeMethodRequest(message);
 156 kumpf     1.1  	break;
 157                    case CIM_GET_CLASS_REQUEST_MESSAGE:
 158                    case CIM_ENUMERATE_CLASSES_REQUEST_MESSAGE:
 159                    case CIM_ENUMERATE_CLASS_NAMES_REQUEST_MESSAGE:
 160                    case CIM_CREATE_CLASS_REQUEST_MESSAGE:
 161                    case CIM_MODIFY_CLASS_REQUEST_MESSAGE:
 162                    case CIM_DELETE_CLASS_REQUEST_MESSAGE:
 163                    default:
 164                	// unsupported messages are ignored
 165                	break;
 166                    }
 167 mday      1.9     }
 168 chip      1.10    catch( ... )
 169 mday      1.9     {
 170 kumpf     1.19       //cout << "caught exception in ProviderMessageFacade::handleRequestMessage" << endl;
 171 mday      1.9        ;
 172                   }
 173 chip      1.10 
 174 kumpf     1.20     //delete message;
 175 kumpf     1.13 
 176 kumpf     1.26     //
 177 j.alex    1.46     //  Set HTTP method, Key, closeConnect in response from request
 178 kumpf     1.26     //
 179 j.alex    1.46     ((CIMResponseMessage *)response)->syncAttributes((CIMRequestMessage*)message);
 180 kumpf     1.26 
 181 kumpf     1.13     return(response);
 182 kumpf     1.1  }
 183                
 184 se.gupta  1.38 /* Since the caller of _handleXXX methods (handleRequestMessage)  is not expected to 
 185                throw an exception (indicated by the empty throw() clause on handleRequestMessage), all the 
 186                _handleXXX methods also shouldn't throw an exception */
 187                
 188                Message * ProviderMessageFacade::_handleGetInstanceRequest(Message * message) 
 189 kumpf     1.1  {
 190                    const CIMGetInstanceRequestMessage * request =
 191                	dynamic_cast<CIMGetInstanceRequestMessage *>(message);
 192                
 193 w.white   1.42     STAT_GETSTARTTIME
 194                
 195 kumpf     1.1      PEGASUS_ASSERT(request != 0);
 196                
 197 kumpf     1.7      CIMException cimException;
 198 kumpf     1.1      CIMInstance cimInstance;
 199 kumpf     1.48     ContentLanguageList contentLangs;
 200 kumpf     1.1  
 201                    try
 202                    {
 203                	// make target object path
 204                	CIMObjectPath objectPath(
 205                	    System::getHostName(),
 206                	    request->nameSpace,
 207                	    request->instanceName.getClassName(),
 208                	    request->instanceName.getKeyBindings());
 209                
 210 aruran.ms 1.45 	/* convert arguments
 211 kumpf     1.1  	OperationContext context;
 212                
 213 aruran.ms 1.45 	 add the user name and accept and content Languages to the context
 214 se.gupta  1.36 	context.insert(request->operationContext.get(IdentityContainer::NAME));
 215                	context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 216                	context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 217 aruran.ms 1.45     */
 218 kumpf     1.1  	CIMPropertyList propertyList(request->propertyList);
 219                
 220 kumpf     1.23 	SimpleInstanceResponseHandler handler;
 221 kumpf     1.1  
 222                	// forward request
 223                	getInstance(
 224 aruran.ms 1.45 	    request->operationContext,
 225 kumpf     1.1  	    objectPath,
 226 kumpf     1.24 	    request->includeQualifiers,
 227                	    request->includeClassOrigin,
 228 kumpf     1.8  	    propertyList,
 229 kumpf     1.1  	    handler);
 230                
 231                	// error? provider claims success, but did not deliver an instance.
 232                	if(handler.getObjects().size() == 0)
 233                	{
 234 mday      1.9  	   // << Mon Apr 29 12:40:36 2002 mdd >>
 235 kumpf     1.22 //	    throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_FOUND, String::EMPTY);
 236 humberto  1.27 
 237                	  // l10n
 238                
 239                	  cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
 240                
 241                	  // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
 242                
 243 kumpf     1.1  	}
 244                
 245                	// save returned instance
 246                	cimInstance = handler.getObjects()[0];
 247 chuck     1.28         contentLangs = handler.getLanguages();  // l10n
 248 kumpf     1.1      }
 249                    catch(CIMException & e)
 250                    {
 251 kumpf     1.7          cimException = e;
 252 kumpf     1.1      }
 253                    catch(Exception & e)
 254                    {
 255 kumpf     1.7          cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
 256 kumpf     1.1      }
 257                    catch(...)
 258                    {
 259 humberto  1.27       // l10n
 260 chip      1.29 
 261 humberto  1.27       cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
 262                      // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
 263 kumpf     1.1      }
 264                
 265                    // create response message
 266 a.arora   1.35     AutoPtr<CIMGetInstanceResponseMessage> response(
 267 kumpf     1.1  	new CIMGetInstanceResponseMessage(
 268                	    request->messageId,
 269 kumpf     1.7  	    cimException,
 270 kumpf     1.1  	    request->queueIds.copyAndPop(),
 271 se.gupta  1.37 	    cimInstance));  // l10n
 272                
 273 w.white   1.42     STAT_PMS_PROVIDEREND
 274                
 275 se.gupta  1.37 	response->operationContext.set(ContentLanguageListContainer(contentLangs));
 276 kumpf     1.1  
 277                    // preserve message key
 278                    response->setKey(request->getKey());
 279                
 280 a.arora   1.35     return response.release();
 281 kumpf     1.1  }
 282                
 283 se.gupta  1.38 Message * ProviderMessageFacade::_handleEnumerateInstancesRequest(Message * message) 
 284 kumpf     1.1  {
 285 w.white   1.42     
 286                
 287 kumpf     1.1      const CIMEnumerateInstancesRequestMessage * request =
 288                	dynamic_cast<CIMEnumerateInstancesRequestMessage *>(message);
 289                
 290 w.white   1.42     STAT_GETSTARTTIME
 291                
 292 kumpf     1.1      PEGASUS_ASSERT(request != 0);
 293                
 294 kumpf     1.7      CIMException cimException;
 295 kumpf     1.14     Array<CIMInstance> cimInstances;
 296 kumpf     1.48     ContentLanguageList contentLangs;
 297 kumpf     1.1  
 298                    try
 299                    {
 300                	// make target object path
 301                	CIMObjectPath objectPath(
 302                	    System::getHostName(),
 303                	    request->nameSpace,
 304                	    request->className);
 305                
 306 aruran.ms 1.45 	/* convert arguments
 307 kumpf     1.1  	OperationContext context;
 308                
 309 se.gupta  1.36 	// add the user name and accept and content Languages to the context
 310                	context.insert(request->operationContext.get(IdentityContainer::NAME));
 311                	context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 312                	context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 313 aruran.ms 1.45     */
 314 chuck     1.28 
 315 kumpf     1.1  	CIMPropertyList propertyList(request->propertyList);
 316                
 317 kumpf     1.23 	SimpleInstanceResponseHandler handler;
 318 kumpf     1.1  
 319                	enumerateInstances(
 320 aruran.ms 1.45 	    request->operationContext,
 321 kumpf     1.1  	    objectPath,
 322 kumpf     1.24 	    request->includeQualifiers,
 323                	    request->includeClassOrigin,
 324 kumpf     1.8  	    propertyList,
 325 kumpf     1.1  	    handler);
 326                
 327 kumpf     1.15 	// save returned instances
 328                        cimInstances = handler.getObjects();
 329 chuck     1.28         contentLangs = handler.getLanguages();  // l10n
 330 kumpf     1.1      }
 331                    catch(CIMException & e)
 332                    {
 333 kumpf     1.7          cimException = e;
 334 kumpf     1.1      }
 335                    catch(Exception & e)
 336                    {
 337 kumpf     1.7          cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
 338 kumpf     1.1      }
 339                    catch(...)
 340                    {
 341 humberto  1.27       // l10n
 342 chip      1.29 
 343 humberto  1.27       cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
 344                      // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
 345 kumpf     1.1      }
 346                
 347                    // create response message
 348 a.arora   1.35     AutoPtr<CIMEnumerateInstancesResponseMessage> response(
 349 kumpf     1.1  	new CIMEnumerateInstancesResponseMessage(
 350                	    request->messageId,
 351 kumpf     1.7  	    cimException,
 352 kumpf     1.1  	    request->queueIds.copyAndPop(),
 353 se.gupta  1.37 	    cimInstances));  // l10n
 354                
 355 w.white   1.42     STAT_PMS_PROVIDEREND
 356                
 357 se.gupta  1.37 	response->operationContext.set(ContentLanguageListContainer(contentLangs));
 358 kumpf     1.1  
 359                    // preserve message key
 360                    response->setKey(request->getKey());
 361                
 362 a.arora   1.35     return response.release();
 363 kumpf     1.1  }
 364                
 365 se.gupta  1.38 Message * ProviderMessageFacade::_handleEnumerateInstanceNamesRequest(Message * message) 
 366 kumpf     1.1  {
 367 w.white   1.42     
 368                
 369 kumpf     1.1      const CIMEnumerateInstanceNamesRequestMessage * request =
 370                	dynamic_cast<CIMEnumerateInstanceNamesRequestMessage *>(message);
 371                
 372 w.white   1.42     STAT_GETSTARTTIME
 373                
 374 kumpf     1.1      PEGASUS_ASSERT(request != 0);
 375                
 376 kumpf     1.7      CIMException cimException;
 377 kumpf     1.12     Array<CIMObjectPath> cimReferences;
 378 kumpf     1.48     ContentLanguageList contentLangs;
 379 kumpf     1.1  
 380                    try
 381                    {
 382                	// make target object path
 383                	CIMObjectPath objectPath(
 384                	    System::getHostName(),
 385                	    request->nameSpace,
 386                	    request->className);
 387                
 388 aruran.ms 1.45 	/* convert arguments
 389 kumpf     1.1  	OperationContext context;
 390                
 391 aruran.ms 1.45 	 add the user name and accept and content Languages to the context
 392 se.gupta  1.36 	context.insert(request->operationContext.get(IdentityContainer::NAME));
 393                	context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 394                	context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 395 aruran.ms 1.45     */
 396 kumpf     1.23 	SimpleObjectPathResponseHandler handler;
 397 kumpf     1.1  
 398                	enumerateInstanceNames(
 399 aruran.ms 1.45 	    request->operationContext,
 400 kumpf     1.1  	    objectPath,
 401                	    handler);
 402                
 403                	// save returned instance
 404                	cimReferences = handler.getObjects();
 405 chuck     1.28         contentLangs = handler.getLanguages();  // l10n
 406 kumpf     1.1      }
 407                    catch(CIMException & e)
 408                    {
 409 kumpf     1.7          cimException = e;
 410 kumpf     1.1      }
 411                    catch(Exception & e)
 412                    {
 413 kumpf     1.7          cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
 414 kumpf     1.1      }
 415                    catch(...)
 416                    {
 417 humberto  1.27       // l10n
 418                
 419                      cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
 420                      // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
 421 kumpf     1.1      }
 422                
 423                    // create response message
 424 a.arora   1.35     AutoPtr<CIMEnumerateInstanceNamesResponseMessage> response(
 425 kumpf     1.1  	new CIMEnumerateInstanceNamesResponseMessage(
 426                	    request->messageId,
 427 kumpf     1.7  	    cimException,
 428 kumpf     1.1  	    request->queueIds.copyAndPop(),
 429 se.gupta  1.37 	    cimReferences));  //l10n
 430 kumpf     1.1  
 431 w.white   1.42     STAT_PMS_PROVIDEREND
 432                
 433 se.gupta  1.37 	response->operationContext.set(ContentLanguageListContainer(contentLangs));
 434 kumpf     1.1      // preserve message key
 435                    response->setKey(request->getKey());
 436                
 437 a.arora   1.35     return response.release();
 438 kumpf     1.1  }
 439                
 440 se.gupta  1.38 Message * ProviderMessageFacade::_handleCreateInstanceRequest(Message * message) 
 441 kumpf     1.1  {
 442                    const CIMCreateInstanceRequestMessage * request =
 443                	dynamic_cast<CIMCreateInstanceRequestMessage *>(message);
 444                
 445 w.white   1.42     STAT_GETSTARTTIME
 446                
 447 kumpf     1.1      PEGASUS_ASSERT(request != 0);
 448                
 449 kumpf     1.7      CIMException cimException;
 450 kumpf     1.1      CIMInstance cimInstance;
 451 kumpf     1.12     CIMObjectPath instanceName;
 452 kumpf     1.48     ContentLanguageList contentLangs;
 453 kumpf     1.1  
 454                    try
 455                    {
 456                	// make target object path
 457                	CIMObjectPath objectPath(
 458                	    System::getHostName(),
 459                	    request->nameSpace,
 460                	    request->newInstance.getPath().getClassName(),
 461                	    request->newInstance.getPath().getKeyBindings());
 462                
 463 aruran.ms 1.45 	/* convert arguments
 464 kumpf     1.1  	OperationContext context;
 465                
 466 se.gupta  1.36 	// add the user name and accept and content Languages to the context
 467                	context.insert(request->operationContext.get(IdentityContainer::NAME));
 468                	context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 469                	context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 470 aruran.ms 1.45     */
 471 kumpf     1.23 	SimpleObjectPathResponseHandler handler;
 472 kumpf     1.1  
 473                	// forward request
 474                	createInstance(
 475 aruran.ms 1.45 	    request->operationContext,
 476 kumpf     1.1  	    objectPath,
 477                	    request->newInstance,
 478                	    handler);
 479                
 480                	// error? provider claims success, but did not deliver an
 481                	// instance name.
 482                	if(handler.getObjects().size() == 0)
 483                	{
 484 kumpf     1.22 //	    throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_FOUND, String::EMPTY);
 485 mday      1.9  	   // << Mon Apr 29 12:40:57 2002 mdd >>
 486 chip      1.29 	
 487 humberto  1.27 	  // l10n
 488                
 489                	  cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
 490                	  // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
 491 kumpf     1.1  	}
 492                
 493                	// save returned instance name
 494                	instanceName = handler.getObjects()[0];
 495 chuck     1.28         contentLangs = handler.getLanguages();  // l10n
 496 kumpf     1.1      }
 497                    catch(CIMException & e)
 498                    {
 499 kumpf     1.7          cimException = e;
 500 kumpf     1.1      }
 501                    catch(Exception & e)
 502                    {
 503 kumpf     1.7          cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
 504 kumpf     1.1      }
 505                    catch(...)
 506                    {
 507 humberto  1.27       // l10n
 508 chip      1.29 
 509 humberto  1.27       cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
 510                      // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
 511 kumpf     1.1      }
 512                
 513                    // create response message
 514 a.arora   1.35     AutoPtr<CIMCreateInstanceResponseMessage> response(
 515 kumpf     1.1  	new CIMCreateInstanceResponseMessage(
 516                	    request->messageId,
 517 kumpf     1.7  	    cimException,
 518 kumpf     1.1  	    request->queueIds.copyAndPop(),
 519 se.gupta  1.37 	    instanceName));  // l10n
 520                
 521 w.white   1.42     STAT_PMS_PROVIDEREND
 522                
 523 se.gupta  1.37 	response->operationContext.set(ContentLanguageListContainer(contentLangs));
 524 kumpf     1.1  
 525                    // preserve message key
 526                    response->setKey(request->getKey());
 527                
 528 a.arora   1.35     return response.release();
 529 kumpf     1.1  }
 530                
 531 se.gupta  1.38 Message * ProviderMessageFacade::_handleModifyInstanceRequest(Message * message) 
 532 kumpf     1.1  {
 533                    const CIMModifyInstanceRequestMessage * request =
 534                	dynamic_cast<CIMModifyInstanceRequestMessage *>(message);
 535                
 536 w.white   1.42     STAT_GETSTARTTIME
 537                
 538 kumpf     1.1      PEGASUS_ASSERT(request != 0);
 539                
 540 kumpf     1.7      CIMException cimException;
 541 kumpf     1.12     CIMObjectPath instanceName;
 542 kumpf     1.1  
 543 kumpf     1.19     //cout << "ProviderMessageFacade::_handleModifyInstanceRequest" << endl;
 544 chip      1.10 
 545 mday      1.9  
 546 kumpf     1.1      try
 547                    {
 548                	// make target object path
 549                	CIMObjectPath objectPath(
 550                	    System::getHostName(),
 551                	    request->nameSpace,
 552 kumpf     1.14 	    request->modifiedInstance.getPath ().getClassName(),
 553                	    request->modifiedInstance.getPath ().getKeyBindings());
 554 kumpf     1.1  
 555                	// convert arguments
 556 aruran.ms 1.45     /*	OperationContext context;
 557 kumpf     1.1  
 558 se.gupta  1.36 	// add the user name and accept and content Languages to the context
 559                	context.insert(request->operationContext.get(IdentityContainer::NAME));
 560                	context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 561                	context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 562 aruran.ms 1.45     */
 563 kumpf     1.1  	CIMPropertyList propertyList(request->propertyList);
 564                
 565 kumpf     1.23 	SimpleResponseHandler handler;
 566 kumpf     1.1  
 567                	// forward request
 568                	modifyInstance(
 569 aruran.ms 1.45 	    request->operationContext,
 570 kumpf     1.6  	    objectPath,
 571 kumpf     1.14 	    request->modifiedInstance,
 572 kumpf     1.24 	    request->includeQualifiers,
 573 kumpf     1.8  	    propertyList,
 574 kumpf     1.1  	    handler);
 575                    }
 576                    catch(CIMException & e)
 577                    {
 578 kumpf     1.7          cimException = e;
 579 kumpf     1.1      }
 580                    catch(Exception & e)
 581                    {
 582 kumpf     1.7          cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
 583 kumpf     1.1      }
 584                    catch(...)
 585                    {
 586 humberto  1.27       // l10n
 587 chip      1.29 
 588 humberto  1.27       cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
 589                      //  cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
 590 kumpf     1.1      }
 591                
 592                    // create response message
 593 a.arora   1.35     AutoPtr<CIMModifyInstanceResponseMessage> response(
 594 kumpf     1.1  	new CIMModifyInstanceResponseMessage(
 595                	    request->messageId,
 596 kumpf     1.7  	    cimException,
 597 a.arora   1.35 	    request->queueIds.copyAndPop()));
 598 kumpf     1.1  
 599 w.white   1.42     STAT_PMS_PROVIDEREND
 600                
 601 kumpf     1.1      // preserve message key
 602                    response->setKey(request->getKey());
 603                
 604 a.arora   1.35     return response.release();
 605 kumpf     1.1  }
 606                
 607 se.gupta  1.38 Message * ProviderMessageFacade::_handleDeleteInstanceRequest(Message * message) 
 608 kumpf     1.1  {
 609                    const CIMDeleteInstanceRequestMessage * request =
 610                	dynamic_cast<CIMDeleteInstanceRequestMessage *>(message);
 611                
 612 w.white   1.42     STAT_GETSTARTTIME
 613                
 614 kumpf     1.1      PEGASUS_ASSERT(request != 0);
 615                
 616 kumpf     1.7      CIMException cimException;
 617 kumpf     1.1  
 618                    try
 619                    {
 620                	// make target object path
 621                	CIMObjectPath objectPath(
 622                	    System::getHostName(),
 623                	    request->nameSpace,
 624                	    request->instanceName.getClassName(),
 625                	    request->instanceName.getKeyBindings());
 626                
 627                	// convert arguments
 628 aruran.ms 1.45     /*	OperationContext context;
 629 kumpf     1.1  
 630 se.gupta  1.36 	// add the user name and accept and content Languages to the context
 631                	context.insert(request->operationContext.get(IdentityContainer::NAME));
 632                	context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 633                	context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 634 aruran.ms 1.45     */
 635 kumpf     1.23 	SimpleResponseHandler handler;
 636 kumpf     1.1  
 637                	// forward request
 638                	deleteInstance(
 639 aruran.ms 1.45 	    request->operationContext,
 640 kumpf     1.1  	    objectPath,
 641                	    handler);
 642                    }
 643                    catch(CIMException & e)
 644                    {
 645 kumpf     1.7          cimException = e;
 646 kumpf     1.1      }
 647                    catch(Exception & e)
 648                    {
 649 kumpf     1.7          cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
 650 kumpf     1.1      }
 651                    catch(...)
 652                    {
 653 humberto  1.27       // l10n
 654 chip      1.29 
 655 humberto  1.27       cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
 656                      // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
 657 kumpf     1.1      }
 658                
 659                    // create response message
 660 a.arora   1.35     AutoPtr<CIMDeleteInstanceResponseMessage> response(
 661 kumpf     1.1  	new CIMDeleteInstanceResponseMessage(
 662                	    request->messageId,
 663 kumpf     1.7  	    cimException,
 664 a.arora   1.35 	    request->queueIds.copyAndPop()));
 665 kumpf     1.1  
 666 w.white   1.42     STAT_PMS_PROVIDEREND
 667                
 668 kumpf     1.1      // preserve message key
 669                    response->setKey(request->getKey());
 670                
 671 a.arora   1.35     return response.release();
 672 kumpf     1.1  }
 673                
 674 se.gupta  1.38 Message * ProviderMessageFacade::_handleExecuteQueryRequest(Message * message) 
 675 kumpf     1.1  {
 676                    const CIMExecQueryRequestMessage * request =
 677 karl      1.44         dynamic_cast<CIMExecQueryRequestMessage *>(message);
 678 kumpf     1.1  
 679 w.white   1.42     STAT_GETSTARTTIME
 680                
 681 kumpf     1.1      PEGASUS_ASSERT(request != 0);
 682                
 683 kumpf     1.16     Array<CIMObject> cimObjects;
 684 kumpf     1.1  
 685 humberto  1.27     // l10n
 686                
 687 a.arora   1.35     AutoPtr<CIMExecQueryResponseMessage> response(
 688 kumpf     1.1  	new CIMExecQueryResponseMessage(
 689                	    request->messageId,
 690 humberto  1.27 	    PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.NOT_IMPLEMENTED", "not implemented")),
 691 kumpf     1.1  	    request->queueIds.copyAndPop(),
 692 a.arora   1.35 	    cimObjects));
 693 kumpf     1.1  
 694 humberto  1.27     // CIMExecQueryResponseMessage * response =
 695                    // new CIMExecQueryResponseMessage(
 696                    //    request->messageId,
 697                    //    PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "not implemented"),
 698                    //    request->queueIds.copyAndPop(),
 699                    //    cimObjects);
 700                
 701 w.white   1.42     STAT_PMS_PROVIDEREND
 702                
 703 kumpf     1.1      // preserve message key
 704                    response->setKey(request->getKey());
 705                
 706 a.arora   1.35     return response.release();
 707 kumpf     1.1  }
 708                
 709 se.gupta  1.38 Message * ProviderMessageFacade::_handleAssociatorsRequest(Message * message) 
 710 kumpf     1.1  {
 711                    const CIMAssociatorsRequestMessage * request =
 712 karl      1.44         dynamic_cast<CIMAssociatorsRequestMessage *>(message);
 713 kumpf     1.1  
 714 w.white   1.42     STAT_GETSTARTTIME
 715                
 716 kumpf     1.1      PEGASUS_ASSERT(request != 0);
 717                
 718 karl      1.44     CIMException cimException;
 719 kumpf     1.16     Array<CIMObject> cimObjects;
 720 kumpf     1.48     ContentLanguageList contentLangs;
 721 kumpf     1.1  
 722 humberto  1.27     // l10n
 723 karl      1.44     try
 724                    {
 725                	// make target object path
 726                	CIMObjectPath objectPath(
 727                	    System::getHostName(),
 728                	    request->nameSpace,
 729                	    request->objectName.getClassName(),
 730                        request->objectName.getKeyBindings());
 731                
 732                	// convert arguments
 733 aruran.ms 1.45     /*	OperationContext context;
 734 karl      1.44 
 735                	// add the user name and accept and content Languages to the context
 736                	context.insert(request->operationContext.get(IdentityContainer::NAME));
 737                	context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 738                	context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 739 aruran.ms 1.45     */
 740 karl      1.44 	CIMPropertyList propertyList(request->propertyList);
 741                
 742                	SimpleObjectResponseHandler handler;
 743                
 744                	associators(
 745 aruran.ms 1.45 	    request->operationContext,
 746 karl      1.44 	    objectPath,
 747                        request->assocClass,
 748                        request->resultClass,
 749                        request->role,
 750                        request->resultRole,
 751                	    request->includeQualifiers,
 752                	    request->includeClassOrigin,
 753                	    propertyList,
 754                	    handler);
 755 humberto  1.27 
 756 karl      1.44 	// save returned Objects
 757                        cimObjects = handler.getObjects();
 758                        contentLangs = handler.getLanguages();  // l10n
 759                    }
 760                    catch(CIMException & e)
 761                    {
 762                        cimException = e;
 763                    }
 764                    catch(Exception & e)
 765                    {
 766                        cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
 767                    }
 768                    catch(...)
 769                    {
 770                      // l10n
 771                
 772                      cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
 773                      // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
 774                    }
 775                
 776                    // create response message
 777 a.arora   1.35     AutoPtr<CIMAssociatorsResponseMessage> response(
 778 kumpf     1.1  	new CIMAssociatorsResponseMessage(
 779                	    request->messageId,
 780 karl      1.44 	    cimException,
 781 kumpf     1.1  	    request->queueIds.copyAndPop(),
 782 karl      1.44 	    cimObjects));  // l10n
 783 kumpf     1.1  
 784 karl      1.44     STAT_PMS_PROVIDEREND
 785 humberto  1.27 
 786 karl      1.44     response->operationContext.set(ContentLanguageListContainer(contentLangs));
 787 w.white   1.42 
 788 kumpf     1.1      // preserve message key
 789                    response->setKey(request->getKey());
 790                
 791 a.arora   1.35     return response.release();
 792 kumpf     1.1  }
 793                
 794 se.gupta  1.38 Message * ProviderMessageFacade::_handleAssociatorNamesRequest(Message * message) 
 795 kumpf     1.1  {
 796                    const CIMAssociatorNamesRequestMessage * request =
 797 karl      1.44         dynamic_cast<CIMAssociatorNamesRequestMessage *>(message);
 798 kumpf     1.1  
 799 w.white   1.42     STAT_GETSTARTTIME
 800                
 801 kumpf     1.1      PEGASUS_ASSERT(request != 0);
 802                
 803 karl      1.44     CIMException cimException;
 804 kumpf     1.12     Array<CIMObjectPath> cimReferences;
 805 kumpf     1.48     ContentLanguageList contentLangs;
 806 karl      1.44 
 807                    try
 808                    {
 809                	// make target object path
 810                	CIMObjectPath objectPath(
 811                	    System::getHostName(),
 812                	    request->nameSpace,
 813                	    request->objectName.getClassName(),
 814                        request->objectName.getKeyBindings());
 815 kumpf     1.1  
 816 karl      1.44 	// convert arguments
 817 aruran.ms 1.45     /*	OperationContext context;
 818 karl      1.44 
 819                	// add the user name and accept and content Languages to the context
 820                	context.insert(request->operationContext.get(IdentityContainer::NAME));
 821                	context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 822                	context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 823 aruran.ms 1.45     */
 824 karl      1.44 	SimpleObjectPathResponseHandler handler;
 825                
 826                	associatorNames(
 827 aruran.ms 1.45 	    request->operationContext,
 828 karl      1.44 	    objectPath,
 829                        request->assocClass,
 830                        request->resultClass,
 831                        request->role,
 832                        request->resultRole,
 833                	    handler);
 834                
 835                	// save returned Objects
 836                        cimReferences = handler.getObjects();
 837                        contentLangs = handler.getLanguages();  // l10n
 838                    }
 839                    catch(CIMException & e)
 840                    {
 841                        cimException = e;
 842                    }
 843                    catch(Exception & e)
 844                    {
 845                        cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
 846                    }
 847                    catch(...)
 848                    {
 849 karl      1.44       // l10n
 850                
 851                      cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
 852                      // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
 853                    }
 854 humberto  1.27 
 855 karl      1.44     // create response message
 856 a.arora   1.35     AutoPtr<CIMAssociatorNamesResponseMessage> response(
 857 kumpf     1.1  	new CIMAssociatorNamesResponseMessage(
 858                	    request->messageId,
 859 karl      1.44 	    cimException,
 860 kumpf     1.1  	    request->queueIds.copyAndPop(),
 861 karl      1.44 	    cimReferences));  // l10n
 862 kumpf     1.1  
 863 karl      1.44     STAT_PMS_PROVIDEREND
 864 humberto  1.27 
 865 karl      1.44     response->operationContext.set(ContentLanguageListContainer(contentLangs));
 866 w.white   1.42 
 867 kumpf     1.1      // preserve message key
 868                    response->setKey(request->getKey());
 869                
 870 a.arora   1.35     return response.release();
 871 kumpf     1.1  }
 872 se.gupta  1.38 Message * ProviderMessageFacade::_handleReferencesRequest(Message * message) 
 873 kumpf     1.1  {
 874                    const CIMReferencesRequestMessage * request =
 875 karl      1.44         dynamic_cast<CIMReferencesRequestMessage *>(message);
 876 kumpf     1.1  
 877 w.white   1.42     STAT_GETSTARTTIME
 878                
 879 kumpf     1.1      PEGASUS_ASSERT(request != 0);
 880                
 881 karl      1.44     CIMException cimException;
 882 kumpf     1.16     Array<CIMObject> cimObjects;
 883 kumpf     1.48     ContentLanguageList contentLangs;
 884 kumpf     1.1  
 885 humberto  1.27     // l10n
 886                
 887 karl      1.44     try
 888                    {
 889                	// make target object path
 890                	CIMObjectPath objectPath(
 891                	    System::getHostName(),
 892                	    request->nameSpace,
 893                	    request->objectName.getClassName(),
 894                        request->objectName.getKeyBindings());
 895                
 896                	// convert arguments
 897 aruran.ms 1.45     /*	OperationContext context;
 898 karl      1.44 
 899                	// add the user name and accept and content Languages to the context
 900                	context.insert(request->operationContext.get(IdentityContainer::NAME));
 901                	context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 902 aruran.ms 1.45 	context.insert(request->operationContext.get(ContentLanguageListContainer::NAME));  
 903                    */
 904 karl      1.44 	CIMPropertyList propertyList(request->propertyList);
 905                
 906                	SimpleObjectResponseHandler handler;
 907                
 908                	references(
 909 aruran.ms 1.45 	    request->operationContext,
 910 karl      1.44 	    objectPath,
 911                        request->resultClass,
 912                        request->role,
 913                	    request->includeQualifiers,
 914                	    request->includeClassOrigin,
 915                	    propertyList,
 916                	    handler);
 917                
 918                	// save returned Objects
 919                        cimObjects = handler.getObjects();
 920                        contentLangs = handler.getLanguages();  // l10n
 921                    }
 922                    catch(CIMException & e)
 923                    {
 924                        cimException = e;
 925                    }
 926                    catch(Exception & e)
 927                    {
 928                        cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
 929                    }
 930                    catch(...)
 931 karl      1.44     {
 932                      // l10n
 933                
 934                      cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
 935                      // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
 936                    }
 937                
 938                    // create response message
 939 a.arora   1.35     AutoPtr<CIMReferencesResponseMessage> response(
 940 kumpf     1.1  	new CIMReferencesResponseMessage(
 941                	    request->messageId,
 942 karl      1.44 	    cimException,
 943 kumpf     1.1  	    request->queueIds.copyAndPop(),
 944 karl      1.44 	    cimObjects));  // l10n
 945 kumpf     1.1  
 946 karl      1.44     STAT_PMS_PROVIDEREND
 947 humberto  1.27 
 948 karl      1.44     response->operationContext.set(ContentLanguageListContainer(contentLangs));
 949 kumpf     1.1      // preserve message key
 950                    response->setKey(request->getKey());
 951                
 952 a.arora   1.35     return response.release();
 953 kumpf     1.1  }
 954                
 955 se.gupta  1.38 Message * ProviderMessageFacade::_handleReferenceNamesRequest(Message * message) 
 956 kumpf     1.1  {
 957                    const CIMReferenceNamesRequestMessage * request =
 958 karl      1.44         dynamic_cast<CIMReferenceNamesRequestMessage *>(message);
 959 kumpf     1.1  
 960 w.white   1.42     STAT_GETSTARTTIME
 961                
 962 kumpf     1.1      PEGASUS_ASSERT(request != 0);
 963                
 964 karl      1.44     CIMException cimException;
 965 kumpf     1.12     Array<CIMObjectPath> cimReferences;
 966 kumpf     1.48     ContentLanguageList contentLangs;
 967 karl      1.44 
 968                    try
 969                    {
 970                	// make target object path
 971                	CIMObjectPath objectPath(
 972                	    System::getHostName(),
 973                	    request->nameSpace,
 974                	    request->objectName.getClassName(),
 975                        request->objectName.getKeyBindings());
 976 kumpf     1.1  
 977 karl      1.44 	// convert arguments
 978 aruran.ms 1.45     /*	OperationContext context;
 979 karl      1.44 
 980                	// add the user name and accept and content Languages to the context
 981                	context.insert(request->operationContext.get(IdentityContainer::NAME));
 982                	context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
 983                	context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
 984 aruran.ms 1.45     */
 985 karl      1.44 	SimpleObjectPathResponseHandler handler;
 986                
 987                	referenceNames(
 988 aruran.ms 1.45 	    request->operationContext,
 989 karl      1.44 	    objectPath,
 990                        request->resultClass,
 991                        request->role,
 992                	    handler);
 993                
 994                	// save returned Objects
 995                        cimReferences = handler.getObjects();
 996                        contentLangs = handler.getLanguages();  // l10n
 997                    }
 998                    catch(CIMException & e)
 999                    {
1000                        cimException = e;
1001                    }
1002                    catch(Exception & e)
1003                    {
1004                        cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
1005                    }
1006                    catch(...)
1007                    {
1008                      // l10n
1009                
1010 karl      1.44       cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
1011                      // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
1012                    }
1013 humberto  1.27 
1014 karl      1.44     // create response message
1015 a.arora   1.35     AutoPtr<CIMReferenceNamesResponseMessage> response(
1016 kumpf     1.1  	new CIMReferenceNamesResponseMessage(
1017                	    request->messageId,
1018 karl      1.44 	    cimException,
1019 kumpf     1.1  	    request->queueIds.copyAndPop(),
1020 karl      1.44 	    cimReferences));  // l10n
1021                
1022                    STAT_PMS_PROVIDEREND
1023 kumpf     1.1  
1024 karl      1.44     response->operationContext.set(ContentLanguageListContainer(contentLangs));
1025 humberto  1.27 
1026 kumpf     1.1      // preserve message key
1027                    response->setKey(request->getKey());
1028                
1029 a.arora   1.35     return response.release();
1030 kumpf     1.1  }
1031                
1032 se.gupta  1.38 Message * ProviderMessageFacade::_handleGetPropertyRequest(Message * message) 
1033 kumpf     1.1  {
1034                    const CIMGetPropertyRequestMessage * request =
1035 karl      1.44         dynamic_cast<CIMGetPropertyRequestMessage *>(message);
1036 kumpf     1.1  
1037 w.white   1.42     STAT_GETSTARTTIME
1038                
1039 kumpf     1.1      PEGASUS_ASSERT(request != 0);
1040                
1041                    CIMValue cimValue;
1042 kumpf     1.47     CIMException cimException;
1043 kumpf     1.48     ContentLanguageList contentLangs;
1044 kumpf     1.47 
1045                    try
1046                    {
1047                        // make target object path
1048                        CIMObjectPath objectPath(
1049                            System::getHostName(),
1050                            request->nameSpace,
1051                            request->instanceName.getClassName(),
1052                            request->instanceName.getKeyBindings());
1053                
1054                        Array<CIMName> propertyListArray;
1055                        propertyListArray.append(request->propertyName);
1056                        CIMPropertyList propertyList(propertyListArray);
1057                
1058                        SimpleInstanceResponseHandler handler;
1059                
1060                        getInstance(
1061                            request->operationContext,
1062                            objectPath,
1063                            false,
1064                            false,
1065 kumpf     1.47             propertyList,
1066                            handler);
1067                
1068                        if (handler.size() == 1)
1069                        {
1070                            // Retrieve the requested property
1071                            CIMInstance cimInstance = handler.getObjects()[0];
1072                            Uint32 pos = cimInstance.findProperty(request->propertyName);
1073                            if (pos != PEG_NOT_FOUND)
1074                            {
1075                                cimValue = cimInstance.getProperty(pos).getValue();
1076                            }
1077                        }
1078                        else
1079                        {
1080                            PEGASUS_ASSERT(0);
1081                        }
1082 kumpf     1.1  
1083 kumpf     1.47         contentLangs = handler.getLanguages();
1084                    }
1085                    catch (CIMException& e)
1086                    {
1087                        cimException = e;
1088                    }
1089                    catch (Exception& e)
1090                    {
1091                        cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
1092                    }
1093                    catch (...)
1094                    {
1095                        cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,
1096                            MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR",
1097                                "Unknown Error"));
1098                    }
1099 humberto  1.27 
1100 kumpf     1.1      // create response message
1101 a.arora   1.35     AutoPtr<CIMGetPropertyResponseMessage> response(
1102 kumpf     1.47         new CIMGetPropertyResponseMessage(
1103                            request->messageId,
1104                            cimException,
1105                            request->queueIds.copyAndPop(),
1106                            cimValue));
1107 humberto  1.27 
1108 w.white   1.42     STAT_PMS_PROVIDEREND
1109                
1110 kumpf     1.47     response->operationContext.set(ContentLanguageListContainer(contentLangs));
1111                
1112 kumpf     1.1      // preserve message key
1113                    response->setKey(request->getKey());
1114                
1115 a.arora   1.35     return response.release();
1116 kumpf     1.1  }
1117                
1118 se.gupta  1.38 Message * ProviderMessageFacade::_handleSetPropertyRequest(Message * message) 
1119 kumpf     1.1  {
1120                    const CIMSetPropertyRequestMessage * request =
1121                	dynamic_cast<CIMSetPropertyRequestMessage *>(message);
1122                
1123 w.white   1.42     STAT_GETSTARTTIME
1124                
1125 kumpf     1.1      PEGASUS_ASSERT(request != 0);
1126                
1127 kumpf     1.47     CIMException cimException;
1128                
1129                    try
1130                    {
1131                        // make target object path
1132                        CIMObjectPath objectPath(
1133                            System::getHostName(),
1134                            request->nameSpace,
1135                            request->instanceName.getClassName(),
1136                            request->instanceName.getKeyBindings());
1137                
1138                        CIMInstance cimInstance;
1139                        cimInstance.addProperty(
1140                            CIMProperty(request->propertyName, request->newValue));
1141                
1142                        Array<CIMName> propertyListArray;
1143                        propertyListArray.append(request->propertyName);
1144                        CIMPropertyList propertyList(propertyListArray);
1145                
1146                        SimpleResponseHandler handler;
1147                
1148 kumpf     1.47         modifyInstance(
1149                            request->operationContext,
1150                            objectPath,
1151                            cimInstance,
1152                            false,
1153                            propertyList,
1154                            handler);
1155                    }
1156                    catch (CIMException& e)
1157                    {
1158                        cimException = e;
1159                    }
1160                    catch (Exception& e)
1161                    {
1162                        cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
1163                    }
1164                    catch (...)
1165                    {
1166                        cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,
1167                            MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR",
1168                                "Unknown Error"));
1169 kumpf     1.47     }
1170 humberto  1.27 
1171 kumpf     1.1      // create response message
1172 a.arora   1.35     AutoPtr<CIMSetPropertyResponseMessage> response(
1173 kumpf     1.47         new CIMSetPropertyResponseMessage(
1174                            request->messageId,
1175                            cimException,
1176                            request->queueIds.copyAndPop()));
1177 kumpf     1.1  
1178 kumpf     1.47     STAT_PMS_PROVIDEREND
1179 humberto  1.27 
1180 kumpf     1.1      // preserve message key
1181                    response->setKey(request->getKey());
1182                
1183 a.arora   1.35     return response.release();
1184 kumpf     1.1  }
1185                
1186 se.gupta  1.38 Message * ProviderMessageFacade::_handleInvokeMethodRequest(Message * message) 
1187 kumpf     1.1  {
1188                    const CIMInvokeMethodRequestMessage * request =
1189                	dynamic_cast<CIMInvokeMethodRequestMessage *>(message);
1190                
1191 w.white   1.42     STAT_GETSTARTTIME
1192                
1193 kumpf     1.1      PEGASUS_ASSERT(request != 0);
1194                
1195 kumpf     1.7      CIMException cimException;
1196 kumpf     1.1      CIMValue returnValue;
1197                    Array<CIMParamValue> outParameters;
1198                    CIMInstance cimInstance;
1199 kumpf     1.48     ContentLanguageList contentLangs;
1200 kumpf     1.1  
1201                    try
1202                    {
1203                	// make target object path
1204 kumpf     1.12 	CIMObjectPath classReference(
1205 kumpf     1.1  	    System::getHostName(),
1206                	    request->nameSpace,
1207                	    request->instanceName.getClassName());
1208                
1209                	// convert arguments
1210 aruran.ms 1.45     /*	OperationContext context;
1211 kumpf     1.1  
1212 se.gupta  1.36 	// add the user name and accept and content Languages to the context
1213                	context.insert(request->operationContext.get(IdentityContainer::NAME));
1214                	context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); 
1215                	context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); 
1216 aruran.ms 1.45     */
1217 kumpf     1.1  	CIMObjectPath instanceReference(request->instanceName);
1218                
1219                	// ATTN: propagate namespace
1220                	instanceReference.setNameSpace(request->nameSpace);
1221                
1222 kumpf     1.23 	SimpleMethodResultResponseHandler handler;
1223 kumpf     1.1  
1224                	// forward request
1225                	invokeMethod(
1226 aruran.ms 1.45 	    request->operationContext,
1227 kumpf     1.1  	    instanceReference,
1228                	    request->methodName,
1229                	    request->inParameters,
1230                	    handler);
1231                
1232                	// error? provider claims success, but did not deliver a CIMValue.
1233 kumpf     1.23         // ATTN-RK-20020903: Can the return value be null?
1234                	//if(handler.getReturnValue().isNull())
1235                	//{
1236 kumpf     1.22 //	    throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_FOUND, String::EMPTY);
1237 mday      1.9  // << Mon Apr 29 12:41:15 2002 mdd >>
1238 kumpf     1.23 	//    cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
1239                	//}
1240 kumpf     1.1  
1241 kumpf     1.23 	outParameters = handler.getParamValues();
1242                	returnValue = handler.getReturnValue();
1243 chuck     1.28         contentLangs = handler.getLanguages();  // l10n
1244 kumpf     1.1      }
1245                    catch(CIMException & e)
1246                    {
1247 kumpf     1.7          cimException = e;
1248 kumpf     1.1      }
1249                    catch(Exception & e)
1250                    {
1251 kumpf     1.7          cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, e.getMessage());
1252 kumpf     1.1      }
1253                    catch(...)
1254                    {
1255 humberto  1.27       // l10n
1256 chip      1.29 
1257 humberto  1.27       cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms("Server.ProviderMessageFacade.UNKNOWN_ERROR", "Unknown Error"));
1258                      // cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Unknown Error");
1259 kumpf     1.1      }
1260                
1261                    // create response message
1262 a.arora   1.35     AutoPtr<CIMInvokeMethodResponseMessage> response(
1263 kumpf     1.1  	new CIMInvokeMethodResponseMessage(
1264                	    request->messageId,
1265 kumpf     1.7  	    cimException,
1266 kumpf     1.1  	    request->queueIds.copyAndPop(),
1267                	    returnValue,
1268                	    outParameters,
1269 se.gupta  1.37 	    request->methodName));  // l10n
1270                
1271 w.white   1.42     STAT_PMS_PROVIDEREND
1272                
1273 se.gupta  1.37 	response->operationContext.set(ContentLanguageListContainer(contentLangs));
1274 kumpf     1.1  
1275                    // preserve message key
1276                    response->setKey(request->getKey());
1277                
1278 a.arora   1.35     return response.release();
1279 kumpf     1.1  }
1280                
1281                PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2