/usr/src/startcom/BUILD/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 class SCMOInstance;
00119 
00124 class PEGASUS_COMMON_LINKAGE InstanceResponseHandler
00125     : virtual public ResponseHandler
00126 {
00127 public:
00137     virtual void deliver(const CIMInstance & instance) = 0;
00138     virtual void deliver(const SCMOInstance & instance) = 0;
00139 
00147     virtual void deliver(const Array<CIMInstance> & instances) = 0;
00148 };
00149 
00150 
00155 class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler
00156     : virtual public ResponseHandler
00157 {
00158 public:
00168     virtual void deliver(const CIMObjectPath & objectPath) = 0;
00169     virtual void deliver(const SCMOInstance & instance) = 0;
00170 
00178     virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;
00179 };
00180 
00181 
00186 class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler
00187     : virtual public ResponseHandler
00188 {
00189 public:
00199     virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;
00200 
00209     virtual void deliverParamValue(
00210         const Array<CIMParamValue> & outParamValues) = 0;
00211 
00218     virtual void deliver(const CIMValue & returnValue) = 0;
00219 };
00220 
00221 
00226 class PEGASUS_COMMON_LINKAGE IndicationResponseHandler
00227     : virtual public ResponseHandler
00228 {
00229 public:
00239     virtual void deliver(const CIMIndication & indication) = 0;
00240 
00249     virtual void deliver(const Array<CIMIndication> & indications) = 0;
00250 
00261     virtual void deliver(
00262         const OperationContext & context,
00263         const CIMIndication & indication) = 0;
00264 
00275     virtual void deliver(
00276         const OperationContext & context,
00277         const Array<CIMIndication> & indications) = 0;
00278 };
00279 
00280 
00285 class PEGASUS_COMMON_LINKAGE ObjectResponseHandler
00286     : virtual public ResponseHandler
00287 {
00288 public:
00298     virtual void deliver(const CIMObject & object) = 0;
00299     virtual void deliver(const CIMInstance & instance) = 0;
00300     virtual void deliver(const SCMOInstance & instance) = 0;
00301 
00309     virtual void deliver(const Array<CIMObject> & objects) = 0;
00310 };
00311 
00312 PEGASUS_NAMESPACE_END
00313 
00314 #endif