/scratch/rpmbuild.22230.L22270/pegasus/src/Pegasus/Common/ResponseHandler.h

00001 //%LICENSE////////////////////////////////////////////////////////////////
00002 //
00003 // Licensed to The Open Group (TOG) under one or more contributor license
00004 // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
00005 // this work for additional information regarding copyright ownership.
00006 // Each contributor licenses this file to you under the OpenPegasus Open
00007 // Source License; you may not use this file except in compliance with the
00008 // License.
00009 //
00010 // Permission is hereby granted, free of charge, to any person obtaining a
00011 // copy of this software and associated documentation files (the "Software"),
00012 // to deal in the Software without restriction, including without limitation
00013 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
00014 // and/or sell copies of the Software, and to permit persons to whom the
00015 // Software is furnished to do so, subject to the following conditions:
00016 //
00017 // The above copyright notice and this permission notice shall be included
00018 // in all copies or substantial portions of the Software.
00019 //
00020 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00021 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00022 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00023 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00024 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00025 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00026 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00027 //
00029 //
00030 //%/////////////////////////////////////////////////////////////////////////////
00031 
00032 #ifndef Pegasus_ResponseHandler_h
00033 #define Pegasus_ResponseHandler_h
00034 
00035 #include <Pegasus/Common/Config.h>
00036 #include <Pegasus/Common/Array.h>
00037 #include <Pegasus/Common/Linkage.h>
00038 
00039 #include <Pegasus/Common/CIMInstance.h>
00040 #include <Pegasus/Common/CIMObjectPath.h>
00041 #include <Pegasus/Common/CIMParamValue.h>
00042 #include <Pegasus/Common/CIMValue.h>
00043 #include <Pegasus/Common/CIMIndication.h>
00044 #include <Pegasus/Common/CIMObject.h>
00045 #include <Pegasus/Common/CIMClass.h>
00046 #include <Pegasus/Common/OperationContext.h>
00047 
00048 PEGASUS_NAMESPACE_BEGIN
00049 
00055 class PEGASUS_COMMON_LINKAGE ResponseHandler
00056 {
00057 public:
00058 
00062     virtual ~ResponseHandler();
00063 
00064     // This method is defined in subclasses, specialized for
00065     // the appropriate data type.
00066     //virtual void deliver(const T & object);
00067 
00068     // This method is defined in subclasses, specialized for
00069     // the appropriate data type.
00070     //virtual void deliver(const Array<T> & objects);
00071 
00076     virtual void processing() = 0;
00077 
00083     virtual void complete() = 0;
00084 
00093     void setContext(const OperationContext & context);
00094 
00095 protected:
00096 
00100     ResponseHandler();
00101 
00105     ResponseHandler(const ResponseHandler& handler);
00106 
00110     ResponseHandler& operator=(const ResponseHandler& handler);
00111 
00115     OperationContext getContext() const;
00116 };
00117 
00118 
00123 class PEGASUS_COMMON_LINKAGE InstanceResponseHandler
00124     : virtual public ResponseHandler
00125 {
00126 public:
00136     virtual void deliver(const CIMInstance & instance) = 0;
00137 
00145     virtual void deliver(const Array<CIMInstance> & instances) = 0;
00146 };
00147 
00148 
00153 class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler
00154     : virtual public ResponseHandler
00155 {
00156 public:
00166     virtual void deliver(const CIMObjectPath & objectPath) = 0;
00167 
00175     virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;
00176 };
00177 
00178 
00183 class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler
00184     : virtual public ResponseHandler
00185 {
00186 public:
00196     virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;
00197 
00206     virtual void deliverParamValue(
00207         const Array<CIMParamValue> & outParamValues) = 0;
00208 
00215     virtual void deliver(const CIMValue & returnValue) = 0;
00216 };
00217 
00218 
00223 class PEGASUS_COMMON_LINKAGE IndicationResponseHandler
00224     : virtual public ResponseHandler
00225 {
00226 public:
00236     virtual void deliver(const CIMIndication & indication) = 0;
00237 
00246     virtual void deliver(const Array<CIMIndication> & indications) = 0;
00247 
00258     virtual void deliver(
00259         const OperationContext & context,
00260         const CIMIndication & indication) = 0;
00261 
00272     virtual void deliver(
00273         const OperationContext & context,
00274         const Array<CIMIndication> & indications) = 0;
00275 };
00276 
00277 
00282 class PEGASUS_COMMON_LINKAGE ObjectResponseHandler
00283     : virtual public ResponseHandler
00284 {
00285 public:
00295     virtual void deliver(const CIMObject & object) = 0;
00296 
00304     virtual void deliver(const Array<CIMObject> & objects) = 0;
00305 };
00306 
00307 PEGASUS_NAMESPACE_END
00308 
00309 #endif