(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.23 and 1.29

version 1.23, 2006/11/14 18:34:56 version 1.29, 2008/11/26 01:33:05
Line 34 
Line 34 
 #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 222 
Line 250 
         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();
Line 286 
Line 313 
     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          request,
     // this 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 333 
Line 340 
         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*>(         localInstance.setPath(static_cast<CIMGetInstanceRequestMessage*>(
             getRequest())->instanceName);             getRequest())->instanceName);
     }     }
   #endif
     SimpleInstanceResponseHandler::deliver(     SimpleInstanceResponseHandler::deliver(
         _normalizer.processInstance(localInstance));         _normalizer.processInstance(localInstance));
 #else  
     SimpleInstanceResponseHandler::deliver(cimInstance);  
 #endif  
 } }
  
 void GetInstanceResponseHandler::complete() void GetInstanceResponseHandler::complete()
Line 380 
Line 383 
         CIMGetInstanceResponseMessage& msg =         CIMGetInstanceResponseMessage& msg =
             *static_cast<CIMGetInstanceResponseMessage*>(getResponse());             *static_cast<CIMGetInstanceResponseMessage*>(getResponse());
  
         msg.cimInstance = getObjects()[0];          msg.setCimInstance(getObjects()[0]);
     }     }
 } }
  
Line 404 
Line 407 
     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          request,
     // this 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 441 
Line 425 
         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  
 } }
  
 String EnumerateInstancesResponseHandler::getClass() const String EnumerateInstancesResponseHandler::getClass() const
Line 459 
Line 439 
     CIMEnumerateInstancesResponseMessage& msg =     CIMEnumerateInstancesResponseMessage& msg =
         *static_cast<CIMEnumerateInstancesResponseMessage*>(getResponse());         *static_cast<CIMEnumerateInstancesResponseMessage*>(getResponse());
  
     msg.cimNamedInstances = getObjects();      msg.setNamedInstances(getObjects());
 } }
  
 // //
Line 472 
Line 452 
     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          request,
     // this 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,  
         false,         false,
         false,         false,
         request->nameSpace,          _normalizer);
         tmpContext);  
     _normalizer = tmpNormalizer;  
 #endif  
 } }
  
 void EnumerateInstanceNamesResponseHandler::deliver( void EnumerateInstanceNamesResponseHandler::deliver(
Line 511 
Line 471 
         throw CIMException(CIM_ERR_FAILED, message);         throw CIMException(CIM_ERR_FAILED, message);
     }     }
  
 #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION  
     SimpleObjectPathResponseHandler::deliver(     SimpleObjectPathResponseHandler::deliver(
         _normalizer.processInstanceObjectPath(cimObjectPath));         _normalizer.processInstanceObjectPath(cimObjectPath));
 #else  
     SimpleObjectPathResponseHandler::deliver(cimObjectPath);  
 #endif  
 } }
  
 String EnumerateInstanceNamesResponseHandler::getClass() const String EnumerateInstanceNamesResponseHandler::getClass() const


Legend:
Removed from v.1.23  
changed lines
  Added in v.1.29

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2