(file) Return to ProviderRegistrationProvider.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ControlProviders / ProviderRegistrationProvider

  1 kumpf 1.1 //%/////////////////////////////////////////////////////////////////////////////
  2           //
  3           // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
  4           //
  5           // Permission is hereby granted, free of charge, to any person obtaining a copy
  6           // of this software and associated documentation files (the "Software"), to
  7           // deal in the Software without restriction, including without limitation the
  8           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9           // sell copies of the Software, and to permit persons to whom the Software is
 10           // furnished to do so, subject to the following conditions:
 11           //
 12           // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 13           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 14           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 15           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 16           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 17           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 18           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 19           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 20           //
 21           //==============================================================================
 22 kumpf 1.1 //
 23           // Author: Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com)
 24           //
 25           // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 26           //
 27           //%/////////////////////////////////////////////////////////////////////////////
 28           
 29           #include <Pegasus/Common/Config.h>
 30           #include "Linkage.h"
 31           
 32           #include <Pegasus/Provider/CIMInstanceProvider.h>
 33           #include <Pegasus/Provider/CIMMethodProvider.h>
 34 kumpf 1.3 #include <Pegasus/Common/ModuleController.h>
 35 kumpf 1.1 
 36           #include <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h>
 37           
 38           PEGASUS_NAMESPACE_BEGIN
 39           
 40           class PEGASUS_PROVREGPROVIDER_LINKAGE ProviderRegistrationProvider :
 41               public CIMInstanceProvider,
 42               public CIMMethodProvider
 43           {
 44           public:
 45 kumpf 1.3 
 46                 class callback_data
 47                 {
 48                    public:
 49           
 50                       Message *reply;
 51                       Semaphore client_sem;
 52                       ProviderRegistrationProvider & cimom_handle;
 53           
 54                       callback_data(ProviderRegistrationProvider *handle)
 55                          : reply(0), client_sem(0), cimom_handle(*handle)
 56                       {
 57                       }
 58                       ~callback_data()
 59                       {
 60                          delete reply;
 61                       }
 62           
 63                       Message *get_reply(void)
 64                       {
 65                          Message *ret = reply;
 66 kumpf 1.3                reply = NULL;
 67                          return ret;
 68                       }
 69           
 70                    private:
 71                       callback_data(void);
 72                 };
 73           
 74           
 75               static void async_callback(Uint32 user_data, Message *reply, void *parm);
 76           
 77 kumpf 1.1     ProviderRegistrationProvider(
 78                   ProviderRegistrationManager* providerRegistrationManager);
 79               virtual ~ProviderRegistrationProvider(void);
 80           
 81 kumpf 1.3 ProviderRegistrationProvider & operator=(const ProviderRegistrationProvider & handle);
 82           
 83 kumpf 1.1     // CIMBaseProvider interface
 84               virtual void initialize(CIMOMHandle& cimom);
 85               virtual void terminate(void);
 86           
 87               // CIMInstanceProvider interface
 88               virtual void getInstance(
 89                   const OperationContext & context,
 90 kumpf 1.5         const CIMObjectPath & instanceReference,
 91 kumpf 1.1         const Uint32 flags,
 92 kumpf 1.2         const CIMPropertyList & propertyList,
 93 kumpf 1.1         ResponseHandler<CIMInstance> & handler);
 94           
 95               virtual void enumerateInstances(
 96                   const OperationContext & context,
 97 kumpf 1.5         const CIMObjectPath & classReference,
 98 kumpf 1.1         const Uint32 flags,
 99 kumpf 1.2         const CIMPropertyList & propertyList,
100 kumpf 1.1         ResponseHandler<CIMInstance> & handler);
101           
102               virtual void enumerateInstanceNames(
103                   const OperationContext & context,
104 kumpf 1.5         const CIMObjectPath & classReference,
105                   ResponseHandler<CIMObjectPath> & handler);
106 kumpf 1.1 
107               virtual void modifyInstance(
108                   const OperationContext & context,
109 kumpf 1.5         const CIMObjectPath & instanceReference,
110 kumpf 1.1         const CIMInstance & instanceObject,
111                   const Uint32 flags,
112 kumpf 1.2         const CIMPropertyList & propertyList,
113 kumpf 1.1         ResponseHandler<CIMInstance> & handler);
114           
115               virtual void createInstance(
116                   const OperationContext & context,
117 kumpf 1.5         const CIMObjectPath & instanceReference,
118 kumpf 1.1         const CIMInstance & instanceObject,
119 kumpf 1.5         ResponseHandler<CIMObjectPath> & handler);
120 kumpf 1.1 
121               virtual void deleteInstance(
122                   const OperationContext & context,
123 kumpf 1.5         const CIMObjectPath & instanceReference,
124 kumpf 1.1         ResponseHandler<CIMInstance> & handler);
125           
126               // CIMMethodProvider interface
127               virtual void invokeMethod(
128                   const OperationContext & context,
129 kumpf 1.5         const CIMObjectPath & objectReference,
130 kumpf 1.1         const String & methodName,
131                   const Array<CIMParamValue> & inParameters,
132                   Array<CIMParamValue> & outParameters,
133                   ResponseHandler<CIMValue> & handler);
134           
135           protected:
136 kumpf 1.3 
137               pegasus_internal_identity _id;
138               ModuleController * _controller;
139               ModuleController::client_handle *_client_handle;
140           
141 kumpf 1.1     ProviderRegistrationManager* _providerRegistrationManager;
142 kumpf 1.3 
143               MessageQueueService * _getProviderManagerService();
144               Array<Uint16> _sendDisableMessageToProviderManager(
145           	CIMDisableModuleRequestMessage * notify_req);
146               Array<Uint16> _sendEnableMessageToProviderManager(
147           	CIMEnableModuleRequestMessage * notify_req);
148 kumpf 1.4     MessageQueueService * _getIndicationService();
149               void _sendTerminationMessageToSubscription(
150 kumpf 1.5 	const CIMObjectPath & ref, const String & moduleName);
151 kumpf 1.1 };
152           
153           PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2