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

Diff for /pegasus/src/Pegasus/ProviderManager2/OperationResponseHandler.cpp between version 1.18 and 1.33.2.7

version 1.18, 2006/08/30 19:39:52 version 1.33.2.7, 2009/12/08 13:59:37
Line 1 
Line 1 
 //%2006////////////////////////////////////////////////////////////////////////  //%LICENSE////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development  // Licensed to The Open Group (TOG) under one or more contributor license
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.  // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;  // this work for additional information regarding copyright ownership.
 // IBM Corp.; EMC Corporation, The Open Group.  // Each contributor licenses this file to you under the OpenPegasus Open
 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;  // Source License; you may not use this file except in compliance with the
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.  // License.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;  //
 // EMC Corporation; VERITAS Software Corporation; The Open Group.  // Permission is hereby granted, free of charge, to any person obtaining a
 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;  // copy of this software and associated documentation files (the "Software"),
 // EMC Corporation; Symantec Corporation; The Open Group.  // to deal in the Software without restriction, including without limitation
 //  // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 // Permission is hereby granted, free of charge, to any person obtaining a copy  // and/or sell copies of the Software, and to permit persons to whom the
 // of this software and associated documentation files (the "Software"), to  // Software is furnished to do so, subject to the following conditions:
 // deal in the Software without restriction, including without limitation the  //
 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or  // The above copyright notice and this permission notice shall be included
 // sell copies of the Software, and to permit persons to whom the Software is  // in all copies or substantial portions of the Software.
 // furnished to do so, subject to the following conditions:  //
 //  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN  // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED  // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT  // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR  // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT  // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN  // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION  
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  
 // //
 //==============================================================================  //////////////////////////////////////////////////////////////////////////
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include "OperationResponseHandler.h" #include "OperationResponseHandler.h"
 #include "CIMOMHandleContext.h" #include "CIMOMHandleContext.h"
  
 #include <Pegasus/Common/Logger.h>  #include <Pegasus/Common/Tracer.h>
 #include <Pegasus/Common/AutoPtr.h>  #include <Pegasus/Common/SharedPtr.h>
 #include <Pegasus/Provider/CIMOMHandle.h> #include <Pegasus/Provider/CIMOMHandle.h>
   #include <Pegasus/Config/ConfigManager.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
   static void _initializeNormalizer(
       CIMOperationRequestMessage *request,
       Boolean includeQualifiers,
       Boolean includeClassOrigin,
       ObjectNormalizer &normalizer)
   {
       // Attempt to get the cached class definition, normalization is disabled
       // if it does not exist.
       if (request->operationContext.contains(
               CachedClassDefinitionContainer::NAME))
       {
           CachedClassDefinitionContainer container =
               request->operationContext.get(
                   CachedClassDefinitionContainer::NAME);
           CIMClass cimClass = container.getClass().clone();
           container = CachedClassDefinitionContainer(cimClass);
           SharedPtr<NormalizerContext> tmpContext(new CIMOMHandleContext());
           ObjectNormalizer tmpNormalizer(
               cimClass,
               includeQualifiers,
               includeClassOrigin,
               request->nameSpace,
               tmpContext);
           normalizer = tmpNormalizer;
       }
   }
   
 // //
 // OperationResponseHandler // OperationResponseHandler
 // //
Line 93 
Line 119 
         _response = 0;         _response = 0;
 } }
  
 CIMRequestMessage * OperationResponseHandler::getRequest(void) const  CIMRequestMessage* OperationResponseHandler::getRequest() const
 { {
     return(_request);      return _request;
 } }
  
 CIMResponseMessage * OperationResponseHandler::getResponse(void) const  CIMResponseMessage* OperationResponseHandler::getResponse() const
 { {
     return(_response);      return _response;
 } }
  
 void OperationResponseHandler::setStatus( void OperationResponseHandler::setStatus(
     const Uint32 code,     const Uint32 code,
     const String & message)     const String & message)
 { {
     _response->cimException = PEGASUS_CIM_EXCEPTION(CIMStatusCode(code), message);      _response->cimException =
           PEGASUS_CIM_EXCEPTION(CIMStatusCode(code), message);
 } }
  
 void OperationResponseHandler::setStatus( void OperationResponseHandler::setStatus(
Line 122 
Line 149 
         message);         message);
 } }
  
 Boolean OperationResponseHandler::isAsync(void) const  void OperationResponseHandler::setCIMException(
       const CIMException& cimException)
   {
       // Assign the cimException argument to _response->cimException. Note that
       // there is no need to use the PEGASUS_CIM_EXCEPTION_LANG() macro to create
       // a TraceableCIMException since both _response->cimException and
       // cimException are of type CIMException and the TraceableCIMException
       // constructor has no side effects.
       _response->cimException = cimException;
   }
   
   Boolean OperationResponseHandler::isAsync() const
 { {
     return _responseChunkCallback != 0;     return _responseChunkCallback != 0;
 } }
Line 155 
Line 193 
         // preserve traditional behavior         // preserve traditional behavior
         if (isComplete)         if (isComplete)
         {         {
             if (_response->operationContext.contains(              if (_response != 0)
                     ContentLanguageListContainer::NAME))  
             {             {
                 _response->operationContext.set(                 _response->operationContext.set(
                     ContentLanguageListContainer(simpleP->getLanguages()));                     ContentLanguageListContainer(simpleP->getLanguages()));
Line 191 
Line 228 
         _response->setComplete(isComplete);         _response->setComplete(isComplete);
         _responseObjectTotal += objectCount;         _responseObjectTotal += objectCount;
  
         // since we are reusing response for every chunk,keep track of original count      // since we are reusing response for every chunk, keep track of original
       // count
         _response->setIndex(_responseMessageTotal++);         _response->setIndex(_responseMessageTotal++);
  
         // set the originally allocated response to one more than the current.         // set the originally allocated response to one more than the current.
Line 210 
Line 248 
         simple.clear();         simple.clear();
     }     }
  
         String function = getClass() + "::" + "transfer";      PEG_TRACE((
         Logger::put(          TRC_PROVIDERMANAGER,
         Logger::STANDARD_LOG,          Tracer::LEVEL4,
         System::CIMSERVER,          "%s::transfer",
         Logger::TRACE,          (const char*) getClass().getCString()));
         function);  
  
         transfer();         transfer();
         simple.clear();         simple.clear();
  
         // l10n      _response->operationContext.set(
         _response->operationContext.set(ContentLanguageListContainer(simple.getLanguages()));          ContentLanguageListContainer(simple.getLanguages()));
  
         // call thru ProviderManager to get externally declared entry point         // call thru ProviderManager to get externally declared entry point
  
Line 236 
Line 273 
         _response = response;         _response = response;
 } }
  
 void OperationResponseHandler::transfer(void)  void OperationResponseHandler::transfer()
 { {
 } }
  
 void OperationResponseHandler::validate(void)  void OperationResponseHandler::validate()
 { {
 } }
  
 String OperationResponseHandler::getClass(void) const  String OperationResponseHandler::getClass() const
 { {
     return(String("OperationResponseHandler"));      return String("OperationResponseHandler");
 } }
  
 Uint32 OperationResponseHandler::getResponseObjectTotal(void) const  Uint32 OperationResponseHandler::getResponseObjectTotal() const
 { {
     return(_responseObjectTotal);      return _responseObjectTotal;
 } }
  
 Uint32 OperationResponseHandler::getResponseMessageTotal(void) const  Uint32 OperationResponseHandler::getResponseMessageTotal() const
 { {
     return(_responseMessageTotal);      return _responseMessageTotal;
 } }
  
 Uint32 OperationResponseHandler::getResponseObjectThreshold(void) const  Uint32 OperationResponseHandler::getResponseObjectThreshold() const
 { {
     return(_responseObjectThreshold);      return _responseObjectThreshold;
 } }
  
 // //
Line 274 
Line 311 
     PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)     PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
     : OperationResponseHandler(request, response, responseChunkCallback)     : OperationResponseHandler(request, response, responseChunkCallback)
 { {
     #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION      _initializeNormalizer(
     // Attempt to get the cached class definition used to validate results of this          request,
     // operation. If it does not exist, then this feature is disabled for this  
     // operation.  
     CIMClass cimClass;  
   
     if(request->operationContext.contains(CachedClassDefinitionContainer::NAME))  
     {  
         CachedClassDefinitionContainer container =  
             request->operationContext.get(  
                 CachedClassDefinitionContainer::NAME);  
   
         cimClass = container.getClass();  
     }  
   
     AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext());  
     ObjectNormalizer tmpNormalizer(  
         cimClass,  
         request->includeQualifiers,         request->includeQualifiers,
         request->includeClassOrigin,         request->includeClassOrigin,
         request->nameSpace,          _normalizer);
         tmpContext);  
     _normalizer = tmpNormalizer;  
     #endif  
 } }
  
 void GetInstanceResponseHandler::deliver(const CIMInstance & cimInstance) void GetInstanceResponseHandler::deliver(const CIMInstance & cimInstance)
Line 320 
Line 338 
         throw CIMException(CIM_ERR_FAILED, message);         throw CIMException(CIM_ERR_FAILED, message);
     }     }
  
       CIMInstance localInstance(cimInstance);
     #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION     #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION
     // The normalizer expects an object path embedded in instances even     // The normalizer expects an object path embedded in instances even
     // though it is not required by this operation. Use the requested     // though it is not required by this operation. Use the requested
     // object path is missing from the instance.     // object path is missing from the instance.
     CIMInstance localInstance(cimInstance);  
   
     if(localInstance.getPath().getKeyBindings().size() == 0)     if(localInstance.getPath().getKeyBindings().size() == 0)
     {     {
         // ATTN: should clone before modification         // ATTN: should clone before modification
         localInstance.setPath(static_cast<CIMGetInstanceRequestMessage *>(getRequest())->instanceName);          localInstance.setPath(static_cast<CIMGetInstanceRequestMessage*>(
               getRequest())->instanceName);
       }
   #endif
       SimpleInstanceResponseHandler::deliver(
           _normalizer.processInstance(localInstance));
   }
   
   void GetInstanceResponseHandler::deliver(const SCMOInstance& cimInstance)
   {
       if (cimInstance.isUninitialized())
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
   
       if (SimpleInstanceResponseHandler::size() != 0)
       {
           MessageLoaderParms message(
               "Server.OperationResponseHandler.TOO_MANY_OBJECTS_DELIVERED",
               "Too many objects delivered.");
   
           throw CIMException(CIM_ERR_FAILED, message);
     }     }
  
     SimpleInstanceResponseHandler::deliver(_normalizer.processInstance(localInstance));  
     #else  
     SimpleInstanceResponseHandler::deliver(cimInstance);     SimpleInstanceResponseHandler::deliver(cimInstance);
     #endif  
 } }
  
 void GetInstanceResponseHandler::complete(void)  void GetInstanceResponseHandler::complete()
 { {
     if(SimpleInstanceResponseHandler::size() == 0)     if(SimpleInstanceResponseHandler::size() == 0)
     {     {
         MessageLoaderParms message(         MessageLoaderParms message(
             "Server.OperationResponseHandler.TOO_FEW_OBJECTS_DELIVERED",             "Server.OperationResponseHandler.TOO_FEW_OBJECTS_DELIVERED",
             "Too few objects delivered.");             "Too few objects delivered.");
           // Provider claims success, no instances returned. -V see Bug #4104
           setStatus(CIM_ERR_NOT_FOUND);
         throw CIMException(CIM_ERR_FAILED, message);         throw CIMException(CIM_ERR_FAILED, message);
     }     }
  
     SimpleInstanceResponseHandler::complete();     SimpleInstanceResponseHandler::complete();
 } }
  
 String GetInstanceResponseHandler::getClass(void) const  String GetInstanceResponseHandler::getClass() const
 { {
     return(String("GetInstanceResponseHandler"));      return String("GetInstanceResponseHandler");
 } }
  
 void GetInstanceResponseHandler::transfer(void)  void GetInstanceResponseHandler::transfer()
 { {
     if(size() > 0)     if(size() > 0)
     {     {
         CIMGetInstanceResponseMessage & msg =         CIMGetInstanceResponseMessage & msg =
             *static_cast<CIMGetInstanceResponseMessage *>(getResponse());             *static_cast<CIMGetInstanceResponseMessage *>(getResponse());
           Array<CIMInstance> cimObjs= getObjects();
         msg.cimInstance = getObjects()[0];          Array<SCMOInstance> scmoObjs= getSCMOObjects();
           if (cimObjs.size() != 0)
           {
               msg.getResponseData().setInstance(cimObjs[0]);
           }
           else
           {
               msg.getResponseData().setSCMO(scmoObjs);
           }
     }     }
 } }
  
 void GetInstanceResponseHandler::validate(void)  void GetInstanceResponseHandler::validate()
 { {
     if(getResponseObjectTotal() == 0)     if(getResponseObjectTotal() == 0)
     {     {
Line 388 
Line 436 
     PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)     PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
     : OperationResponseHandler(request, response, responseChunkCallback)     : OperationResponseHandler(request, response, responseChunkCallback)
 { {
     #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION      _initializeNormalizer(
     // Attempt to get the cached class definition used to validate results of this          request,
     // operation. If it does not exist, then this feature is disabled for this  
     // operation.  
     CIMClass cimClass;  
   
     if(request->operationContext.contains(CachedClassDefinitionContainer::NAME))  
     {  
         CachedClassDefinitionContainer container =  
             request->operationContext.get(  
                 CachedClassDefinitionContainer::NAME);  
         cimClass = container.getClass();  
     }  
   
     AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext());  
     ObjectNormalizer tmpNormalizer(  
         cimClass,  
         request->includeQualifiers,         request->includeQualifiers,
         request->includeClassOrigin,         request->includeClassOrigin,
         request->nameSpace,          _normalizer);
         tmpContext);  
     _normalizer = tmpNormalizer;  
 #endif  
 } }
  
 void EnumerateInstancesResponseHandler::deliver(const CIMInstance & cimInstance) void EnumerateInstancesResponseHandler::deliver(const CIMInstance & cimInstance)
Line 424 
Line 454 
         throw CIMException(CIM_ERR_FAILED, message);         throw CIMException(CIM_ERR_FAILED, message);
     }     }
  
     #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION      SimpleInstanceResponseHandler::deliver(
     SimpleInstanceResponseHandler::deliver(_normalizer.processInstance(cimInstance));          _normalizer.processInstance(cimInstance));
     #else  }
     SimpleInstanceResponseHandler::deliver(cimInstance);  
     #endif  void EnumerateInstancesResponseHandler::deliver(
       const SCMOInstance& scmoInstance)
   {
       if (scmoInstance.isUninitialized())
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
       SimpleInstanceResponseHandler::deliver(scmoInstance);
 } }
  
 String EnumerateInstancesResponseHandler::getClass(void) const  String EnumerateInstancesResponseHandler::getClass() const
 { {
     return(String("EnumerateInstancesResponseHandler"));      return String("EnumerateInstancesResponseHandler");
 } }
  
 void EnumerateInstancesResponseHandler::transfer(void)  void EnumerateInstancesResponseHandler::transfer()
 { {
     CIMEnumerateInstancesResponseMessage & msg =     CIMEnumerateInstancesResponseMessage & msg =
         *static_cast<CIMEnumerateInstancesResponseMessage *>(getResponse());         *static_cast<CIMEnumerateInstancesResponseMessage *>(getResponse());
  
     msg.cimNamedInstances = getObjects();      Array<CIMInstance> cimObjs= getObjects();
       Array<SCMOInstance> scmoObjs= getSCMOObjects();
       if (cimObjs.size() != 0)
       {
           msg.getResponseData().setInstances(cimObjs);
       }
       if (scmoObjs.size() != 0)
       {
           msg.getResponseData().setSCMO(scmoObjs);
       }
 } }
  
 // //
Line 454 
Line 504 
     PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)     PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
     : OperationResponseHandler(request, response, responseChunkCallback)     : OperationResponseHandler(request, response, responseChunkCallback)
 { {
     #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION      _initializeNormalizer(
     // Attempt to get the cached class definition used to validate results of this          request,
     // operation. If it does not exist, then this feature is disabled for this          false,
     // operation.          false,
     CIMClass cimClass;          _normalizer);
   }
  
     if(request->operationContext.contains(CachedClassDefinitionContainer::NAME))  void EnumerateInstanceNamesResponseHandler::deliver(
       const CIMObjectPath& cimObjectPath)
     {     {
         CachedClassDefinitionContainer container =      if (cimObjectPath.getClassName().isNull())
             request->operationContext.get(      {
                 CachedClassDefinitionContainer::NAME);          MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
  
         cimClass = container.getClass();          throw CIMException(CIM_ERR_FAILED, message);
     }     }
  
     AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext());      SimpleObjectPathResponseHandler::deliver(
     ObjectNormalizer tmpNormalizer(          _normalizer.processInstanceObjectPath(cimObjectPath));
         cimClass,  
         false,  
         false,  
         request->nameSpace,  
         tmpContext);  
     _normalizer = tmpNormalizer;  
 #endif  
 } }
  
 void EnumerateInstanceNamesResponseHandler::deliver(const CIMObjectPath & cimObjectPath)  void EnumerateInstanceNamesResponseHandler::deliver(
       const SCMOInstance& scmoObjectPath)
 { {
     if(cimObjectPath.getClassName().isNull())      if (scmoObjectPath.getClassName()==NULL)
     {     {
         MessageLoaderParms message(         MessageLoaderParms message(
             "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",             "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
Line 491 
Line 539 
         throw CIMException(CIM_ERR_FAILED, message);         throw CIMException(CIM_ERR_FAILED, message);
     }     }
  
     #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION      SimpleObjectPathResponseHandler::deliver(scmoObjectPath);
     SimpleObjectPathResponseHandler::deliver(_normalizer.processInstanceObjectPath(cimObjectPath));  
     #else  
     SimpleObjectPathResponseHandler::deliver(cimObjectPath);  
     #endif  
 } }
  
 String EnumerateInstanceNamesResponseHandler::getClass(void) const  String EnumerateInstanceNamesResponseHandler::getClass() const
 { {
     return(String("EnumerateInstanceNamesResponseHandler"));      return String("EnumerateInstanceNamesResponseHandler");
 } }
  
 void EnumerateInstanceNamesResponseHandler::transfer(void)  void EnumerateInstanceNamesResponseHandler::transfer()
 { {
     CIMEnumerateInstanceNamesResponseMessage & msg =     CIMEnumerateInstanceNamesResponseMessage & msg =
         *static_cast<CIMEnumerateInstanceNamesResponseMessage *>(getResponse());         *static_cast<CIMEnumerateInstanceNamesResponseMessage *>(getResponse());
  
     msg.instanceNames = getObjects();      Array<CIMObjectPath> cimObjs= getObjects();
       Array<SCMOInstance> scmoObjs= getSCMOObjects();
       if (cimObjs.size() != 0)
       {
           msg.getResponseData().setInstanceNames(cimObjs);
       }
       if (scmoObjs.size() != 0)
       {
           msg.getResponseData().setSCMO(scmoObjs);
       }
 } }
  
 // //
Line 546 
Line 599 
     SimpleObjectPathResponseHandler::deliver(cimObjectPath);     SimpleObjectPathResponseHandler::deliver(cimObjectPath);
 } }
  
 void CreateInstanceResponseHandler::complete(void)  void CreateInstanceResponseHandler::complete()
 { {
     if(SimpleObjectPathResponseHandler::size() == 0)     if(SimpleObjectPathResponseHandler::size() == 0)
     {     {
Line 560 
Line 613 
     SimpleObjectPathResponseHandler::complete();     SimpleObjectPathResponseHandler::complete();
 } }
  
 String CreateInstanceResponseHandler::getClass(void) const  String CreateInstanceResponseHandler::getClass() const
 { {
     return(String("CreateInstanceResponseHandler"));      return String("CreateInstanceResponseHandler");
 } }
  
 #if 0 #if 0
 // ATTN: is it an error to not return instance name? // ATTN: is it an error to not return instance name?
 void CreateInstanceResponseHandler::validate(void)  void CreateInstanceResponseHandler::validate()
 { {
     if(getResponseObjectTotal() == 0)     if(getResponseObjectTotal() == 0)
     {     {
Line 576 
Line 629 
 } }
 #endif #endif
  
 void CreateInstanceResponseHandler::transfer(void)  void CreateInstanceResponseHandler::transfer()
 { {
     if(size() > 0)     if(size() > 0)
     {     {
         CIMCreateInstanceResponseMessage & msg =         CIMCreateInstanceResponseMessage & msg =
             *static_cast<CIMCreateInstanceResponseMessage *>(getResponse());             *static_cast<CIMCreateInstanceResponseMessage *>(getResponse());
  
         msg.instanceName = getObjects()[0];          Array<CIMObjectPath> cimObjs= getObjects();
           Array<SCMOInstance> scmoObjs= getSCMOObjects();
           if (cimObjs.size() != 0)
           {
               msg.instanceName = cimObjs[0];
           }
           else
           {
               scmoObjs[0].getCIMObjectPath(msg.instanceName);
           }
     }     }
 } }
  
Line 599 
Line 661 
 { {
 } }
  
 String ModifyInstanceResponseHandler::getClass(void) const  String ModifyInstanceResponseHandler::getClass() const
 { {
     return(String("ModifyInstanceResponseHandler"));      return String("ModifyInstanceResponseHandler");
 } }
  
 // //
Line 616 
Line 678 
 { {
 } }
  
 String DeleteInstanceResponseHandler::getClass(void) const  String DeleteInstanceResponseHandler::getClass() const
 { {
     return(String("DeleteInstanceResponseHandler"));      return String("DeleteInstanceResponseHandler");
 } }
  
 // //
Line 647 
Line 709 
     SimpleValueResponseHandler::deliver(cimValue);     SimpleValueResponseHandler::deliver(cimValue);
 } }
  
 String GetPropertyResponseHandler::getClass(void) const  String GetPropertyResponseHandler::getClass() const
 { {
     return(String("GetPropertyResponseHandler"));      return String("GetPropertyResponseHandler");
 } }
  
 void GetPropertyResponseHandler::transfer(void)  void GetPropertyResponseHandler::transfer()
 { {
     if(size() > 0)     if(size() > 0)
     {     {
Line 663 
Line 725 
     }     }
 } }
  
 void GetPropertyResponseHandler::validate(void)  void GetPropertyResponseHandler::validate()
 { {
     // error? provider claims success,     // error? provider claims success,
     // but did not deliver an instance.     // but did not deliver an instance.
Line 685 
Line 747 
 { {
 } }
  
 String SetPropertyResponseHandler::getClass(void) const  String SetPropertyResponseHandler::getClass() const
 { {
     return(String("SetPropertyResponseHandler"));      return String("SetPropertyResponseHandler");
 } }
  
 // //
Line 716 
Line 778 
     SimpleInstance2ObjectResponseHandler::deliver(cimInstance);     SimpleInstance2ObjectResponseHandler::deliver(cimInstance);
 } }
  
 String ExecQueryResponseHandler::getClass(void) const  void ExecQueryResponseHandler::deliver(const SCMOInstance& scmoInstance)
   {
       if (scmoInstance.isUninitialized())
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
   
       SimpleInstance2ObjectResponseHandler::deliver(scmoInstance);
   }
   
   String ExecQueryResponseHandler::getClass() const
 { {
     return(String("ExecQueryResponseHandler"));      return String("ExecQueryResponseHandler");
 } }
  
 void ExecQueryResponseHandler::transfer(void)  void ExecQueryResponseHandler::transfer()
 { {
     CIMExecQueryResponseMessage & msg =     CIMExecQueryResponseMessage & msg =
         *static_cast<CIMExecQueryResponseMessage *>(getResponse());         *static_cast<CIMExecQueryResponseMessage *>(getResponse());
  
     msg.cimObjects = getObjects();      Array<CIMObject> cimObjs= getObjects();
       Array<SCMOInstance> scmoObjs= getSCMOObjects();
       if (cimObjs.size() != 0)
       {
           msg.getResponseData().setObjects(cimObjs);
       }
       if (scmoObjs.size() != 0)
       {
           msg.getResponseData().setSCMO(scmoObjs);
       }
 } }
  
 Boolean ExecQueryResponseHandler::isAsync(void) const  Boolean ExecQueryResponseHandler::isAsync() const
 { {
     return(false);      return false;
 } }
  
 // //
Line 760 
Line 845 
     SimpleObjectResponseHandler::deliver(cimObject);     SimpleObjectResponseHandler::deliver(cimObject);
 } }
  
 String AssociatorsResponseHandler::getClass(void) const  void AssociatorsResponseHandler::deliver(const CIMInstance& cimInstance)
 { {
     return(String("AssociatorsResponseHandler"));      if (cimInstance.isUninitialized())
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
   
       SimpleObjectResponseHandler::deliver(cimInstance);
   }
   
   void AssociatorsResponseHandler::deliver(const SCMOInstance& scmoObject)
   {
       if (scmoObject.isUninitialized())
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
       SimpleObjectResponseHandler::deliver(scmoObject);
   }
   
   String AssociatorsResponseHandler::getClass() const
   {
       return String("AssociatorsResponseHandler");
 } }
  
 void AssociatorsResponseHandler::transfer(void)  void AssociatorsResponseHandler::transfer()
 { {
     CIMAssociatorsResponseMessage & msg =     CIMAssociatorsResponseMessage & msg =
         *static_cast<CIMAssociatorsResponseMessage *>(getResponse());         *static_cast<CIMAssociatorsResponseMessage *>(getResponse());
  
     msg.cimObjects = getObjects();      Array<CIMObject> cimObjs= getObjects();
       Array<SCMOInstance> scmoObjs= getSCMOObjects();
       if (cimObjs.size() != 0)
       {
           msg.getResponseData().setObjects(cimObjs);
       }
       if (scmoObjs.size() != 0)
       {
           msg.getResponseData().setSCMO(scmoObjs);
       }
 } }
  
 // //
Line 799 
Line 920 
     SimpleObjectPathResponseHandler::deliver(cimObjectPath);     SimpleObjectPathResponseHandler::deliver(cimObjectPath);
 } }
  
 String AssociatorNamesResponseHandler::getClass(void) const  void AssociatorNamesResponseHandler::deliver(const SCMOInstance& scmoObjectPath)
   {
       SimpleObjectPathResponseHandler::deliver(scmoObjectPath);
   }
   
   String AssociatorNamesResponseHandler::getClass() const
 { {
     return(String("AssociatorNamesResponseHandler"));      return String("AssociatorNamesResponseHandler");
 } }
  
 void AssociatorNamesResponseHandler::transfer(void)  void AssociatorNamesResponseHandler::transfer()
 { {
     CIMAssociatorNamesResponseMessage & msg =     CIMAssociatorNamesResponseMessage & msg =
         *static_cast<CIMAssociatorNamesResponseMessage *>(getResponse());         *static_cast<CIMAssociatorNamesResponseMessage *>(getResponse());
  
     msg.objectNames = getObjects();      Array<CIMObjectPath> cimObjs= getObjects();
       Array<SCMOInstance> scmoObjs= getSCMOObjects();
       if (cimObjs.size() != 0)
       {
           msg.getResponseData().setInstanceNames(cimObjs);
       }
       if (scmoObjs.size() != 0)
       {
           msg.getResponseData().setSCMO(scmoObjs);
       }
 } }
  
 // //
Line 838 
Line 973 
     SimpleObjectResponseHandler::deliver(cimObject);     SimpleObjectResponseHandler::deliver(cimObject);
 } }
  
 String ReferencesResponseHandler::getClass(void) const  void ReferencesResponseHandler::deliver(const SCMOInstance& scmoObject)
   {
       if (scmoObject.isUninitialized())
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
       SimpleObjectResponseHandler::deliver(scmoObject);
   }
   
   String ReferencesResponseHandler::getClass() const
 { {
     return(String("ReferencesResponseHandler"));      return String("ReferencesResponseHandler");
 } }
  
 void ReferencesResponseHandler::transfer(void)  void ReferencesResponseHandler::transfer()
 { {
     CIMReferencesResponseMessage & msg =     CIMReferencesResponseMessage & msg =
         *static_cast<CIMReferencesResponseMessage *>(getResponse());         *static_cast<CIMReferencesResponseMessage *>(getResponse());
  
     msg.cimObjects = getObjects();      Array<CIMObject> cimObjs= getObjects();
       Array<SCMOInstance> scmoObjs= getSCMOObjects();
       if (cimObjs.size() != 0)
       {
           msg.getResponseData().setObjects(cimObjs);
       }
       if (scmoObjs.size() != 0)
       {
           msg.getResponseData().setSCMO(scmoObjs);
       }
 } }
  
 // //
Line 877 
Line 1034 
     SimpleObjectPathResponseHandler::deliver(cimObjectPath);     SimpleObjectPathResponseHandler::deliver(cimObjectPath);
 } }
  
 String ReferenceNamesResponseHandler::getClass(void) const  void ReferenceNamesResponseHandler::deliver(const SCMOInstance& scmoObjectPath)
   {
       SimpleObjectPathResponseHandler::deliver(scmoObjectPath);
   }
   
   String ReferenceNamesResponseHandler::getClass() const
 { {
     return(String("ReferenceNamesResponseHandler"));      return String("ReferenceNamesResponseHandler");
 } }
  
 void ReferenceNamesResponseHandler::transfer(void)  void ReferenceNamesResponseHandler::transfer()
 { {
     CIMReferenceNamesResponseMessage & msg =     CIMReferenceNamesResponseMessage & msg =
         *static_cast<CIMReferenceNamesResponseMessage *>(getResponse());         *static_cast<CIMReferenceNamesResponseMessage *>(getResponse());
  
     msg.objectNames = getObjects();      Array<CIMObjectPath> cimObjs= getObjects();
       Array<SCMOInstance> scmoObjs= getSCMOObjects();
       if (cimObjs.size() != 0)
       {
           msg.getResponseData().setInstanceNames(cimObjs);
       }
       if (scmoObjs.size() != 0)
       {
           msg.getResponseData().setSCMO(scmoObjs);
       }
 } }
  
 // //
Line 902 
Line 1073 
 { {
 } }
  
 void InvokeMethodResponseHandler::deliverParamValue(const CIMParamValue & cimParamValue)  void InvokeMethodResponseHandler::deliverParamValue(
       const CIMParamValue& cimParamValue)
 { {
     if(cimParamValue.isUninitialized())     if(cimParamValue.isUninitialized())
     {     {
Line 930 
Line 1102 
     SimpleMethodResultResponseHandler::deliver(cimValue);     SimpleMethodResultResponseHandler::deliver(cimValue);
 } }
  
 String InvokeMethodResponseHandler::getClass(void) const  String InvokeMethodResponseHandler::getClass() const
 { {
     return(String("InvokeMethodResponseHandler"));      return String("InvokeMethodResponseHandler");
 } }
  
 void InvokeMethodResponseHandler::transfer(void)  void InvokeMethodResponseHandler::transfer()
 { {
     CIMInvokeMethodResponseMessage & msg =     CIMInvokeMethodResponseMessage & msg =
         *static_cast<CIMInvokeMethodResponseMessage *>(getResponse());         *static_cast<CIMInvokeMethodResponseMessage *>(getResponse());
Line 964 
Line 1136 
     _provider = provider;     _provider = provider;
 } }
  
 void EnableIndicationsResponseHandler::deliver(const CIMIndication & cimIndication)  void EnableIndicationsResponseHandler::deliver(
       const CIMIndication& cimIndication)
 { {
     OperationContext context;     OperationContext context;
  
     Array<CIMObjectPath> subscriptionInstanceNames;     Array<CIMObjectPath> subscriptionInstanceNames;
  
     context.insert(SubscriptionInstanceNamesContainer(subscriptionInstanceNames));      context.insert(
           SubscriptionInstanceNamesContainer(subscriptionInstanceNames));
  
     deliver(context, cimIndication);     deliver(context, cimIndication);
 } }
  
 void EnableIndicationsResponseHandler::deliver(const OperationContext & context, const CIMIndication & cimIndication)  void EnableIndicationsResponseHandler::deliver(
       const OperationContext& context,
       const CIMIndication& cimIndication)
 { {
     if(cimIndication.isUninitialized())     if(cimIndication.isUninitialized())
     {     {
Line 1004 
Line 1180 
         subscriptionInstanceNames.clear();         subscriptionInstanceNames.clear();
     }     }
  
     // l10n  
     ContentLanguageList contentLangs;     ContentLanguageList contentLangs;
  
     if(context.contains(ContentLanguageListContainer::NAME))     if(context.contains(ContentLanguageListContainer::NAME))
Line 1022 
Line 1197 
         // the indication.  Fall back to the lang set in this object.         // the indication.  Fall back to the lang set in this object.
         contentLangs = getLanguages();         contentLangs = getLanguages();
     }     }
     // l10n -end  
  
     // create message     // create message
     // l10n  
     CIMProcessIndicationRequestMessage * request =     CIMProcessIndicationRequestMessage * request =
         new CIMProcessIndicationRequestMessage(         new CIMProcessIndicationRequestMessage(
         XmlWriter::getNextMessageId(),         XmlWriter::getNextMessageId(),
Line 1039 
Line 1212 
  
     if(request->operationContext.contains(ContentLanguageListContainer::NAME))     if(request->operationContext.contains(ContentLanguageListContainer::NAME))
     {     {
         request->operationContext.set(ContentLanguageListContainer(contentLangs));          request->operationContext.set(
               ContentLanguageListContainer(contentLangs));
     }     }
     else     else
     {     {
         request->operationContext.insert(ContentLanguageListContainer(contentLangs));          request->operationContext.insert(
               ContentLanguageListContainer(contentLangs));
     }     }
  
     _indicationCallback(request);     _indicationCallback(request);
 } }
  
 void EnableIndicationsResponseHandler::deliver(const Array<CIMIndication> & cimIndications)  void EnableIndicationsResponseHandler::deliver(
       const Array<CIMIndication>& cimIndications)
 { {
     OperationContext context;     OperationContext context;
  
     deliver(context, cimIndications);     deliver(context, cimIndications);
 } }
  
 void EnableIndicationsResponseHandler::deliver(const OperationContext & context, const Array<CIMIndication> & cimIndications)  void EnableIndicationsResponseHandler::deliver(
       const OperationContext& context,
       const Array<CIMIndication>& cimIndications)
 { {
     for(Uint32 i = 0, n = cimIndications.size(); i < n; i++)     for(Uint32 i = 0, n = cimIndications.size(); i < n; i++)
     {     {
Line 1064 
Line 1242 
     }     }
 } }
  
 String EnableIndicationsResponseHandler::getClass(void) const  String EnableIndicationsResponseHandler::getClass() const
 { {
     return(String("EnableIndicationsResponseHandler"));      return String("EnableIndicationsResponseHandler");
 } }
  
 Boolean EnableIndicationsResponseHandler::isAsync(void) const  Boolean EnableIndicationsResponseHandler::isAsync() const
 { {
     return(false);      return false;
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.18  
changed lines
  Added in v.1.33.2.7

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2