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

   1 karl  1.12 //%2004////////////////////////////////////////////////////////////////////////
   2 david.dillard 1.9  //
   3 karl          1.12 // 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 david.dillard 1.9  // IBM Corp.; EMC Corporation, The Open Group.
   7 karl          1.12 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   8                    // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   9 david.dillard 1.9  //
  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                    // 
  17                    // 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 david.dillard 1.9  // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
  31                    //                  (carolann_graves@hp.com)
  32                    //              Mike Day, IBM (mdday@us.ibm.com)
  33                    //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
  34                    //				Seema Gupta, (gseema@in.ibm.com for PEP135)
  35 a.arora       1.11 //              Amit K Arora, IBM (amita@in.ibm.com) for Bug#1090
  36 david.dillard 1.9  //
  37                    //%/////////////////////////////////////////////////////////////////////////////
  38                    
  39                    
  40                    #include <Pegasus/Common/Constants.h>
  41                    #include <Pegasus/Common/XmlWriter.h>
  42                    #include <Pegasus/Common/Thread.h>
  43                    #include <Pegasus/Common/CIMMessage.h>
  44                    #include <Pegasus/Common/Tracer.h>
  45                    
  46                    #ifdef PEGASUS_OS_OS400
  47                    #include <qycmutilu2.H>
  48                    #include "OS400ConvertChar.h"
  49                    #include "CIMOMHandleOS400UserState.h"
  50                    #include "CIMOMHandleOS400SystemState.h"
  51                    #endif
  52                    
  53                    #include "InternalCIMOMHandleRep.h"
  54                    
  55                    PEGASUS_NAMESPACE_BEGIN
  56                    
  57 david.dillard 1.9  // chuck 2.4
  58                    // l10n start
  59                    static void deleteContentLanguage(void* data)
  60                    {
  61                       if (data != NULL)
  62                       {
  63                          ContentLanguages* cl = static_cast<ContentLanguages*>(data);
  64                          delete cl;
  65                       }
  66                    }
  67                    // l10n end
  68                    
  69                    
  70                    class CIMOMHandleDispatch
  71                    {
  72                    public:
  73                        CIMOMHandleDispatch(
  74                            Message* msg,
  75                            Uint32 my_qid,
  76                            Uint32 output_qid)
  77                         : _msg(msg),
  78 david.dillard 1.9         _my_qid(my_qid),
  79                           _out_qid(output_qid)
  80                        {
  81                        }
  82                    
  83                        ~CIMOMHandleDispatch()
  84                        {
  85                        }
  86                    
  87                        Message* _msg;
  88                        Uint32 _my_qid;
  89                        Uint32 _out_qid;
  90                    #ifdef PEGASUS_OS_OS400
  91                        char os400PH[12];
  92                    #endif
  93                    
  94                    private:
  95                        CIMOMHandleDispatch();    // Unimplemented
  96                    };
  97                    
  98                    
  99 david.dillard 1.9  InternalCIMOMHandleRep::InternalCIMOMHandleRep()
 100                        : MessageQueue(PEGASUS_QUEUENAME_INTERNALCLIENT),
 101                          _server_terminating(0),
 102                          _msg_avail(0),
 103                          _response(true, 0)
 104                    {
 105                        // initialize the qids
 106                        // output queue defaults to CIMOPRequestDispatcher
 107                        MessageQueue* out = MessageQueue::lookup(PEGASUS_QUEUENAME_BINARY_HANDLER);
 108                        if (out)
 109                        {
 110                            _output_qid = out->getQueueId();
 111                        }
 112                        else
 113                        {
 114                            _output_qid = _queueId;
 115                        }
 116                    
 117                        // return queue defaults to myself
 118                        _return_qid = _queueId;
 119                    }
 120 david.dillard 1.9  
 121                    InternalCIMOMHandleRep::InternalCIMOMHandleRep(Uint32 out_qid, Uint32 ret_qid)
 122                        : MessageQueue(PEGASUS_QUEUENAME_INTERNALCLIENT),
 123                          _output_qid(out_qid),
 124                          _return_qid(ret_qid),
 125                          _server_terminating(0),
 126                          _msg_avail(0),
 127                          _response(true, 0)
 128                    {
 129                        if (0 == q_exists(_output_qid))
 130                        {
 131                            _output_qid = _queueId;
 132                        }
 133                        if (0 == q_exists(_return_qid))
 134                        {
 135                            _return_qid = _queueId;
 136                        }
 137                    }
 138                    
 139                    // Private, unimplemented copy constructor
 140                    InternalCIMOMHandleRep::InternalCIMOMHandleRep(
 141 david.dillard 1.9      const InternalCIMOMHandleRep& rep)
 142 a.arora       1.11     : CIMOMHandleRep(),
 143                          MessageQueue(PEGASUS_QUEUENAME_INTERNALCLIENT)
 144 david.dillard 1.9  {
 145                        PEGASUS_ASSERT(0);
 146                    }
 147                    
 148                    // Private, unimplemented assignment operator
 149                    InternalCIMOMHandleRep& InternalCIMOMHandleRep::operator=(
 150                        const InternalCIMOMHandleRep& rep)
 151                    {
 152                        PEGASUS_ASSERT(0);
 153                        return *this;
 154                    }
 155                    
 156                    InternalCIMOMHandleRep::~InternalCIMOMHandleRep()
 157                    {
 158                    }
 159                    
 160                    #ifdef PEGASUS_OS_OS400
 161 a.arora       1.11 InternalCIMOMHandleRep::InternalCIMOMHandleRep(Uint32 os400UserStateKey)
 162                        : MessageQueue(PEGASUS_QUEUENAME_INTERNALCLIENT),
 163                          _chOS400(os400UserStateKey)
 164                    {
 165                    }
 166                    
 167                    void InternalCIMOMHandleRep::setOS400ProfileHandle(const char* profileHandle)
 168                    {
 169                        memcpy(os400PH, profileHandle, 12);
 170                    }
 171                    #endif
 172                    
 173                    #ifdef PEGASUS_OS_OS400
 174 david.dillard 1.9  InternalCIMOMHandleRep::InternalCIMOMHandleRep(Uint32 os400key)
 175                        : MessageQueue(PEGASUS_QUEUENAME_INTERNALCLIENT),
 176                         _chOS400(os400key)
 177                    {
 178                    }
 179                    
 180                    void InternalCIMOMHandleRep::setOS400ProfileHandle(const char* ph)
 181                    {
 182                        memcpy(os400PH, ph, 12);
 183                    }
 184                    #endif
 185                    
 186                    Uint32 InternalCIMOMHandleRep::get_output_qid()
 187                    {
 188                        try
 189                        {
 190 a.arora       1.10         AutoMutex autoMut(_qid_mutex);
 191 david.dillard 1.9          Uint32 qid = _output_qid;
 192                            return qid;
 193                        }
 194                        catch (...)
 195                        {
 196                            return _queueId;
 197                        }
 198                    }
 199                    
 200                    void InternalCIMOMHandleRep::set_output_qid(Uint32 qid)
 201                    {
 202                        try
 203                        {
 204 a.arora       1.10         AutoMutex autoMut(_qid_mutex);
 205 david.dillard 1.9          _output_qid = qid;
 206                        }
 207                        catch (...)
 208                        {
 209                        }
 210                    }
 211                    
 212                    Uint32 InternalCIMOMHandleRep::get_return_qid()
 213                    {
 214                        try
 215                        {
 216 a.arora       1.10         AutoMutex autoMut(_qid_mutex);
 217 david.dillard 1.9          Uint32 qid = _return_qid;
 218                            return qid;
 219                        }
 220                        catch (...)
 221                        {
 222                            return _queueId;
 223                        }
 224                    }
 225                    
 226                    void InternalCIMOMHandleRep::set_return_qid(Uint32 qid)
 227                    {
 228                        try
 229                        {
 230 a.arora       1.10         AutoMutex autoMut(_qid_mutex);
 231 david.dillard 1.9          _return_qid = qid;
 232                        }
 233                        catch (...)
 234                        {
 235                        }
 236                    }
 237                    
 238                    Uint32 InternalCIMOMHandleRep::get_qid()
 239                    {
 240                        return _queueId;
 241                    }
 242                    
 243                    void InternalCIMOMHandleRep::handleEnqueue()
 244                    {
 245                        PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
 246                            "InternalCIMOMHandleRep::handleEnqueue()");
 247                    
 248                        Message* message = dequeue();
 249                    
 250                        if (!message)
 251                        {
 252 david.dillard 1.9          PEG_METHOD_EXIT();
 253                            return;
 254                        }
 255                    
 256                        handleEnqueue(message);
 257                        PEG_METHOD_EXIT();
 258                    }
 259                    
 260                    void InternalCIMOMHandleRep::handleEnqueue(Message* message)
 261                    {
 262                        PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
 263                            "InternalCIMOMHandleRep::handleEnqueue(Message*)");
 264                    
 265                        if (!message)
 266                        {
 267                            PEG_METHOD_EXIT();
 268                            return;
 269                        }
 270                    
 271                        switch(message->getType())
 272                        {
 273 david.dillard 1.9      case CIM_GET_CLASS_RESPONSE_MESSAGE:
 274                        case CIM_ENUMERATE_CLASSES_RESPONSE_MESSAGE:
 275                        case CIM_ENUMERATE_CLASS_NAMES_RESPONSE_MESSAGE:
 276                        case CIM_CREATE_CLASS_RESPONSE_MESSAGE:
 277                        case CIM_MODIFY_CLASS_RESPONSE_MESSAGE:
 278                        case CIM_DELETE_CLASS_RESPONSE_MESSAGE:
 279                        case CIM_GET_INSTANCE_RESPONSE_MESSAGE:
 280                        case CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE:
 281                        case CIM_ENUMERATE_INSTANCE_NAMES_RESPONSE_MESSAGE:
 282                        case CIM_CREATE_INSTANCE_RESPONSE_MESSAGE:
 283                        case CIM_MODIFY_INSTANCE_RESPONSE_MESSAGE:
 284                        case CIM_DELETE_INSTANCE_RESPONSE_MESSAGE:
 285                        case CIM_EXEC_QUERY_RESPONSE_MESSAGE:
 286                        case CIM_ASSOCIATORS_RESPONSE_MESSAGE:
 287                        case CIM_ASSOCIATOR_NAMES_RESPONSE_MESSAGE:
 288                        case CIM_REFERENCES_RESPONSE_MESSAGE:
 289                        case CIM_REFERENCE_NAMES_RESPONSE_MESSAGE:
 290                        case CIM_GET_PROPERTY_RESPONSE_MESSAGE:
 291                        case CIM_SET_PROPERTY_RESPONSE_MESSAGE:
 292 kumpf         1.12.2.1     case CIM_INVOKE_METHOD_RESPONSE_MESSAGE:
 293 david.dillard 1.9              try
 294                                {
 295                                    _response.insert_last_wait(message);
 296                                    _msg_avail.signal();
 297                                }
 298                                catch (...)
 299                                {
 300                                    PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL3, "IPC Exception");
 301                                    delete message;
 302                                }
 303                                break;
 304                        
 305                            default:
 306                                {
 307                                    PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL3,
 308                                        "unexpected message");
 309                                    delete message;
 310                                }
 311                            }
 312                            PEG_METHOD_EXIT();
 313                        }
 314 david.dillard 1.9      
 315                        // run as a detached thread
 316                        PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL
 317                        InternalCIMOMHandleRep::_dispatch(void* parm)
 318                        {
 319                            PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
 320                                            "InternalCIMOMHandleRep::_dispatch");
 321                        
 322                            CIMOMHandleDispatch* dp =
 323                                reinterpret_cast<CIMOMHandleDispatch*>(parm);
 324                            if (dp)
 325                            {
 326                                try
 327                                {
 328                        #ifdef PEGASUS_OS_OS400
 329                                    // On OS/400, this code runs in a system state thread.  Swap the
 330                                    // thread profile to be able to access server resources.
 331                                    if (CIMOMHandleOS400SystemState::setProfileHandle(dp->os400PH) !=
 332                                        CIM_ERR_SUCCESS)
 333                                    {
 334                                        throw Exception("");
 335 david.dillard 1.9                  }
 336                        #endif
 337                        
 338                                    MessageQueue* target = MessageQueue::lookup(dp->_out_qid);
 339                                    MessageQueue* me = MessageQueue::lookup(dp->_my_qid);
 340                                    if (me && target && dp->_msg)
 341                                    {
 342                                        target->enqueue(dp->_msg);
 343                                    }
 344                                }
 345                                catch (...)
 346                                {
 347                                }
 348                                delete dp;
 349                            }
 350                        
 351                            PEG_METHOD_EXIT();
 352                        //    exit_thread((PEGASUS_THREAD_RETURN)1);
 353                            return 0;
 354                        }
 355                        
 356 david.dillard 1.9      Message* InternalCIMOMHandleRep::do_request(
 357                            Message* request,
 358                            Uint32 responseType,
 359                            const OperationContext & context)
 360                        {
 361                            PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::do_request");
 362                        
 363                            try
 364                            {
 365                                _recursion.try_lock(pegasus_thread_self());
 366                            }
 367                            catch (IPCException &)
 368                            {
 369                                PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
 370                                    "IPC Exception, throwing CIMException");
 371                                //l10n
 372                                //throw CIMException(CIM_ERR_ACCESS_DENIED, "Recursive Use of CIMOMHandle Attempted");
 373                                throw CIMException(CIM_ERR_ACCESS_DENIED, MessageLoaderParms(
 374                                    "Provider.CIMOMHandle.RECURSIVE_USE_CIMOMHANDLE",
 375                                    "Recursive Use of CIMOMHandle Attempted"));
 376                            }
 377 david.dillard 1.9          catch (...)
 378                            {
 379                                PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
 380                                    "Unexpected Exception");
 381                                throw;
 382                            }
 383                        
 384                            // Set an AcceptLanguages and ContentLanguages into the request based
 385                            // on the languages in the OperationContext from the caller,
 386                            // or the caller's thread.
 387                            CIMMessage* cimmsg = dynamic_cast<CIMMessage*>(request);
 388                            if (cimmsg != NULL)
 389                            {
 390                               try
 391                                {
 392                        		#ifdef PEGASUS_OS_OS400
 393                        			// On OS/400, do not allow the provider set the user name for the request.
 394                        			// Get the user name from the current thread.
 395                        		char os400UserName[11];
 396                        		if (ycmGetCurrentUser(os400UserName) == 0)
 397                        		{
 398 david.dillard 1.9              throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
 399                                    "Common.CIMOMHandleOS400UserState.UNKNOWN_ERROR",
 400                                    "An internal error occurred during the processing of the CIMOM handle"));
 401                        		}
 402                        		EtoA(os400UserName);
 403                        		cimmsg->operationContext.insert(IdentityContainer(String(os400UserName)));
 404                        		#else
 405                        			IdentityContainer identity_cntr = (IdentityContainer)context.get(IdentityContainer::NAME);
 406                                    cimmsg->operationContext.insert(IdentityContainer(identity_cntr.getUserName()));
 407                        		#endif 			
 408                                }
 409                                catch (Exception &)
 410                                {
 411                        			// for OS400 don't proceed if there is an exception, otherwise create an empty identity container.
 412                        			#ifdef PEGASUS_OS_OS400
 413                        				throw ;
 414                        			#else
 415                        			cimmsg->operationContext.insert(IdentityContainer(String::EMPTY));
 416                        			#endif
 417                        	    }
 418                        		// chuck 2.4
 419 david.dillard 1.9              // If the caller specified an Accept-Language or Content-Language
 420                                // in the OperationContext, then use those on the request msg.
 421                                try
 422                                {
 423                                    AcceptLanguageListContainer al_cntr = (AcceptLanguageListContainer)
 424                                        context.get(AcceptLanguageListContainer::NAME);
 425                        			cimmsg->operationContext.set(AcceptLanguageListContainer(al_cntr.getLanguages())); 
 426                                }
 427                                catch (Exception &)
 428                                {
 429                                    // If the container is not found then try to use the
 430                                    // AcceptLanguages from the current thread
 431                                    AcceptLanguages* pal = Thread::getLanguages();
 432                                    if (pal != NULL)
 433                                    {
 434                        				cimmsg->operationContext.set(AcceptLanguageListContainer(*pal)); 
 435                                    }
 436                                }
 437                        
 438                                try
 439                                {
 440 david.dillard 1.9                  ContentLanguageListContainer cl_cntr =
 441                                        (ContentLanguageListContainer)context.get(
 442                                            ContentLanguageListContainer::NAME);
 443                        			cimmsg->operationContext.set(ContentLanguageListContainer(cl_cntr.getLanguages())); 
 444                                }
 445                                catch (Exception &)
 446                                {
 447                        			cimmsg->operationContext.set(ContentLanguageListContainer(ContentLanguages::EMPTY)); 
 448                                    // ignore the container not found error
 449                                }
 450                        
 451                                // end chuck 2.4
 452                            }
 453                            else
 454                            {
 455                                // ignore if not a CIMMessage
 456                            }
 457                        
 458                            CIMOMHandleDispatch* dp =
 459                                new CIMOMHandleDispatch(request, get_qid(), get_output_qid());
 460                        
 461 david.dillard 1.9      #ifdef PEGASUS_OS_OS400
 462                            memcpy(dp->os400PH, os400PH, 12);
 463                        #endif
 464                        
 465 denise.eckstein 1.12.2.2     ThreadStatus rtn = 
 466                                  MessageQueueService::get_thread_pool()->allocate_and_awaken(dp, _dispatch);
 467                              if (rtn != PEGASUS_THREAD_OK)
 468                              {
 469                                   Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
 470                                          "Not enough threads to create a worker to dispatch a request. ");
 471                          
 472                                   Tracer::trace(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
 473                                                  "Could not allocate thread for %s to dispatch a request.");
 474                                  delete dp;
 475                                  PEG_METHOD_EXIT();
 476                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
 477                                      "Provider.CIMOMHandle.CANNOT_ALLOCATE_THREAD",
 478                                       "Could not create a worker for the dispatch request."));
 479                              }
 480 david.dillard   1.9      
 481                              _request = request;
 482                          
 483                              CIMResponseMessage* response = 0;
 484                          
 485                              Uint32 timeout = 0;
 486                              try
 487                              {
 488                                  const TimeoutContainer* p = dynamic_cast<const TimeoutContainer*>(
 489                                      &(context.get(TimeoutContainer::NAME)));
 490                                  if (p)
 491                                  {
 492                                      timeout = p->getTimeOut();
 493                                  }
 494                              }
 495                              catch (Exception &)
 496                              {
 497                              }
 498                          
 499                              try
 500                              {
 501 david.dillard   1.9              if (timeout)
 502                                  {
 503                                      _msg_avail.time_wait(timeout);
 504                                  }
 505                                  else
 506                                  {
 507                                      _msg_avail.wait();
 508                                  }
 509                              }
 510                              catch (TimeOut&)
 511                              {
 512                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
 513                                                  "timeout waiting for response");
 514                                  _request = 0;
 515                                  _recursion.unlock();
 516                                  //l10n
 517                                  //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Empty CIM Response");
 518                                  throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms(
 519                                      "Provider.CIMOMHandle.EMPTY_CIM_RESPONSE",
 520                                      "Empty CIM Response"));
 521                              }
 522 david.dillard   1.9          catch (...)
 523                              {
 524                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
 525                                      "Unexpected Exception");
 526                                  _request = 0;
 527                                  _recursion.unlock();
 528                                  //l10n
 529                                  //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Empty CIM Response");
 530                                  throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms(
 531                                      "Provider.CIMOMHandle.EMPTY_CIM_RESPONSE",
 532                                      "Empty CIM Response"));
 533                              }
 534                              _request = 0;
 535                              Message* temp = _response.remove_first();
 536                              response = dynamic_cast<CIMResponseMessage*>(temp);
 537                              if (response == 0 || (response->getType() != responseType))
 538                              {
 539                                  delete temp;
 540                                  try
 541                                  {
 542                                      _response.empty_list();
 543 david.dillard   1.9              }
 544                                  catch (...)
 545                                  {
 546                                  }
 547                                  _recursion.unlock();
 548                                  //l10n
 549                                  //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Empty CIM Response");
 550                                  throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms(
 551                                      "Provider.CIMOMHandle.EMPTY_CIM_RESPONSE",
 552                                      "Empty CIM Response"));
 553                              }
 554                          
 555                              if (response->cimException.getCode() != CIM_ERR_SUCCESS)
 556                              {
 557                                  CIMException ex(response->cimException);
 558                          
 559                                  delete response;
 560                                  _recursion.unlock();
 561                                  throw ex;
 562                              }
 563                          
 564 david.dillard   1.9          // chuck 2.4
 565                              // If the response has a Content-Language then save it into thread-specific
 566                              // storage
 567                          	ContentLanguageListContainer  cnt_lang_cntr = response->operationContext.get(ContentLanguageListContainer::NAME);
 568                          	if((cnt_lang_cntr.getLanguages()).size()>0)
 569                              {
 570                                   Thread* curThrd = Thread::getCurrent();
 571                                   if (curThrd != NULL)
 572                                   {
 573                                       // deletes the old tsd and creates a new one
 574                                       curThrd->put_tsd("cimomHandleContentLanguages",
 575                                           deleteContentLanguage,
 576                                           sizeof(ContentLanguages*),
 577                                           new ContentLanguages(cnt_lang_cntr.getLanguages()));
 578                                   }
 579                              }
 580                          
 581                              PEG_METHOD_EXIT();
 582                              _recursion.unlock();
 583                              return response;
 584                          }
 585 david.dillard   1.9      
 586                          
 587                          //
 588                          // CIM Operations
 589                          //
 590                          
 591                          CIMClass InternalCIMOMHandleRep::getClass(
 592                              const OperationContext & context,
 593                              const CIMNamespaceName& nameSpace,
 594                              const CIMName& className,
 595                              Boolean localOnly,
 596                              Boolean includeQualifiers,
 597                              Boolean includeClassOrigin,
 598                              const CIMPropertyList& propertyList)
 599                          {
 600                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::getClass");
 601                          
 602                          #ifdef PEGASUS_OS_OS400
 603                              // If this is running in user-state, then run the request
 604                              // through the user-state layer
 605                              if (_chOS400.hasKey())
 606 david.dillard   1.9          {
 607                                  return _chOS400.getClass(
 608                                      context,
 609                                      nameSpace,
 610                                      className,
 611                                      localOnly,
 612                                      includeQualifiers,
 613                                      includeClassOrigin,
 614                                      propertyList);
 615                              }
 616                          #endif
 617                          
 618                              CIMOMHandleOpSemaphore opsem(this);
 619                          
 620                              // encode request
 621                              CIMGetClassRequestMessage* request = new CIMGetClassRequestMessage(
 622                                  XmlWriter::getNextMessageId(),
 623                                  nameSpace,
 624                                  className,
 625                                  localOnly,
 626                                  includeQualifiers,
 627 david.dillard   1.9              includeClassOrigin,
 628                                  propertyList,
 629                                  QueueIdStack(get_qid(), get_output_qid()));
 630                          
 631                              request->dest = get_output_qid();
 632                          
 633                              CIMGetClassResponseMessage* response;
 634                              try
 635                              {
 636                                  response = static_cast<CIMGetClassResponseMessage*>(
 637                                      do_request(
 638                                          request,
 639                                          CIM_GET_CLASS_RESPONSE_MESSAGE,
 640                                          context));
 641                              }
 642                              catch (CIMException &)
 643                              {
 644                                  throw;
 645                              }
 646                              catch (...)
 647                              {
 648 david.dillard   1.9              PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
 649                                      "Exception caught in CIMOMHandle");
 650                                  //l10n
 651                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
 652                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
 653                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
 654                                      "Exception caught in CIMOMHandle"));
 655                              }
 656                          
 657                              CIMClass cimClass = response->cimClass;
 658                              delete response;
 659                          
 660                              PEG_METHOD_EXIT();
 661                              return cimClass;
 662                          }
 663                          
 664                          
 665                          Array<CIMClass> InternalCIMOMHandleRep::enumerateClasses(
 666                              const OperationContext & context,
 667                              const CIMNamespaceName& nameSpace,
 668                              const CIMName& className,
 669 david.dillard   1.9          Boolean deepInheritance,
 670                              Boolean localOnly,
 671                              Boolean includeQualifiers,
 672                              Boolean includeClassOrigin)
 673                          {
 674                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
 675                                  "InternalCIMOMHandleRep::enumerateClasses");
 676                          
 677                          #ifdef PEGASUS_OS_OS400
 678                              // If this is running in user-state, then run the request
 679                              // through the user-state layer
 680                              if (_chOS400.hasKey())
 681                              {
 682                                  return _chOS400.enumerateClasses(
 683                                      context,
 684                                      nameSpace,
 685                                      className,
 686                                      deepInheritance,
 687                                      localOnly,
 688                                      includeQualifiers,
 689                                      includeClassOrigin);
 690 david.dillard   1.9         }
 691                          #endif
 692                          
 693                             CIMOMHandleOpSemaphore opsem(this);
 694                          
 695                              CIMEnumerateClassesRequestMessage* request =
 696                                  new CIMEnumerateClassesRequestMessage(
 697                                      XmlWriter::getNextMessageId(),
 698                                      nameSpace,
 699                                      className,
 700                                      deepInheritance,
 701                                      localOnly,
 702                                      includeQualifiers,
 703                                      includeClassOrigin,
 704                                      QueueIdStack(get_qid(), get_output_qid()));
 705                          
 706                              request->dest = get_output_qid();
 707                          
 708                              CIMEnumerateClassesResponseMessage* response;
 709                          
 710                              try
 711 david.dillard   1.9          {
 712                                  response = static_cast<CIMEnumerateClassesResponseMessage*>(
 713                                      do_request(
 714                                          request,
 715                                          CIM_ENUMERATE_CLASSES_RESPONSE_MESSAGE,
 716                                          context));
 717                              }
 718                              catch (CIMException &)
 719                              {
 720                                  throw;
 721                              }
 722                              catch (...)
 723                              {
 724                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
 725                                      "Exception caught in CIMOMHandle");
 726                                  //l10n
 727                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
 728                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
 729                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
 730                                      "Exception caught in CIMOMHandle"));
 731                              }
 732 david.dillard   1.9          Array<CIMClass> cimClasses = response->cimClasses;
 733                              delete response;
 734                              PEG_METHOD_EXIT();
 735                              return cimClasses;
 736                          }
 737                          
 738                          
 739                          Array<CIMName> InternalCIMOMHandleRep::enumerateClassNames(
 740                              const OperationContext & context,
 741                              const CIMNamespaceName &nameSpace,
 742                              const CIMName& className,
 743                              Boolean deepInheritance)
 744                          {
 745                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
 746                                  "InternalCIMOMHandleRep::enumerateClassNames");
 747                          
 748                          #ifdef PEGASUS_OS_OS400
 749                              // If this is running in user-state, then run the request
 750                              // through the user-state layer
 751                              if (_chOS400.hasKey())
 752                              {
 753 david.dillard   1.9              return _chOS400.enumerateClassNames(
 754                                      context,
 755                                      nameSpace,
 756                                      className,
 757                                      deepInheritance);
 758                             }
 759                          #endif
 760                          
 761                              CIMOMHandleOpSemaphore opsem(this);
 762                          
 763                              CIMEnumerateClassNamesRequestMessage* request =
 764                                  new CIMEnumerateClassNamesRequestMessage(
 765                                  XmlWriter::getNextMessageId(),
 766                                  nameSpace,
 767                                  className,
 768                                  deepInheritance,
 769                                  QueueIdStack(get_qid(), get_output_qid()));
 770                          
 771                              request->dest = get_output_qid();
 772                          
 773                              CIMEnumerateClassNamesResponseMessage* response;
 774 david.dillard   1.9          try
 775                              {
 776                                  response = static_cast<CIMEnumerateClassNamesResponseMessage*>(
 777                                      do_request(
 778                                          request,
 779                                          CIM_ENUMERATE_CLASS_NAMES_RESPONSE_MESSAGE,
 780                                          context));
 781                              }
 782                              catch (CIMException &)
 783                              {
 784                                  throw;
 785                              }
 786                              catch (...)
 787                              {
 788                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
 789                                      "Exception caught in CIMOMHandle");
 790                                  //l10n
 791                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
 792                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
 793                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
 794                                      "Exception caught in CIMOMHandle"));
 795 david.dillard   1.9          }
 796                              Array<CIMName> classNames = response->classNames;
 797                          
 798                              delete response;
 799                              PEG_METHOD_EXIT();
 800                              return(classNames);
 801                          }
 802                          
 803                          
 804                          void InternalCIMOMHandleRep::createClass(
 805                              const OperationContext & context,
 806                              const CIMNamespaceName& nameSpace,
 807                              const CIMClass& newClass)
 808                          {
 809                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::createClass");
 810                          
 811                          #ifdef PEGASUS_OS_OS400
 812                              // If this is running in user-state, then run the request
 813                              // through the user-state layer
 814                              if (_chOS400.hasKey())
 815                              {
 816 david.dillard   1.9              _chOS400.createClass(
 817                                      context,
 818                                      nameSpace,
 819                                      newClass);
 820                                  return;
 821                              }
 822                          #endif
 823                          
 824                              CIMOMHandleOpSemaphore opsem(this);
 825                          
 826                          
 827                              CIMCreateClassRequestMessage* request =
 828                                  new CIMCreateClassRequestMessage(
 829                                      XmlWriter::getNextMessageId(),
 830                                      nameSpace,
 831                                      newClass,
 832                                      QueueIdStack(get_qid(), get_output_qid()));
 833                          
 834                              request->dest = get_output_qid();
 835                          
 836                              CIMCreateClassResponseMessage* response;
 837 david.dillard   1.9      
 838                              try
 839                              {
 840                                  response = static_cast<CIMCreateClassResponseMessage*>(
 841                                      do_request(
 842                                          request,
 843                                          CIM_CREATE_CLASS_RESPONSE_MESSAGE,
 844                                          context));
 845                              }
 846                              catch (CIMException &)
 847                              {
 848                                  throw;
 849                              }
 850                              catch (...)
 851                              {
 852                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
 853                                      "Exception caught in CIMOMHandle");
 854                                  //l10n
 855                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
 856                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
 857                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
 858 david.dillard   1.9                  "Exception caught in CIMOMHandle"));
 859                              }
 860                          
 861                              delete response;
 862                              PEG_METHOD_EXIT();
 863                              return;
 864                          }
 865                          
 866                          
 867                          void InternalCIMOMHandleRep::modifyClass(
 868                              const OperationContext & context,
 869                              const CIMNamespaceName &nameSpace,
 870                              const CIMClass& modifiedClass)
 871                          {
 872                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::modifyClass");
 873                          
 874                          #ifdef PEGASUS_OS_OS400
 875                              // If this is running in user-state, then run the request
 876                              // through the user-state layer
 877                              if (_chOS400.hasKey())
 878                              {
 879 david.dillard   1.9              _chOS400.modifyClass(
 880                                      context,
 881                                      nameSpace,
 882                                      modifiedClass);
 883                                  return;
 884                              }
 885                          #endif
 886                          
 887                              CIMOMHandleOpSemaphore opsem(this);
 888                          
 889                              CIMModifyClassRequestMessage* request =
 890                                  new CIMModifyClassRequestMessage(
 891                                      XmlWriter::getNextMessageId(),
 892                                      nameSpace,
 893                                      modifiedClass,
 894                                      QueueIdStack(get_qid(), get_output_qid()));
 895                          
 896                              request->dest = get_output_qid();
 897                          
 898                              CIMModifyClassResponseMessage* response;
 899                              try
 900 david.dillard   1.9          {
 901                                  response = static_cast<CIMModifyClassResponseMessage*>(
 902                                      do_request(
 903                                          request,
 904                                          CIM_MODIFY_CLASS_RESPONSE_MESSAGE,
 905                                          context));
 906                              }
 907                              catch (CIMException &)
 908                              {
 909                                  throw;
 910                              }
 911                              catch (...)
 912                              {
 913                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
 914                                      "Exception caught in CIMOMHandle");
 915                                  //l10n
 916                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
 917                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
 918                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
 919                                      "Exception caught in CIMOMHandle"));
 920                              }
 921 david.dillard   1.9      
 922                              delete response;
 923                              PEG_METHOD_EXIT();
 924                              return;
 925                          }
 926                          
 927                          
 928                          void InternalCIMOMHandleRep::deleteClass(
 929                              const OperationContext & context,
 930                              const CIMNamespaceName &nameSpace,
 931                              const CIMName& className)
 932                          {
 933                          
 934                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::deleteClass");
 935                          
 936                          #ifdef PEGASUS_OS_OS400
 937                              // If this is running in user-state, then run the request
 938                              // through the user-state layer
 939                              if (_chOS400.hasKey())
 940                              {
 941                                  _chOS400.deleteClass(
 942 david.dillard   1.9                  context,
 943                                      nameSpace,
 944                                      className);
 945                                  return;
 946                              }
 947                          #endif
 948                          
 949                              CIMOMHandleOpSemaphore opsem(this);
 950                          
 951                              // encode request
 952                              CIMDeleteClassRequestMessage* request =
 953                                  new CIMDeleteClassRequestMessage(
 954                                      XmlWriter::getNextMessageId(),
 955                                      nameSpace,
 956                                      className,
 957                                      QueueIdStack(get_qid(), get_output_qid()));
 958                              request->dest = get_output_qid();
 959                          
 960                              CIMDeleteClassResponseMessage* response;
 961                          
 962                              try
 963 david.dillard   1.9          {
 964                                  response = static_cast<CIMDeleteClassResponseMessage*>(
 965                                      do_request(
 966                                          request,
 967                                          CIM_DELETE_CLASS_RESPONSE_MESSAGE,
 968                                          context));
 969                              }
 970                              catch (CIMException &)
 971                              {
 972                                  throw;
 973                              }
 974                              catch (...)
 975                              {
 976                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
 977                                      "Exception caught in CIMOMHandle");
 978                                  //l10n
 979                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
 980                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
 981                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
 982                                      "Exception caught in CIMOMHandle"));
 983                              }
 984 david.dillard   1.9          delete response;
 985                              PEG_METHOD_EXIT();
 986                              return;
 987                          }
 988                          
 989                          
 990                          CIMInstance InternalCIMOMHandleRep::getInstance(
 991                              const OperationContext & context,
 992                              const CIMNamespaceName &nameSpace,
 993                              const CIMObjectPath& instanceName,
 994                              Boolean localOnly,
 995                              Boolean includeQualifiers,
 996                              Boolean includeClassOrigin,
 997                              const CIMPropertyList& propertyList)
 998                          {
 999                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::getInstance");
1000                          
1001                          #ifdef PEGASUS_OS_OS400
1002                              // If this is running in user-state, then run the request
1003                              // through the user-state layer
1004                              if (_chOS400.hasKey())
1005 david.dillard   1.9          {
1006                                  return _chOS400.getInstance(
1007                                      context,
1008                                      nameSpace,
1009                                      instanceName,
1010                                      localOnly,
1011                                      includeQualifiers,
1012                                      includeClassOrigin,
1013                                      propertyList);
1014                              }
1015                          #endif
1016                          
1017                              CIMOMHandleOpSemaphore opsem(this);
1018                          
1019                          
1020                              // encode request
1021                              CIMGetInstanceRequestMessage* request =
1022                                  new CIMGetInstanceRequestMessage(
1023                                      XmlWriter::getNextMessageId(),
1024                                      nameSpace,
1025                                      instanceName,
1026 david.dillard   1.9                  localOnly,
1027                                      includeQualifiers,
1028                                      includeClassOrigin,
1029                                      propertyList,
1030                                      QueueIdStack(get_qid(), get_output_qid()));
1031                          
1032                              request->dest = get_output_qid();
1033                          
1034                              CIMGetInstanceResponseMessage* response;
1035                              try
1036                              {
1037                                  response = static_cast<CIMGetInstanceResponseMessage*>(
1038                                      do_request(
1039                                          request,
1040                                          CIM_GET_INSTANCE_RESPONSE_MESSAGE,
1041                                          context));
1042                              }
1043                              catch (CIMException &)
1044                              {
1045                                  throw;
1046                              }
1047 david.dillard   1.9          catch (...)
1048                              {
1049                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1050                                      "Exception caught in CIMOMHandle");
1051                                  //l10n
1052                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1053                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1054                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1055                                      "Exception caught in CIMOMHandle"));
1056                              }
1057                          
1058                              CIMInstance cimInstance = response->cimInstance;
1059                          
1060                              delete response;
1061                              PEG_METHOD_EXIT();
1062                              return(cimInstance);
1063                          }
1064                          
1065                          Array<CIMInstance> InternalCIMOMHandleRep::enumerateInstances(
1066                              const OperationContext & context,
1067                              const CIMNamespaceName &nameSpace,
1068 david.dillard   1.9          const CIMName& className,
1069                              Boolean deepInheritance,
1070                              Boolean localOnly,
1071                              Boolean includeQualifiers,
1072                              Boolean includeClassOrigin,
1073                              const CIMPropertyList& propertyList)
1074                          {
1075                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
1076                                  "InternalCIMOMHandleRep::enumerateInstances");
1077                          
1078                          #ifdef PEGASUS_OS_OS400
1079                              // If this is running in user-state, then run the request
1080                              // through the user-state layer
1081                              if (_chOS400.hasKey())
1082                              {
1083                                  return _chOS400.enumerateInstances(
1084                                      context,
1085                                      nameSpace,
1086                                      className,
1087                                      deepInheritance,
1088                                      localOnly,
1089 david.dillard   1.9                  includeQualifiers,
1090                                      includeClassOrigin,
1091                                      propertyList);
1092                              }
1093                          #endif
1094                          
1095                              CIMOMHandleOpSemaphore opsem(this);
1096                          
1097                              // encode request
1098                              CIMEnumerateInstancesRequestMessage* request =
1099                                  new CIMEnumerateInstancesRequestMessage(
1100                                      XmlWriter::getNextMessageId(),
1101                                      nameSpace,
1102                                      className,
1103                                      deepInheritance,
1104                                      localOnly,
1105                                      includeQualifiers,
1106                                      includeClassOrigin,
1107                                      propertyList,
1108                                      QueueIdStack(get_qid(), get_output_qid()));
1109                          
1110 david.dillard   1.9          request->dest = get_output_qid();
1111                          
1112                              CIMEnumerateInstancesResponseMessage* response;
1113                              try
1114                              {
1115                                  response = static_cast<CIMEnumerateInstancesResponseMessage*>(
1116                                      do_request(
1117                                          request,
1118                                          CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE,
1119                                          context));
1120                              }
1121                              catch (CIMException &)
1122                              {
1123                                  throw;
1124                              }
1125                              catch (...)
1126                              {
1127                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1128                                      "Exception caught in CIMOMHandle");
1129                                  //l10n
1130                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1131 david.dillard   1.9              throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1132                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1133                                      "Exception caught in CIMOMHandle"));
1134                              }
1135                          
1136                              Array<CIMInstance> cimInstances = response->cimNamedInstances;
1137                          
1138                              delete response;
1139                              PEG_METHOD_EXIT();
1140                              return(cimInstances);
1141                          }
1142                          
1143                          
1144                          Array<CIMObjectPath> InternalCIMOMHandleRep::enumerateInstanceNames(
1145                              const OperationContext & context,
1146                              const CIMNamespaceName &nameSpace,
1147                              const CIMName& className)
1148                          {
1149                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
1150                                  "InternalCIMOMHandleRep::enumerateInstanceNames");
1151                          
1152 david.dillard   1.9      #ifdef PEGASUS_OS_OS400
1153                              // If this is running in user-state, then run the request
1154                              // through the user-state layer
1155                              if (_chOS400.hasKey())
1156                              {
1157                                  return _chOS400.enumerateInstanceNames(
1158                                      context,
1159                                      nameSpace,
1160                                      className);
1161                              }
1162                          #endif
1163                          
1164                              CIMOMHandleOpSemaphore opsem(this);
1165                          
1166                              // encode request
1167                              CIMEnumerateInstanceNamesRequestMessage* request =
1168                                  new CIMEnumerateInstanceNamesRequestMessage(
1169                                      XmlWriter::getNextMessageId(),
1170                                      nameSpace,
1171                                      className,
1172                                      QueueIdStack(get_qid(), get_output_qid()));
1173 david.dillard   1.9      
1174                              request->dest = get_output_qid();
1175                          
1176                              CIMEnumerateInstanceNamesResponseMessage* response;
1177                              try
1178                              {
1179                                  response = static_cast<CIMEnumerateInstanceNamesResponseMessage*>(
1180                                      do_request(
1181                                          request,
1182                                          CIM_ENUMERATE_INSTANCE_NAMES_RESPONSE_MESSAGE,
1183                                          context));
1184                              }
1185                              catch (CIMException &)
1186                              {
1187                                  throw;
1188                              }
1189                              catch (...)
1190                              {
1191                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1192                                      "Exception caught in CIMOMHandle");
1193                                  //l10n
1194 david.dillard   1.9              //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1195                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1196                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1197                                      "Exception caught in CIMOMHandle"));
1198                              }
1199                          
1200                              Array<CIMObjectPath> cimReferences = response->instanceNames;
1201                          
1202                              delete response;
1203                              PEG_METHOD_EXIT();
1204                              return(cimReferences);
1205                          }
1206                          
1207                          CIMObjectPath InternalCIMOMHandleRep::createInstance(
1208                              const OperationContext & context,
1209                              const CIMNamespaceName &nameSpace,
1210                              const CIMInstance& newInstance)
1211                          {
1212                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
1213                                  "InternalCIMOMHandleRep::createInstance");
1214                          
1215 david.dillard   1.9      #ifdef PEGASUS_OS_OS400
1216                              // If this is running in user-state, then run the request
1217                              // through the user-state layer
1218                              if (_chOS400.hasKey())
1219                              {
1220                                  return _chOS400.createInstance(
1221                                      context,
1222                                      nameSpace,
1223                                      newInstance);
1224                              }
1225                          #endif
1226                          
1227                              CIMOMHandleOpSemaphore opsem(this);
1228                          
1229                              CIMCreateInstanceRequestMessage* request =
1230                                  new CIMCreateInstanceRequestMessage(
1231                                      XmlWriter::getNextMessageId(),
1232                                      nameSpace,
1233                                      newInstance,
1234                                      QueueIdStack(get_qid(), get_output_qid()));
1235                          
1236 david.dillard   1.9          request->dest = get_output_qid();
1237                          
1238                              CIMCreateInstanceResponseMessage* response;
1239                              try
1240                              {
1241                                  response = static_cast<CIMCreateInstanceResponseMessage*>(
1242                                      do_request(
1243                                          request,
1244                                          CIM_CREATE_INSTANCE_RESPONSE_MESSAGE,
1245                                          context));
1246                              }
1247                              catch (CIMException &)
1248                              {
1249                                  throw;
1250                              }
1251                              catch (...)
1252                              {
1253                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1254                                      "Exception caught in CIMOMHandle");
1255                                  //l10n
1256                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1257 david.dillard   1.9              throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1258                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1259                                      "Exception caught in CIMOMHandle"));
1260                              }
1261                          
1262                              CIMObjectPath cimReference = response->instanceName;
1263                          
1264                              delete response;
1265                              PEG_METHOD_EXIT();
1266                              return(cimReference);
1267                          }
1268                          
1269                          
1270                          void InternalCIMOMHandleRep::modifyInstance(
1271                              const OperationContext & context,
1272                              const CIMNamespaceName &nameSpace,
1273                              const CIMInstance& modifiedInstance,
1274                              Boolean includeQualifiers,
1275                              const CIMPropertyList& propertyList)
1276                          {
1277                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
1278 david.dillard   1.9              "InternalCIMOMHandleRep::modifyInstance");
1279                          
1280                          #ifdef PEGASUS_OS_OS400
1281                              // If this is running in user-state, then run the request
1282                              // through the user-state layer
1283                              if (_chOS400.hasKey())
1284                              {
1285                                  _chOS400.modifyInstance(
1286                                      context,
1287                                      nameSpace,
1288                                      modifiedInstance,
1289                                      includeQualifiers,
1290                                      propertyList);
1291                                  return;
1292                              }
1293                          #endif
1294                          
1295                              CIMOMHandleOpSemaphore opsem(this);
1296                          
1297                              CIMModifyInstanceRequestMessage* request =
1298                                  new CIMModifyInstanceRequestMessage(
1299 david.dillard   1.9                  XmlWriter::getNextMessageId(),
1300                                      nameSpace,
1301                                      modifiedInstance,
1302                                      includeQualifiers,
1303                                      propertyList,
1304                                      QueueIdStack(get_qid(), get_output_qid()));
1305                          
1306                              request->dest = get_output_qid();
1307                          
1308                              CIMModifyInstanceResponseMessage* response;
1309                          
1310                              try
1311                              {
1312                                  response = static_cast<CIMModifyInstanceResponseMessage*>(
1313                                      do_request(
1314                                          request,
1315                                          CIM_MODIFY_INSTANCE_RESPONSE_MESSAGE,
1316                                          context));
1317                              }
1318                              catch (CIMException &)
1319                              {
1320 david.dillard   1.9              throw;
1321                              }
1322                              catch (...)
1323                              {
1324                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1325                                      "Exception caught in CIMOMHandle");
1326                                  //l10n
1327                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1328                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1329                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1330                                      "Exception caught in CIMOMHandle"));
1331                              }
1332                          
1333                              delete response;
1334                              PEG_METHOD_EXIT();
1335                              return;
1336                          }
1337                          
1338                          
1339                          void InternalCIMOMHandleRep::deleteInstance(
1340                              const OperationContext & context,
1341 david.dillard   1.9          const CIMNamespaceName &nameSpace,
1342                              const CIMObjectPath& instanceName)
1343                          {
1344                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
1345                                  "InternalCIMOMHandleRep::deleteInstance");
1346                          
1347                          #ifdef PEGASUS_OS_OS400
1348                              // If this is running in user-state, then run the request
1349                              // through the user-state layer
1350                              if (_chOS400.hasKey())
1351                              {
1352                                  _chOS400.deleteInstance(
1353                                      context,
1354                                      nameSpace,
1355                                      instanceName);
1356                                  return;
1357                              }
1358                          #endif
1359                          
1360                              CIMOMHandleOpSemaphore opsem(this);
1361                          
1362 david.dillard   1.9          CIMDeleteInstanceRequestMessage* request =
1363                                  new CIMDeleteInstanceRequestMessage(
1364                                      XmlWriter::getNextMessageId(),
1365                                      nameSpace,
1366                                      instanceName,
1367                                      QueueIdStack(get_qid(), get_output_qid()));
1368                          
1369                              request->dest = get_output_qid();
1370                          
1371                              CIMDeleteInstanceResponseMessage* response;
1372                          
1373                              try
1374                              {
1375                                  response = static_cast<CIMDeleteInstanceResponseMessage*>(
1376                                      do_request(
1377                                          request,
1378                                          CIM_DELETE_INSTANCE_RESPONSE_MESSAGE,
1379                                          context));
1380                              }
1381                              catch (CIMException &)
1382                              {
1383 david.dillard   1.9              throw;
1384                              }
1385                              catch (...)
1386                              {
1387                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1388                                      "Exception caught in CIMOMHandle");
1389                                  //l10n
1390                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1391                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1392                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1393                                      "Exception caught in CIMOMHandle"));
1394                              }
1395                          
1396                              delete response;
1397                              PEG_METHOD_EXIT();
1398                              return;
1399                          }
1400                          
1401                          
1402                          Array<CIMObject> InternalCIMOMHandleRep::execQuery(
1403                              const OperationContext & context,
1404 david.dillard   1.9          const CIMNamespaceName &nameSpace,
1405                              const String& queryLanguage,
1406                              const String& query)
1407                          {
1408                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::execQuery");
1409                          
1410                          #ifdef PEGASUS_OS_OS400
1411                              // If this is running in user-state, then run the request
1412                              // through the user-state layer
1413                              if (_chOS400.hasKey())
1414                              {
1415                                  return _chOS400.execQuery(
1416                                      context,
1417                                      nameSpace,
1418                                      queryLanguage,
1419                                      query);
1420                              }
1421                          #endif
1422                          
1423                              CIMOMHandleOpSemaphore opsem(this);
1424                          
1425 david.dillard   1.9          CIMExecQueryRequestMessage* request =
1426                                  new CIMExecQueryRequestMessage(
1427                                      XmlWriter::getNextMessageId(),
1428                                      nameSpace,
1429                                      queryLanguage,
1430                                      query,
1431                                      QueueIdStack(get_qid(), get_output_qid()));
1432                          
1433                              request->dest = get_output_qid();
1434                          
1435                              CIMExecQueryResponseMessage* response;
1436                          
1437                              try
1438                              {
1439                                  response = static_cast<CIMExecQueryResponseMessage*>(
1440                                      do_request(
1441                                          request,
1442                                          CIM_EXEC_QUERY_RESPONSE_MESSAGE,
1443                                          context));
1444                              }
1445                              catch (CIMException &)
1446 david.dillard   1.9          {
1447                                  throw;
1448                              }
1449                              catch (...)
1450                              {
1451                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1452                                      "Exception caught in CIMOMHandle");
1453                                  //l10n
1454                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1455                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1456                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1457                                      "Exception caught in CIMOMHandle"));
1458                              }
1459                          
1460                              Array<CIMObject> cimObjects = response->cimObjects;
1461                          
1462                              delete response;
1463                              PEG_METHOD_EXIT();
1464                              return(cimObjects);
1465                          }
1466                          
1467 david.dillard   1.9      
1468                          Array<CIMObject> InternalCIMOMHandleRep::associators(
1469                              const OperationContext & context,
1470                              const CIMNamespaceName &nameSpace,
1471                              const CIMObjectPath& objectName,
1472                              const CIMName& assocClass,
1473                              const CIMName& resultClass,
1474                              const String& role,
1475                              const String& resultRole,
1476                              Boolean includeQualifiers,
1477                              Boolean includeClassOrigin,
1478                              const CIMPropertyList& propertyList)
1479                          {
1480                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::associators");
1481                          
1482                          #ifdef PEGASUS_OS_OS400
1483                              // If this is running in user-state, then run the request
1484                              // through the user-state layer
1485                              if (_chOS400.hasKey())
1486                              {
1487                                  return _chOS400.associators(
1488 david.dillard   1.9                  context,
1489                                      nameSpace,
1490                                      objectName,
1491                                      assocClass,
1492                                      resultClass,
1493                                      role,
1494                                      resultRole,
1495                                      includeQualifiers,
1496                                      includeClassOrigin,
1497                                      propertyList);
1498                              }
1499                          #endif
1500                          
1501                              CIMOMHandleOpSemaphore opsem(this);
1502                          
1503                              CIMAssociatorsRequestMessage* request =
1504                                  new CIMAssociatorsRequestMessage(
1505                                  XmlWriter::getNextMessageId(),
1506                                  nameSpace,
1507                                  objectName,
1508                                  assocClass,
1509 david.dillard   1.9              resultClass,
1510                                  role,
1511                                  resultRole,
1512                                  includeQualifiers,
1513                                  includeClassOrigin,
1514                                  propertyList,
1515                                  QueueIdStack(get_qid(), get_output_qid()));
1516                          
1517                              request->dest = get_output_qid();
1518                          
1519                              CIMAssociatorsResponseMessage* response;
1520                          
1521                              try
1522                              {
1523                                  response = static_cast<CIMAssociatorsResponseMessage*>(
1524                                      do_request(
1525                                          request,
1526                                          CIM_ASSOCIATORS_RESPONSE_MESSAGE,
1527                                          context));
1528                              }
1529                              catch (CIMException &)
1530 david.dillard   1.9          {
1531                                  throw;
1532                              }
1533                              catch (...)
1534                              {
1535                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1536                                      "Exception caught in CIMOMHandle");
1537                                  //l10n
1538                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1539                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1540                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1541                                      "Exception caught in CIMOMHandle"));
1542                              }
1543                          
1544                              Array<CIMObject> cimObjects = response->cimObjects;
1545                          
1546                              delete response;
1547                              PEG_METHOD_EXIT();
1548                              return(cimObjects);
1549                          }
1550                          
1551 david.dillard   1.9      
1552                          Array<CIMObjectPath> InternalCIMOMHandleRep::associatorNames(
1553                              const OperationContext & context,
1554                              const CIMNamespaceName &nameSpace,
1555                              const CIMObjectPath& objectName,
1556                              const CIMName& assocClass,
1557                              const CIMName& resultClass,
1558                              const String& role,
1559                              const String& resultRole)
1560                          {
1561                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
1562                                  "InternalCIMOMHandleRep::associatorNames");
1563                          
1564                          #ifdef PEGASUS_OS_OS400
1565                              // If this is running in user-state, then run the request
1566                              // through the user-state layer
1567                              if (_chOS400.hasKey())
1568                              {
1569                                  return _chOS400.associatorNames(
1570                                      context,
1571                                      nameSpace,
1572 david.dillard   1.9                  objectName,
1573                                      assocClass,
1574                                      resultClass,
1575                                      role,
1576                                      resultRole);
1577                              }
1578                          #endif
1579                          
1580                              CIMOMHandleOpSemaphore opsem(this);
1581                          
1582                              CIMAssociatorNamesRequestMessage* request =
1583                                  new CIMAssociatorNamesRequestMessage(
1584                                      XmlWriter::getNextMessageId(),
1585                                      nameSpace,
1586                                      objectName,
1587                                      assocClass,
1588                                      resultClass,
1589                                      role,
1590                                      resultRole,
1591                                      QueueIdStack(get_qid(), get_output_qid()));
1592                          
1593 david.dillard   1.9          request->dest = get_output_qid();
1594                          
1595                              CIMAssociatorNamesResponseMessage* response;
1596                          
1597                              try
1598                              {
1599                                  response = static_cast<CIMAssociatorNamesResponseMessage*>(
1600                                      do_request(
1601                                          request,
1602                                          CIM_ASSOCIATOR_NAMES_RESPONSE_MESSAGE,
1603                                          context));
1604                              }
1605                              catch (CIMException &)
1606                              {
1607                                  throw;
1608                              }
1609                              catch (...)
1610                              {
1611                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1612                                      "Exception caught in CIMOMHandle");
1613                                  //l10n
1614 david.dillard   1.9              //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1615                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1616                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1617                                      "Exception caught in CIMOMHandle"));
1618                              }
1619                          
1620                              Array<CIMObjectPath> cimObjectPaths = response->objectNames;
1621                          
1622                              delete response;
1623                              PEG_METHOD_EXIT();
1624                              return(cimObjectPaths);
1625                          }
1626                          
1627                          
1628                          Array<CIMObject> InternalCIMOMHandleRep::references(
1629                              const OperationContext & context,
1630                              const CIMNamespaceName &nameSpace,
1631                              const CIMObjectPath& objectName,
1632                              const CIMName& resultClass,
1633                              const String& role,
1634                              Boolean includeQualifiers,
1635 david.dillard   1.9          Boolean includeClassOrigin,
1636                              const CIMPropertyList& propertyList)
1637                          {
1638                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::references");
1639                          
1640                          #ifdef PEGASUS_OS_OS400
1641                              // If this is running in user-state, then run the request
1642                              // through the user-state layer
1643                              if (_chOS400.hasKey())
1644                              {
1645                                  return _chOS400.references(
1646                                      context,
1647                                      nameSpace,
1648                                      objectName,
1649                                      resultClass,
1650                                      role,
1651                                      includeQualifiers,
1652                                      includeClassOrigin,
1653                                      propertyList);
1654                              }
1655                          #endif
1656 david.dillard   1.9      
1657                              CIMOMHandleOpSemaphore opsem(this);
1658                          
1659                              CIMReferencesRequestMessage* request =
1660                                  new CIMReferencesRequestMessage(
1661                                      XmlWriter::getNextMessageId(),
1662                                      nameSpace,
1663                                      objectName,
1664                                      resultClass,
1665                                      role,
1666                                      includeQualifiers,
1667                                      includeClassOrigin,
1668                                      propertyList,
1669                                      QueueIdStack(get_qid(), get_output_qid()));
1670                          
1671                              request->dest = get_output_qid();
1672                          
1673                              CIMReferencesResponseMessage* response;
1674                          
1675                              try
1676                              {
1677 david.dillard   1.9              response = static_cast<CIMReferencesResponseMessage*>(
1678                                      do_request(
1679                                          request,
1680                                          CIM_REFERENCES_RESPONSE_MESSAGE,
1681                                          context));
1682                              }
1683                              catch (CIMException &)
1684                              {
1685                                  throw;
1686                              }
1687                              catch (...)
1688                              {
1689                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1690                                      "Exception caught in CIMOMHandle");
1691                                  //l10n
1692                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1693                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1694                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1695                                      "Exception caught in CIMOMHandle"));
1696                              }
1697                          
1698 david.dillard   1.9          Array<CIMObject> cimObjects = response->cimObjects;
1699                          
1700                              delete response;
1701                              PEG_METHOD_EXIT();
1702                              return(cimObjects);
1703                          }
1704                          
1705                          
1706                          Array<CIMObjectPath> InternalCIMOMHandleRep::referenceNames(
1707                              const OperationContext & context,
1708                              const CIMNamespaceName &nameSpace,
1709                              const CIMObjectPath& objectName,
1710                              const CIMName& resultClass,
1711                              const String& role)
1712                          {
1713                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE,
1714                                  "InternalCIMOMHandleRep::referenceNames");
1715                          
1716                          #ifdef PEGASUS_OS_OS400
1717                              // If this is running in user-state, then run the request
1718                              // through the user-state layer
1719 david.dillard   1.9          if (_chOS400.hasKey())
1720                              {
1721                                  return _chOS400.referenceNames(
1722                                      context,
1723                                      nameSpace,
1724                                      objectName,
1725                                      resultClass,
1726                                      role);
1727                              }
1728                          #endif
1729                          
1730                              CIMOMHandleOpSemaphore opsem(this);
1731                          
1732                              CIMReferenceNamesRequestMessage* request =
1733                                  new CIMReferenceNamesRequestMessage(
1734                                      XmlWriter::getNextMessageId(),
1735                                      nameSpace,
1736                                      objectName,
1737                                      resultClass,
1738                                      role,
1739                                      QueueIdStack(get_qid(), get_output_qid()));
1740 david.dillard   1.9      
1741                              request->dest = get_output_qid();
1742                          
1743                              CIMReferenceNamesResponseMessage* response;
1744                          
1745                              try
1746                              {
1747                                  response = static_cast<CIMReferenceNamesResponseMessage*>(
1748                                      do_request(
1749                                          request,
1750                                          CIM_REFERENCE_NAMES_RESPONSE_MESSAGE,
1751                                          context));
1752                              }
1753                              catch (CIMException &)
1754                              {
1755                                  throw;
1756                              }
1757                              catch (...)
1758                              {
1759                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1760                                      "Exception caught in CIMOMHandle");
1761 david.dillard   1.9              //l10n
1762                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1763                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1764                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1765                                      "Exception caught in CIMOMHandle"));
1766                              }
1767                          
1768                              Array<CIMObjectPath> cimObjectPaths = response->objectNames;
1769                          
1770                              delete response;
1771                              PEG_METHOD_EXIT();
1772                              return(cimObjectPaths);
1773                          }
1774                          
1775                          
1776                          CIMValue InternalCIMOMHandleRep::getProperty(
1777                              const OperationContext & context,
1778                              const CIMNamespaceName &nameSpace,
1779                              const CIMObjectPath& instanceName,
1780                              const CIMName& propertyName)
1781                          {
1782 david.dillard   1.9          PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::getProperty");
1783                          
1784                          #ifdef PEGASUS_OS_OS400
1785                              // If this is running in user-state, then run the request
1786                              // through the user-state layer
1787                              if (_chOS400.hasKey())
1788                              {
1789                                  return _chOS400.getProperty(
1790                                      context,
1791                                      nameSpace,
1792                                      instanceName,
1793                                      propertyName);
1794                              }
1795                          #endif
1796                          
1797                              CIMOMHandleOpSemaphore opsem(this);
1798                          
1799                              CIMGetPropertyRequestMessage* request =
1800                                  new CIMGetPropertyRequestMessage(
1801                                  XmlWriter::getNextMessageId(),
1802                                  nameSpace,
1803 david.dillard   1.9              instanceName,
1804                                  propertyName,
1805                                  QueueIdStack(get_qid(), get_output_qid()));
1806                          
1807                              request->dest = get_output_qid();
1808                          
1809                              CIMGetPropertyResponseMessage* response;
1810                          
1811                              try
1812                              {
1813                                  response = static_cast<CIMGetPropertyResponseMessage*>(
1814                                      do_request(
1815                                          request,
1816                                          CIM_GET_PROPERTY_RESPONSE_MESSAGE,
1817                                          context));
1818                              }
1819                              catch (CIMException &)
1820                              {
1821                                  throw;
1822                              }
1823                              catch (...)
1824 david.dillard   1.9          {
1825                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1826                                      "Exception caught in CIMOMHandle");
1827                                  //l10n
1828                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1829                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1830                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1831                                      "Exception caught in CIMOMHandle"));
1832                              }
1833                          
1834                              CIMValue cimValue = response->value;
1835                          
1836                              delete response;
1837                              PEG_METHOD_EXIT();
1838                              return(cimValue);
1839                          }
1840                          
1841                          
1842                          void InternalCIMOMHandleRep::setProperty(
1843                              const OperationContext & context,
1844                              const CIMNamespaceName &nameSpace,
1845 david.dillard   1.9          const CIMObjectPath& instanceName,
1846                              const CIMName& propertyName,
1847                              const CIMValue& newValue)
1848                          {
1849                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::setProperty");
1850                          
1851                          #ifdef PEGASUS_OS_OS400
1852                              // If this is running in user-state, then run the request
1853                              // through the user-state layer
1854                              if (_chOS400.hasKey())
1855                              {
1856                                  _chOS400.setProperty(
1857                                      context,
1858                                      nameSpace,
1859                                      instanceName,
1860                                      propertyName,
1861                                      newValue);
1862                                  return;
1863                              }
1864                          #endif
1865                          
1866 david.dillard   1.9          CIMOMHandleOpSemaphore opsem(this);
1867                          
1868                              CIMSetPropertyRequestMessage* request =
1869                                  new CIMSetPropertyRequestMessage(
1870                                      XmlWriter::getNextMessageId(),
1871                                      nameSpace,
1872                                      instanceName,
1873                                      propertyName,
1874                                      newValue,
1875                                      QueueIdStack(get_qid(), get_output_qid()));
1876                          
1877                          
1878                              request->dest = get_output_qid();
1879                          
1880                              CIMSetPropertyResponseMessage* response;
1881                          
1882                              try
1883                              {
1884                                  response = static_cast<CIMSetPropertyResponseMessage*>(
1885                                      do_request(
1886                                          request,
1887 david.dillard   1.9                      CIM_SET_PROPERTY_RESPONSE_MESSAGE,
1888                                          context));
1889                              }
1890                              catch (CIMException &)
1891                              {
1892                                  throw;
1893                              }
1894                              catch (...)
1895                              {
1896                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1897                                      "Exception caught in CIMOMHandle");
1898                                  //l10n
1899                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1900                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1901                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1902                                      "Exception caught in CIMOMHandle"));
1903                              }
1904                          
1905                              delete response;
1906                              PEG_METHOD_EXIT();
1907                              return;
1908 david.dillard   1.9      }
1909                          
1910                          
1911                          CIMValue InternalCIMOMHandleRep::invokeMethod(
1912                              const OperationContext & context,
1913                              const CIMNamespaceName &nameSpace,
1914                              const CIMObjectPath& instanceName,
1915                              const CIMName& methodName,
1916                              const Array<CIMParamValue>& inParameters,
1917                              Array<CIMParamValue>& outParameters)
1918                          {
1919                              PEG_METHOD_ENTER(TRC_CIMOM_HANDLE, "InternalCIMOMHandleRep::invokeMethod");
1920                          
1921                          #ifdef PEGASUS_OS_OS400
1922                              // If this is running in user-state, then run the request
1923                              // through the user-state layer
1924                              if (_chOS400.hasKey())
1925                              {
1926                                  return _chOS400.invokeMethod(
1927                                      context,
1928                                      nameSpace,
1929 david.dillard   1.9                  instanceName,
1930                                      methodName,
1931                                      inParameters,
1932                                      outParameters);
1933                              }
1934                          #endif
1935                          
1936                              CIMOMHandleOpSemaphore opsem(this);
1937                          
1938                              CIMInvokeMethodRequestMessage* request =
1939                                  new CIMInvokeMethodRequestMessage(
1940                                      XmlWriter::getNextMessageId(),
1941                                      nameSpace,
1942                                      instanceName,
1943                                      methodName,
1944                                      inParameters,
1945                                      QueueIdStack(get_qid(), get_output_qid()));
1946                          
1947                              CIMInvokeMethodResponseMessage* response;
1948                          
1949                              try
1950 david.dillard   1.9          {
1951                                  response = static_cast<CIMInvokeMethodResponseMessage*>(
1952                                      do_request(
1953                                          request,
1954                                          CIM_INVOKE_METHOD_RESPONSE_MESSAGE,
1955                                          context));
1956                              }
1957                              catch (CIMException &)
1958                              {
1959                                  throw;
1960                              }
1961                              catch (...)
1962                              {
1963                                  PEG_TRACE_STRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
1964                                      "Exception caught in CIMOMHandle");
1965                                  //l10n
1966                                  //throw CIMException(CIM_ERR_FAILED, "Exception caught in CIMOMHandle");
1967                                  throw CIMException(CIM_ERR_FAILED, MessageLoaderParms(
1968                                      "Provider.CIMOMHandle.CAUGHT_EXCEPTION",
1969                                      "Exception caught in CIMOMHandle"));
1970                              }
1971 david.dillard   1.9      
1972                              CIMValue value = response->retValue;
1973 kumpf           1.12.2.1     outParameters = response->outParameters;
1974 david.dillard   1.9      
1975                              delete response;
1976                              PEG_METHOD_EXIT();
1977                              return value;
1978                          }
1979                          
1980                          
1981                          //
1982                          // Public CIMOMHandle Methods
1983                          //
1984                          
1985                          void InternalCIMOMHandleRep::disallowProviderUnload()
1986                          {
1987                          #ifdef PEGASUS_OS_OS400
1988                              // If this is running in user-state, then run the request
1989                              // through the user-state layer
1990                              if (_chOS400.hasKey())
1991                              {
1992                                  _chOS400.disallowProviderUnload();
1993                                  return;
1994                              }
1995 david.dillard   1.9      #endif
1996                          
1997                              CIMOMHandleRep::disallowProviderUnload();
1998                          }
1999                          
2000                          void InternalCIMOMHandleRep::allowProviderUnload()
2001                          {
2002                          #ifdef PEGASUS_OS_OS400
2003                              // If this is running in user-state, then run the request
2004                              // through the user-state layer
2005                              if (_chOS400.hasKey())
2006                              {
2007                                  _chOS400.allowProviderUnload();
2008                                  return;
2009                              }
2010                          #endif
2011                          
2012                              CIMOMHandleRep::allowProviderUnload();
2013                          }
2014                          
2015                          #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
2016 david.dillard   1.9      OperationContext InternalCIMOMHandleRep::getResponseContext()
2017                          {
2018                              OperationContext ctx;
2019                          
2020                              Thread* curThrd = Thread::getCurrent();
2021                              if (curThrd == NULL)
2022                              {
2023                                  ctx.insert(ContentLanguageListContainer(ContentLanguages::EMPTY));
2024                              }
2025                              else
2026                              {
2027                                  ContentLanguages* contentLangs = (ContentLanguages*)
2028                                      curThrd->reference_tsd("cimomHandleContentLanguages");
2029                                  curThrd->dereference_tsd();
2030                           
2031                                  if (contentLangs == NULL)
2032                                  {
2033                                      ctx.insert(ContentLanguageListContainer(ContentLanguages::EMPTY));
2034                                  }
2035                                  else
2036                                  {
2037 david.dillard   1.9                  ctx.insert(ContentLanguageListContainer(*contentLangs));
2038                                      // delete the old tsd to free the memory
2039                                      curThrd->delete_tsd("cimomHandleContentLanguages");
2040                                  }
2041                              }
2042                          
2043                              return ctx;
2044                          }
2045                          #endif
2046                          
2047                          PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2