(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.26 and 1.33.2.2

version 1.26, 2008/09/17 06:02:57 version 1.33.2.2, 2009/10/01 09:33:41
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.  
 // //
 //==============================================================================  //////////////////////////////////////////////////////////////////////////
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 52 
Line 50 
     if (request->operationContext.contains(     if (request->operationContext.contains(
             CachedClassDefinitionContainer::NAME))             CachedClassDefinitionContainer::NAME))
     {     {
         CIMClass cimClass;  
         CachedClassDefinitionContainer container =         CachedClassDefinitionContainer container =
             request->operationContext.get(             request->operationContext.get(
                 CachedClassDefinitionContainer::NAME);                 CachedClassDefinitionContainer::NAME);
         cimClass = container.getClass();          CIMClass cimClass = container.getClass().clone();
           container = CachedClassDefinitionContainer(cimClass);
         SharedPtr<NormalizerContext> tmpContext(new CIMOMHandleContext());         SharedPtr<NormalizerContext> tmpContext(new CIMOMHandleContext());
         ObjectNormalizer tmpNormalizer(         ObjectNormalizer tmpNormalizer(
             cimClass,             cimClass,
Line 320 
Line 318 
         _normalizer);         _normalizer);
 } }
  
   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);
       }
   
       SCMOInstance localInstance(cimInstance);
   #ifdef PEGASUS_ENABLE_OBJECT_NORMALIZATION
       // The normalizer expects an object path embedded in instances even
       // though it is not required by this operation. Use the requested
       // object path is missing from the instance.
       if (localInstance.getPath().getKeyBindings().size() == 0)
       {
           // ATTN: should clone before modification
           localInstance.setPath(static_cast<CIMGetInstanceRequestMessage*>(
               getRequest())->instanceName);
       }
   #endif
       SimpleInstanceResponseHandler::deliver(localInstance);
       // TBD
       //_normalizer.processInstance(localInstance));
   }
   
 void GetInstanceResponseHandler::deliver(const CIMInstance& cimInstance) void GetInstanceResponseHandler::deliver(const CIMInstance& cimInstance)
 { {
     if (cimInstance.isUninitialized())     if (cimInstance.isUninitialized())
Line 383 
Line 418 
         CIMGetInstanceResponseMessage& msg =         CIMGetInstanceResponseMessage& msg =
             *static_cast<CIMGetInstanceResponseMessage*>(getResponse());             *static_cast<CIMGetInstanceResponseMessage*>(getResponse());
  
         msg.cimInstance = getObjects()[0];          msg.getResponseData().setSCMOInstance(getSCMOObjects()[0]);
           // TODO --RK--> enable for C++ Providers again
           // msg.getResponseData().setCimInstance(getObjects()[0]);
     }     }
 } }
  
Line 429 
Line 466 
         _normalizer.processInstance(cimInstance));         _normalizer.processInstance(cimInstance));
 } }
  
   void EnumerateInstancesResponseHandler::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);
       }
   
       SimpleInstanceResponseHandler::deliver(cimInstance);
       // TBD
       //    _normalizer.processInstance(cimInstance));
   }
   
 String EnumerateInstancesResponseHandler::getClass() const String EnumerateInstancesResponseHandler::getClass() const
 { {
     return String("EnumerateInstancesResponseHandler");     return String("EnumerateInstancesResponseHandler");
Line 439 
Line 492 
     CIMEnumerateInstancesResponseMessage& msg =     CIMEnumerateInstancesResponseMessage& msg =
         *static_cast<CIMEnumerateInstancesResponseMessage*>(getResponse());         *static_cast<CIMEnumerateInstancesResponseMessage*>(getResponse());
  
     msg.cimNamedInstances = getObjects();      // TBD --RK--> enable for C++ Providers again
       msg.getResponseData().setSCMOInstances(getSCMOObjects());
 } }
  
 // //
Line 475 
Line 529 
         _normalizer.processInstanceObjectPath(cimObjectPath));         _normalizer.processInstanceObjectPath(cimObjectPath));
 } }
  
   void EnumerateInstanceNamesResponseHandler::deliver(
       const SCMOInstance& scmoObjectPath)
   {
       if (scmoObjectPath.getClassName()==NULL)
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
   
       SimpleObjectPathResponseHandler::deliver(scmoObjectPath);
       // TBD
       //        _normalizer.processInstanceObjectPath(cimObjectPath));
   }
   
 String EnumerateInstanceNamesResponseHandler::getClass() const String EnumerateInstanceNamesResponseHandler::getClass() const
 { {
     return String("EnumerateInstanceNamesResponseHandler");     return String("EnumerateInstanceNamesResponseHandler");
Line 485 
Line 556 
     CIMEnumerateInstanceNamesResponseMessage& msg =     CIMEnumerateInstanceNamesResponseMessage& msg =
         *static_cast<CIMEnumerateInstanceNamesResponseMessage*>(getResponse());         *static_cast<CIMEnumerateInstanceNamesResponseMessage*>(getResponse());
  
     msg.instanceNames = getObjects();      // TODO --RK--> enable for C++ Providers again
       msg.getResponseData().setSCMOInstanceNames(getSCMOObjects());
 } }
  
 // //
Line 523 
Line 595 
     SimpleObjectPathResponseHandler::deliver(cimObjectPath);     SimpleObjectPathResponseHandler::deliver(cimObjectPath);
 } }
  
   void CreateInstanceResponseHandler::deliver(const SCMOInstance& cimObjectPath)
   {
       if (cimObjectPath.getClassName() == 0)
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
   
       if (SimpleObjectPathResponseHandler::size() != 0)
       {
           MessageLoaderParms message(
               "Server.OperationResponseHandler.TOO_MANY_OBJECTS_DELIVERED",
               "Too many objects delivered.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
   
       SimpleObjectPathResponseHandler::deliver(cimObjectPath);
   }
   
 void CreateInstanceResponseHandler::complete() void CreateInstanceResponseHandler::complete()
 { {
     if (SimpleObjectPathResponseHandler::size() == 0)     if (SimpleObjectPathResponseHandler::size() == 0)
Line 693 
Line 788 
     SimpleInstance2ObjectResponseHandler::deliver(cimInstance);     SimpleInstance2ObjectResponseHandler::deliver(cimInstance);
 } }
  
   void ExecQueryResponseHandler::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);
       }
   
       SimpleInstance2ObjectResponseHandler::deliver(cimInstance);
   }
   
 String ExecQueryResponseHandler::getClass() const String ExecQueryResponseHandler::getClass() const
 { {
     return String("ExecQueryResponseHandler");     return String("ExecQueryResponseHandler");
Line 703 
Line 812 
     CIMExecQueryResponseMessage& msg =     CIMExecQueryResponseMessage& msg =
         *static_cast<CIMExecQueryResponseMessage*>(getResponse());         *static_cast<CIMExecQueryResponseMessage*>(getResponse());
  
     msg.cimObjects = getObjects();      msg.getResponseData().setCIMObjects(getObjects());
 } }
  
 Boolean ExecQueryResponseHandler::isAsync() const Boolean ExecQueryResponseHandler::isAsync() const
Line 737 
Line 846 
     SimpleObjectResponseHandler::deliver(cimObject);     SimpleObjectResponseHandler::deliver(cimObject);
 } }
  
   void AssociatorsResponseHandler::deliver(const SCMOInstance& cimObject)
   {
       if (cimObject.isUninitialized())
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
   
       SimpleObjectResponseHandler::deliver(cimObject);
   }
   
 String AssociatorsResponseHandler::getClass() const String AssociatorsResponseHandler::getClass() const
 { {
     return String("AssociatorsResponseHandler");     return String("AssociatorsResponseHandler");
Line 747 
Line 870 
     CIMAssociatorsResponseMessage& msg =     CIMAssociatorsResponseMessage& msg =
         *static_cast<CIMAssociatorsResponseMessage*>(getResponse());         *static_cast<CIMAssociatorsResponseMessage*>(getResponse());
  
     msg.cimObjects = getObjects();      // TODO --RK--> enable for C++ Providers again
       msg.getResponseData().setCIMObjects(getObjects());
 } }
  
 // //
Line 776 
Line 900 
     SimpleObjectPathResponseHandler::deliver(cimObjectPath);     SimpleObjectPathResponseHandler::deliver(cimObjectPath);
 } }
  
   void AssociatorNamesResponseHandler::deliver(const SCMOInstance& cimObjectPath)
   {
       if (cimObjectPath.getClassName() == 0)
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
   
       SimpleObjectPathResponseHandler::deliver(cimObjectPath);
   }
   
 String AssociatorNamesResponseHandler::getClass() const String AssociatorNamesResponseHandler::getClass() const
 { {
     return String("AssociatorNamesResponseHandler");     return String("AssociatorNamesResponseHandler");
Line 815 
Line 953 
     SimpleObjectResponseHandler::deliver(cimObject);     SimpleObjectResponseHandler::deliver(cimObject);
 } }
  
   void ReferencesResponseHandler::deliver(const SCMOInstance& cimObject)
   {
       if (cimObject.isUninitialized())
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
   
       SimpleObjectResponseHandler::deliver(cimObject);
   }
   
 String ReferencesResponseHandler::getClass() const String ReferencesResponseHandler::getClass() const
 { {
     return String("ReferencesResponseHandler");     return String("ReferencesResponseHandler");
Line 854 
Line 1006 
     SimpleObjectPathResponseHandler::deliver(cimObjectPath);     SimpleObjectPathResponseHandler::deliver(cimObjectPath);
 } }
  
   void ReferenceNamesResponseHandler::deliver(const SCMOInstance& cimObjectPath)
   {
       if (cimObjectPath.getClassName() == 0)
       {
           MessageLoaderParms message(
               "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION",
               "The object is not initialized.");
   
           throw CIMException(CIM_ERR_FAILED, message);
       }
   
       SimpleObjectPathResponseHandler::deliver(cimObjectPath);
   }
   
 String ReferenceNamesResponseHandler::getClass() const String ReferenceNamesResponseHandler::getClass() const
 { {
     return String("ReferenceNamesResponseHandler");     return String("ReferenceNamesResponseHandler");


Legend:
Removed from v.1.26  
changed lines
  Added in v.1.33.2.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2