(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.11.8.3 and 1.20

version 1.11.8.3, 2006/03/07 18:45:56 version 1.20, 2006/09/01 17:38:20
Line 29 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Chip Vincent (cvincent@us.ibm.com)  
 //  
 // Modified By:  
 //         Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase2  
 //         Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include "OperationResponseHandler.h" #include "OperationResponseHandler.h"
   #include "CIMOMHandleContext.h"
  
 #include <Pegasus/Common/Logger.h> #include <Pegasus/Common/Logger.h>
   #include <Pegasus/Common/AutoPtr.h>
   #include <Pegasus/Provider/CIMOMHandle.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 127 
Line 124 
  
 Boolean OperationResponseHandler::isAsync(void) const Boolean OperationResponseHandler::isAsync(void) const
 { {
     return(true);      return _responseChunkCallback != 0;
 } }
  
 // This is only called from SimpleResponseHandler.deliver() but lives in this // This is only called from SimpleResponseHandler.deliver() but lives in this
Line 135 
Line 132 
 // to go through. Only operation classes have a response pointer // to go through. Only operation classes have a response pointer
 void OperationResponseHandler::send(Boolean isComplete) void OperationResponseHandler::send(Boolean isComplete)
 { {
         // some handlers do not send async because their callers cannot handle      // It is possible to instantiate this class directly (not a derived
         // partial responses. If this is the case, stop here.      // class, which would also inherit from SimpleResponseHandler).
       // The caller would do this only if the operation does not have any
         if (isAsync() == false)      // data to be returned.
         {  
                 // preserve tradional behavior      SimpleResponseHandler* simpleP =
                 if (isComplete == true)          dynamic_cast<SimpleResponseHandler*>(this);
       if (simpleP == 0)
         {         {
             transfer();          // if there is no data to be returned, then the message should NEVER be
         }          // incomplete (even on an error)
           PEGASUS_ASSERT(isComplete);
         return;         return;
         }         }
  
         SimpleResponseHandler *simpleP = dynamic_cast<SimpleResponseHandler*>(this);      // some handlers do not send async because their callers cannot handle
       // partial responses. If this is the case, stop here.
         // It is possible to instantiate this class directly (not derived)  
         // The caller would do this only if the operation does not have any data to  
         // be returned  
  
         if (! simpleP)      if (!isAsync())
         {         {
                 // if there is no data to be returned, then the message should NEVER be          // preserve traditional behavior
                 // incomplete (even on an error)          if (isComplete)
                 if (isComplete == false)          {
               if (_response != 0)
         {         {
             PEGASUS_ASSERT(false);                  _response->operationContext.set(
                       ContentLanguageListContainer(simpleP->getLanguages()));
               }
               transfer();
         }         }
  
         return;         return;
Line 280 
Line 279 
     // operation.     // operation.
     CIMClass cimClass;     CIMClass cimClass;
  
     NormalizerContext * context = 0;      if(request->operationContext.contains(CachedClassDefinitionContainer::NAME))
   
     try  
     {     {
         CachedClassDefinitionContainer container =         CachedClassDefinitionContainer container =
             request->operationContext.get(CachedClassDefinitionContainer::NAME);              request->operationContext.get(
                   CachedClassDefinitionContainer::NAME);
  
         cimClass = container.getClass();         cimClass = container.getClass();
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
         NormalizerContextContainer contextContainer =  
             request->operationContext.get(NormalizerContextContainer::NAME);  
         context = contextContainer.getContext();  
 #endif //PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
     }  
     catch(Exception &)  
     {  
         // Do nothing. Container is missing, which implies normalization is disabled  
         // for this operation.  
     }     }
  
     _normalizer =      AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext());
         ObjectNormalizer(      ObjectNormalizer tmpNormalizer(
             cimClass,             cimClass,
             request->includeQualifiers,             request->includeQualifiers,
             request->includeClassOrigin,             request->includeClassOrigin,
             request->nameSpace,             request->nameSpace,
             context);          tmpContext);
       _normalizer = tmpNormalizer;
     #endif     #endif
 } }
  
Line 403 
Line 392 
     // operation. If it does not exist, then this feature is disabled for this     // operation. If it does not exist, then this feature is disabled for this
     // operation.     // operation.
     CIMClass cimClass;     CIMClass cimClass;
     NormalizerContext * context = 0;  
  
     try      if(request->operationContext.contains(CachedClassDefinitionContainer::NAME))
     {     {
         CachedClassDefinitionContainer container =         CachedClassDefinitionContainer container =
             request->operationContext.get(CachedClassDefinitionContainer::NAME);              request->operationContext.get(
                   CachedClassDefinitionContainer::NAME);
         cimClass = container.getClass();         cimClass = container.getClass();
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
         NormalizerContextContainer contextContainer =  
             request->operationContext.get(NormalizerContextContainer::NAME);  
         context = contextContainer.getContext();  
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
     }  
     catch(Exception &)  
     {  
         // Do nothing. Container is missing, which implies normalization is disabled  
         // for this operation.  
     }     }
  
     _normalizer =      AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext());
         ObjectNormalizer(      ObjectNormalizer tmpNormalizer(
             cimClass,             cimClass,
             request->includeQualifiers,             request->includeQualifiers,
             request->includeClassOrigin,             request->includeClassOrigin,
             request->nameSpace,             request->nameSpace,
             context);          tmpContext);
       _normalizer = tmpNormalizer;
     #endif     #endif
 } }
  
Line 479 
Line 458 
     // operation. If it does not exist, then this feature is disabled for this     // operation. If it does not exist, then this feature is disabled for this
     // operation.     // operation.
     CIMClass cimClass;     CIMClass cimClass;
     NormalizerContext * context = 0;  
  
     try      if(request->operationContext.contains(CachedClassDefinitionContainer::NAME))
     {     {
         CachedClassDefinitionContainer container =         CachedClassDefinitionContainer container =
             request->operationContext.get(CachedClassDefinitionContainer::NAME);              request->operationContext.get(
                   CachedClassDefinitionContainer::NAME);
  
         cimClass = container.getClass();         cimClass = container.getClass();
 #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
         NormalizerContextContainer contextContainer =  
             request->operationContext.get(NormalizerContextContainer::NAME);  
         context = contextContainer.getContext();  
 #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT  
     }  
     catch(Exception &)  
     {  
         // Do nothing. Container is missing, which implies normalization is disabled  
         // for this operation.  
     }     }
  
     _normalizer =      AutoPtr<NormalizerContext> tmpContext(new CIMOMHandleContext());
         ObjectNormalizer(      ObjectNormalizer tmpNormalizer(
             cimClass,             cimClass,
             false,             false,
             false,             false,
             request->nameSpace,             request->nameSpace,
             context);          tmpContext);
       _normalizer = tmpNormalizer;
     #endif     #endif
 } }
  
Line 984 
Line 954 
 EnableIndicationsResponseHandler::EnableIndicationsResponseHandler( EnableIndicationsResponseHandler::EnableIndicationsResponseHandler(
     CIMRequestMessage* request,     CIMRequestMessage* request,
     CIMResponseMessage* response,     CIMResponseMessage* response,
     CIMInstance& provider,      const CIMInstance& provider,
     PEGASUS_INDICATION_CALLBACK_T indicationCallback,     PEGASUS_INDICATION_CALLBACK_T indicationCallback,
     PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)     PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback)
     : OperationResponseHandler(request, response, responseChunkCallback),     : OperationResponseHandler(request, response, responseChunkCallback),
Line 1021 
Line 991 
     //  Get list of subscription instance names from context     //  Get list of subscription instance names from context
     Array<CIMObjectPath> subscriptionInstanceNames;     Array<CIMObjectPath> subscriptionInstanceNames;
  
     try      if(context.contains(SubscriptionInstanceNamesContainer::NAME))
     {     {
         SubscriptionInstanceNamesContainer container =         SubscriptionInstanceNamesContainer container =
             context.get(SubscriptionInstanceNamesContainer::NAME);             context.get(SubscriptionInstanceNamesContainer::NAME);
  
         subscriptionInstanceNames = container.getInstanceNames();         subscriptionInstanceNames = container.getInstanceNames();
     }     }
     catch(Exception &)      else
     {     {
         subscriptionInstanceNames.clear();         subscriptionInstanceNames.clear();
     }     }
Line 1036 
Line 1006 
     // l10n     // l10n
     ContentLanguageList contentLangs;     ContentLanguageList contentLangs;
  
     try      if(context.contains(ContentLanguageListContainer::NAME))
     {     {
         // Get the Content-Language for this indication.  The provider         // Get the Content-Language for this indication.  The provider
         // does not have to add specify a language for the indication.         // does not have to add specify a language for the indication.
Line 1045 
Line 1015 
  
         contentLangs = langContainer.getLanguages();         contentLangs = langContainer.getLanguages();
     }     }
     catch(Exception &)      else
     {     {
         // The provider did not explicitly set a Content-Language for         // The provider did not explicitly set a Content-Language for
         // the indication.  Fall back to the lang set in this object.         // the indication.  Fall back to the lang set in this object.
Line 1066 
Line 1036 
  
     request->operationContext = context;     request->operationContext = context;
  
     try      if(request->operationContext.contains(ContentLanguageListContainer::NAME))
     {     {
         request->operationContext.set(ContentLanguageListContainer(contentLangs));         request->operationContext.set(ContentLanguageListContainer(contentLangs));
     }     }
     catch(Exception &)      else
     {     {
         request->operationContext.insert(ContentLanguageListContainer(contentLangs));         request->operationContext.insert(ContentLanguageListContainer(contentLangs));
     }     }


Legend:
Removed from v.1.11.8.3  
changed lines
  Added in v.1.20

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2